
                        @   d Z ddlmZ ddlmZ ddlmZ ddlZddlZddlZddlZddl	Z	ddl
mZ ddl
mZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ  ddlm!Z! ddl"m#Z# ddl"m$Z$ ddl%m&Z& ddl'Z'ddl(m)Z) ddl*Z'dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4d Z5d!Z6d"Z7d#Z8d$Z9d%Z:d&Z;d'Z<d(Z=d)Z>d*Z?d+Z@d,ZAd-ZBd.ZCd/ZDd0ZEd1ZFd2ZGd3ZHd4ZId5ZJd6ZKd7ZLd8ZMd9ZNd:ZOd;ZPd<ZQd=ZRd>ZSd?ZTd@ZUdAZVdBZWdCZXdDZYdEZZdFZ[dGZ\dHZ]dIZ^dJZ_dKZ`dLZadMZbdNZcdOZddPZedQZfdRZgdSZhdTZidUZjdVZkdWZldXZmdYZndZZod[Zpd\Zqd]Zrd^Zsd_Ztd`ZudaZvdbZwdcZxddZydeZzdfZ{dgZ|dhZ}diZ~djZdkZdlZdmZdnZdoZdpZdqZdrZdsZdtZduZdvZdwZdxZdyZdzZd{Zd|Zd}Zd~ZdZdZdZdZdZdZdZdZexeygZddgZdgZeezeee}e~ee|eeeeeegz   Zeeegz   Zee{gz   ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZeeeeeeeeeeg
ZeeeeeeeeeeeeeeeegZeeeegZddgZddgZdZdZdZdZdZd Zd Zd Zd Zd Zd Zd ZdZd Zd Z G d de˫      Z G d de˫      Z G d de˫      Z G d de˫      Z G d de˫      Z G d de˫      Z G d de˫      Z G d deҫ      Z G d deӫ      Z G dÄ deԫ      Zdń ZdƄ ZdǄ ZdȄ ZdɄ Zdʄ Zd˄ Zd̄ Zd̈́ Zd΄ Zdτ ZdЄ Zdф Zd҄ Zdӄ ZdԄ ZdՄ Zdք Zdׄ Zd؄ Zdل Zdڄ Zdۄ Zd܄ Zd݄ Zdބ Zd߄ Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZddZ d Zd Zy)z'Api client adapter containers commands.    )absolute_import)division)unicode_literalsN)
exceptions)http_wrapper)	constants)util)apis)base)	arg_utils)labels_util)log)
properties)	resources)yaml)
console_io)progress_tracker)timesrangezU{error}
Could not find [{name}] in [{wrong_zone}].
Did you mean [{name}] in [{zone}]?z/{error}
No cluster named '{name}' in {project}.z)No node pool named '{name}' in {cluster}.z0Please specify one of the following node pools:
z`Cannot use --master-authorized-networks if --enable-master-authorized-networks is not specified.z,Node autoprovisioning is currently in beta.
zIMust specify both --max-cpu and --max-memory to enable autoprovisioning.
zNMust enable node autoprovisioning to specify resource limits for autoscaling.
zQMust enable node autoprovisioning to specify defaults for node autoprovisioning.
a  Must specify both 'maxSurgeUpgrade' and 'maxUnavailableUpgrade' in 'upgradeSettings' in --autoprovisioning-config-file, or both '--autoprovisioning-max-surge-upgrade' and '--autoprovisioning-max-unavailable-upgrade' from cmd argument to set a surge upgrade strategy.
zMust specify both 'autoUpgrade' and 'autoRepair' in 'management' in --autoprovisioning-config-file to set management settings.
zMust specify both 'enableSecureBoot' and 'enableIntegrityMonitoring' in 'shieldedInstanceConfig' in --autoprovisioning-config-file to set management settings.
zYMust specify both or none of --shielded-secure-boot and --shielded-integrity-monitoring.
zSMust specify --enable-autoprovisioning to specify resource limits for autoscaling.
zQMaximum and minimum accelerator limits must be set on the same accelerator type.
z5No label named '{name}' found on cluster '{cluster}'.z,Cluster '{cluster}' has no labels to remove.zNInvalid key '{key}' for --create-subnetwork (must be one of 'name', 'range').
zKCannot specify both --subnetwork and --create-subnetwork at the same time.
zS
Invalid key '{key}' for --create-pod-ipv4-range (must be one of 'name', 'range').
zcInvalid value [{key}={value}] for argument --node-taints. Node taint is of format key=value:effect
z}Invalid taint effect [{effect}] for argument --node-taints. Valid effect values are NoSchedule, PreferNoSchedule, NoExecute'
zfInvalid local SSD format [{err_format}] for argument --local-ssd-volumes. Valid formats are fs, block
zeInvalid option '{option}' for '--workload-metadata' (must be one of 'gce_metadata', 'gke_metadata').
z_Flag --allow-route-overlap must be used with either --enable-ip-alias or --no-enable-ip-alias.
zrFlag --cluster-ipv4-cidr must be fully specified (e.g. `10.96.0.0/14`, but not `/14`) with --allow-route-overlap.
zFlag --services-ipv4-cidr must be fully specified (e.g. `10.96.0.0/14`, but not `/14`) with --allow-route-overlap and --enable-ip-alias.
z1Cannot specify --{opt} without --{prerequisite}.
zFlag --enable-stackdriver-kubernetes requires Cloud Logging and Cloud Monitoring enabled with --enable-cloud-logging and --enable-cloud-monitoring.
zThe CloudRun-on-GKE addon (--addons=CloudRun) requires System Logging and Monitoring to be enabled via the --monitoring=SYSTEM and --logging=SYSTEM flags.
zThe CloudRun-on-GKE addon (--addons=CloudRun) requires HTTP Load Balancing to be enabled via the --addons=HttpLoadBalancing flag.
zThe ConfigConnector-on-GKE addon (--addons=ConfigConnector) requires System Logging and Monitoring to be enabled via the --monitoring=SYSTEM and --logging=SYSTEM flags.
zThe ConfigConnector-on-GKE addon (--addons=ConfigConnector) requires workload identity to be enabled via the --workload-pool=WORKLOAD_POOL flag.
zCloud Build for Anthos (--addons=CloudBuild) requires System Logging and Monitoring to be enabled via the --monitoring=SYSTEM and --logging=SYSTEM flags.
zBCannot use --default-max-pods-per-node without --enable-ip-alias.
z:Cannot use --max-pods-per-node without --enable-ip-alias.
zLCannot use --alpha-cluster-feature-gates without --enable-kubernetes-alpha.
zNothing to update.
z]Cannot specify both --[no-]enable-private-nodes and --[no-]private-cluster at the same time.
z\Cannot use --[no-]enable-network-egress-metering without --resource-usage-bigquery-dataset.
zbCannot use --[no-]enable-resource-consumption-metering without --resource-usage-bigquery-dataset.
z=Cannot use --disable-default-snat without --enable-ip-alias.
zBCannot use --disable-default-snat without --enable-private-nodes.
z@Must specify --reservation for --reservation-affinity=specific.
zDCannot specify --reservation for --reservation-affinity={affinity}.
zfInvalid provider '{provider}' for argument --datapath-provider. Valid providers are legacy, advanced.
zyInvalid '{mode}' for argument --dataplane-v2-observability-mode. Valid modes are DISABLED, INTERNAL_VPC_LB, EXTERNAL_LB.
zMust specify sandbox type.
z.Provided sandbox type '{type}' not supported.
zDCannot specify --tpu-ipv4-cidr with --enable-tpu-service-networking.zvInvalid gpu sharing strategy [{gpu-sharing-strategy}] for argument --accelerator. Valid values are time-sharing, mps'
z}Invalid gpu driver version [{gpu-driver-version}] for argument --accelerator. Valid values are default, latest, or disabled'
z;Provided maintenance interval type '{type}' not supported.
zkInvalid managed config type '{type}' for argument --managed-config. Valid values are: autofleet, disabled'
zQInvalid mode '{mode}' for '--compliance' (must be one of 'enabled', 'disabled').
zACannot specify --compliance-standards with --compliance=disabled
zCCannot enable Auto Monitoring without enabling Managed Prometheus.
znInvalid value '{standards}' for --compliance-standards: must provide a list of standards separated by commas.
zfInvalid mode '{mode}' for '--security-posture' (must be one of 'disabled', 'standard', 'enterprise').
zuInvalid mode '{mode}' for '--workload-vulnerability-scanning' (must be one of 'disabled', 'standard', 'enterprise').
zCProvided host maintenance interval type '{type}' is not supported.
z}Provided opportunistic maintenance field '{field}' with value '{value}' is not supported. This field must end with 's' only.
zOnodePoolDefaults.nodeKubeletConfig is not supported on GKE Autopilot clusters.
zLCan not remove subnetwork {subnetwork}: not found in additional subnetworks
zKCan not remove pod ipv4 range {range}: not found in additional subnetworks
z1Provided cluster tier '{tier}' is not supported.
z9Provided network tier '{network_tier}' is not supported.
zxInvalid format '{topology}' for argument --tpu-topology. Must provide 2-3 integers separated by 'x' (e.g. 2x4 or 2x2x4)
zhInvalid machine type '{machine_type}' for argument --machine-type. Unable to parse the number of chips.
zQInvalid type '{type}' for '--confidential-node-type' (must be one of {choices}).
z9Anonymous authentication mode '{mode}' is not supported.
z1Fleet membership type '{type}' is not supported.
z=Route-based clusters are not supported with stack type IPV6.
z0Control plane egress '{mode}' is not supported.
i  d   2   HttpLoadBalancingHorizontalPodAutoscalingKubernetesDashboard
CloudBuildBackupRestoreConfigConnectorGcePersistentDiskCsiDriverGcpFilestoreCsiDriverGcsFuseCsiDriver
StatefulHAParallelstoreCsiDriverHighScaleCheckpointingLustreCsiDriverRayOperatorIstioNetworkPolicyNodeLocalDNSApplicationManagerresourceLimitsserviceAccountminCpuPlatformupgradeSettingsmaxSurgeUpgrademaxUnavailableUpgrade
managementautoUpgrade
autoRepairscopesautoprovisioningLocationsbootDiskKmsKey
diskSizeGbdiskType	imageTypeshieldedInstanceConfigenableSecureBootenableIntegrityMonitoringCloudRunKubeRunNONESYSTEMWORKLOAD	APISERVER
API_SERVER	SCHEDULERCONTROLLER_MANAGERADDON_MANAGERKCP_SSHDKCP_CONNECTIONKCP_HPASTORAGEHPAPOD	DAEMONSET
DEPLOYMENTSTATEFULSETCADVISORKUBELETDCGMJOBSETUNSPECIFIEDCOMPACTBALANCEDANYz@^https://www.googleapis.com/compute/[a-z1-9_]+/(?P<resource>.*)$z^[^-]+-[^-]+-[^-]+$z^\d{1,3}x\d{1,3}(x\d{1,3})?$clusternodepoolc                     | j                   dk(  rt        j                  j                  |       t	        j
                  |       S )z5Wrap http_wrapper.CheckResponse to skip retry on 503.i  )status_codeapitools_exceptions	HttpErrorFromResponser   CheckResponse)responses    3lib/googlecloudsdk/api_lib/container/api_adapter.pyr_   r_     s8    S 

'
'
4
4X
>>		#	#H	--    c                     | t         j                  j                  k(  ry| t         j                  j                  k(  ry| t         j                  j                  k(  ryt        dj                  |             )Nv1v1beta1v1alpha1zUnsupported Release Track: {})r   ReleaseTrackGABETAALPHA
ValueErrorformat)release_tracks    ra   APIVersionFromReleaseTrackrn     s^    d''***))...))///
4;;MJ
KKrb   c                 R    | dk(  r
t               S | dk(  r
t               S t               S )Nrf   re   )NewV1Alpha1APIAdapterNewV1Beta1APIAdapterNewV1APIAdapter)api_versions    ra   NewAPIAdapterrt     s-    J ""i!!rb   c                  "    t        dt              S )Nrd   )InitAPIAdapter	V1Adapter rb   ra   rr   rr      s    	i	((rb   c                  "    t        dt              S )Nre   )rv   V1Beta1Adapterrx   rb   ra   rq   rq     s    		>	22rb   c                  "    t        dt              S )Nrf   )rv   V1Alpha1Adapterrx   rb   ra   rp   rp     s    	
O	44rb   c                    t        j                  d|       }t        |_        t        j                  d|       }t
        j                  j                         }|j                  d|        |j                  dd        ||||      S )zInitialize an api adapter.

  Args:
    api_version: the api version we want.
    adapter: the api adapter constructor.

  Returns:
    APIAdapter object.
  	containercomputerd   )		core_apisGetClientInstancer_   check_response_funcGetMessagesModulecloud_resourcesREGISTRYCloneRegisterApiByName)rs   adapter
api_clientmessagesregistrys        ra   rv   rv     ss     **;D*#0* ((kB(%%++-(
[+6
Y-	:x	00rb   )z.https://www.googleapis.com/auth/cloud-platformz.https://www.googleapis.com/auth/userinfo.emailc                 D   | j                   rW| j                   |_        g }| j                  D ].  }|dk(  r|j                  t               |j                  |       0 || _        t        | j                        | _        t        t        | j                              |_	        y)a  Convert node identity options into node config.

  If scopes are specified with the `--scopes` flag, respect them.
  If no scopes are presented, 'gke-default' will be passed here indicating that
  we should use the default set:
  - If no service account is specified, default set is GKE_DEFAULT_SCOPES which
    is handled by ExpandScopeURIs:
    - https://www.googleapis.com/auth/devstorage.read_only,
    - https://www.googleapis.com/auth/logging.write',
    - https://www.googleapis.com/auth/monitoring,
    - https://www.googleapis.com/auth/servicecontrol,
    - https://www.googleapis.com/auth/service.management.readonly,
    - https://www.googleapis.com/auth/trace.append,
  - If a service account is specified, default set is _SERVICE_ACCOUNT_SCOPES:
    - https://www.googleapis.com/auth/cloud-platform
    - https://www.googleapis.com/auth/userinfo.email
  Args:
    options: the CreateCluster or CreateNodePool options.
    node_config: the messages.node_config object to be populated.
  zgke-defaultN)
service_accountr,   r4   extend_SERVICE_ACCOUNT_SCOPESappendExpandScopeURIssortedsetoauthScopes)optionsnode_configreplaced_scopesscopes       ra   NodeIdentityOptionsToNodeConfigr   (  s    * !(!8!8KO	-	67u%	  
 %GN"7>>2'."3w~~#67+rb   c                 |    g }| D ]4  }t         j                  j                  ||g      }|j                  |       6 |S )aV  Expand scope names to the fully qualified uris.

  Args:
    scopes: [str,] list of scope names. Can be short names ('compute-rw') or
      full urls ('https://www.googleapis.com/auth/compute'). See SCOPES in
      api_lib/container/constants.py & api_lib/compute/constants.py.

  Returns:
    list of str, full urls for recognized scopes.
  )r   SCOPESgetr   )r4   
scope_urisr   expandeds       ra   r   r   K  sE     *e ##EE73Hh	 
 
rb   c                      e Zd ZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)CreateClusterOptionsz!Options to pass to CreateCluster.Nc                    || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
        || _        || _        || _        || _        || _        || _        |f| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        | | _        |!| _         |"| _!        |#| _"        |$| _#        |%| _$        |&| _%        |'| _&        |(| _'        |)| _(        |*| _)        |+| _*        |,| _+        |-| _,        |/| _-        |0| _.        |1| _/        |2| _0        |3| _1        |4| _2        |5| _3        |6| _4        |7| _5        |8| _6        |9| _7        |:| _8        |;| _9        |<| _:        |=| _;        |>| _<        |?| _=        B| _>        C| _?        @| _@        A| _A        D| _B        E| _C        F| _D        G| _E        H| _F        I| _G        J| _H        K| _I        L| _J        M| _K        N| _L        O| _M        P| _N        Q| _O        R| _P        S| _Q        T| _R        U| _S        V| _T        W| _U        Y| _V        X| _W        |.| _X        Z| _Y        [| _Z        \| _[        ]| _\        ^| _]        _| _^        `| __        a| _`        b| _a        c| _b        d| _c        e| _d        f| _e        g| _f        h| _g        i| _h        j| _i        k| _j        l| _k        m| _l        n| _m        o| _n        p| _o        q| _p        r| _q        s| _r        t| _s        u| _t        v| _u        w| _v        x| _w        y| _x        z| _y        {| _z        || _{        }| _|        ~| _}        | _~        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        y N)node_machine_typenode_source_imagenode_disk_size_gbr4   	num_nodesadditional_zonesnode_locationsuserpasswordcluster_versionnode_versionnetworkcluster_ipv4_cidrenable_cloud_loggingenable_cloud_monitoringenable_stackdriver_kubernetes%enable_logging_monitoring_system_onlyenable_workload_monitoring_eap
subnetworkaddonsistio_configcloud_run_configlocal_ssd_countdata_cache_countlocal_ssd_volume_configsephemeral_storageephemeral_storage_local_ssdlocal_nvme_ssd_blockboot_disk_kms_keynode_pool_nametagstag_bindingsautoprovisioning_network_tagsnode_labelsnode_taintsenable_autoscaling	min_nodes	max_nodestotal_min_nodestotal_max_nodeslocation_policy
image_typeimageimage_projectimage_familymax_nodes_per_poolenable_kubernetes_alphaalpha_cluster_feature_gatesenable_cloud_run_alphapreemptiblespotplacement_typeplacement_policyenable_queued_provisioningmax_run_duration
flex_startenable_autorepairenable_autoupgrader   !enable_master_authorized_networksmaster_authorized_networksenable_legacy_authorizationenable_network_policyenable_l4_ilb_subsettinglabels	disk_typeservices_ipv4_cidrenable_ip_aliascreate_subnetworkcluster_secondary_range_nameservices_secondary_range_nameacceleratorsenable_binauthzbinauthz_evaluation_modebinauthz_policy_bindingsmin_cpu_platformworkload_metadataworkload_metadata_from_nodemaintenance_windowenable_pod_security_policyallow_route_overlapprivate_clusterenable_private_nodesenable_private_endpointmaster_ipv4_cidrtpu_ipv4_cidrenable_tpu_service_networking
enable_tpuissue_client_certificatedefault_max_pods_per_nodemax_pods_per_noderesource_usage_bigquery_datasetsecurity_groupenable_private_ipv6_accessenable_intra_node_visibilityenable_vertical_pod_autoscaling,enable_experimental_vertical_pod_autoscalingsecurity_profilesecurity_profile_runtime_rulesautoscaling_profilehpa_profiledatabase_encryption_keymetadataenable_network_egress_metering$enable_resource_consumption_meteringworkload_poolidentity_providerenable_workload_certificatesenable_mesh_certificatesenable_altsenable_gke_oidcenable_identity_serviceenable_shielded_nodeslinux_sysctlsdisable_default_snatdataplane_v2enable_dataplane_v2_metricsdisable_dataplane_v2_metrics&enable_dataplane_v2_flow_observability'disable_dataplane_v2_flow_observabilitydataplane_v2_observability_modeshielded_secure_bootshielded_integrity_monitoringsystem_config_from_filemaintenance_window_startmaintenance_window_endmaintenance_window_recurrenceenable_cost_allocationgpudirect_strategymax_surge_upgrademax_unavailable_upgradeenable_autoprovisioningautoprovisioning_config_file autoprovisioning_service_accountautoprovisioning_scopesautoprovisioning_locationsmin_cpumax_cpu
min_memory
max_memorymin_acceleratormax_acceleratorautoprovisioning_image_type"autoprovisioning_max_surge_upgrade(autoprovisioning_max_unavailable_upgrade#enable_autoprovisioning_autoupgrade"enable_autoprovisioning_autorepairreservation_affinityreservation!autoprovisioning_min_cpu_platformenable_master_global_accessgvnicenable_master_metricsmaster_logsrelease_channelnotification_config	autopilotprivate_ipv6_google_access_typeenable_confidential_nodesconfidential_node_typeenable_confidential_storagestorage_poolslocal_ssd_encryption_modecluster_dnscluster_dns_scopecluster_dns_domainadditive_vpc_scope_dns_domaindisable_additive_vpc_scope!kubernetes_objects_changes_target#kubernetes_objects_snapshots_targetenable_gcfsenable_image_streamingprivate_endpoint_subnetworkcross_connect_subnetworksenable_service_externalipsthreads_per_coreenable_nested_virtualizationperformance_monitoring_unitlogging
monitoringenable_managed_prometheusauto_monitoring_scopemanaged_otel_scopemaintenance_intervaldisable_pod_cidr_overprovision
stack_typeipv6_access_typeenable_workload_config_audit&enable_workload_vulnerability_scanning%enable_autoprovisioning_surge_upgrade*enable_autoprovisioning_blue_green_upgrade(autoprovisioning_standard_rollout_policy(autoprovisioning_node_pool_soak_durationenable_google_cloud_accessmanaged_configfleet_projectenable_fleetmembership_typegateway_apilogging_variantenable_multi_networkingenable_security_posturenetwork_performance_config%enable_insecure_kubelet_readonly_port6autoprovisioning_enable_insecure_kubelet_readonly_portenable_k8s_beta_apis
compliancecompliance_standardssecurity_postureworkload_vulnerability_scanning$enable_runtime_vulnerability_insightworkload_policiesenable_fqdn_network_policyhost_maintenance_intervalin_transit_encryptioncontainerd_config_from_fileresource_manager_tags&autoprovisioning_resource_manager_tagsenable_secret_managerenable_secret_manager_rotation secret_manager_rotation_intervalenable_secret_syncenable_secret_sync_rotationsecret_sync_rotation_interval(enable_cilium_clusterwide_network_policyenable_ray_cluster_loggingenable_ray_cluster_monitoring,enable_insecure_binding_system_authenticated.enable_insecure_binding_system_unauthenticatedenable_dns_access
cluster_caaggregation_caetcd_api_caetcd_peer_caservice_account_signing_keys!service_account_verification_keys!control_plane_disk_encryption_key!gkeops_etcd_backup_encryption_key%disable_l4_lb_firewall_reconciliationtierenable_ip_access.enable_authorized_networks_on_private_endpointanonymous_authentication_configpatch_updateenable_auto_ipamenable_k8s_tokens_via_dnsenable_legacy_lustre_portenable_default_compute_classenable_k8s_certs_via_dnsboot_disk_provisioned_iops boot_disk_provisioned_throughputnetwork_tiercontrol_plane_egress_modeautopilot_privileged_admission)selfr   r   r   r4   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r!  r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  r4  r5  r6  r7  r8  r9  r:  r;  r<  r=  r>  r?  r@  rA  rD  rE  rF  rG  rH  rI  rJ  rK  rL  rM  rN  rO  rP  rS  rT  rU  rV  rW  rX  rY  rZ  r[  r\  r]  r^  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  ri  rj  rQ  rR  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  r}  r~  r  r  r  rB  rC  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  s                                                                                                                                                                                                                                                                  ra   __init__zCreateClusterOptions.__init__c  sN   B /D.D.DDKDN,D(DDIDM*D$DDL.D 4D#:D )FD&- 	. ,J*KD' DODK$D,D*D,D$<D!.D'BD$ 4D.D(DDI$D)FD&"D"D0DDNDN*D*D*D DODJ&D$D0D#:D 'BD$"8D"DDI(D,D&@D#,D DO.D0D*D-ND*&@D#'BD$!6D$<D!DKDN0D*D.D(DD%)FD&$D*D$<D!$<D!,D.D'BD$0D&@D#2D*D 4D#:D ,D&D)FD& DO$<D!%>D".D+JD((D&@D#(DD%+JD(4 	5 -D*HD'2D"D#:D DM*HD', 	- 'D.D(DD%$<D!"D*D#:D !6D&D 4D$D'BD$(DD%. 	/ 	0 	0 ,KD( 4D)FD&#:D $<D!"8D)FD&"8D0D.D#:D #:D (DD%,LD)#:D &@D#DLDL DO DO*D*D'BD$.PD+0 	1 	, 	, /QD+ 4D"D-ND*'BD$DJ!6D"D*D2DDN+JD(%>D""8D'BD$&D%>D""D.D0D)FD&&@D#-ND*+ 	, #D"8D'BD$%>D"&@D#,D(DD%'BD$DL DO%>D"!6D0D 4D*HD' DO,D(DD%. 	/ 	. 	. 	3 	3 	1 	1 	1 	1 'AD#(D&D$D*D"D*D#:D #:D &@D#- 	. 	? 	? !5D DO 4D,D+JD(, 	- /D&@D#%>D"!6D'BD$!6D. 	/ "7D*HD',LD)0D'BD$)FD&0 	1 'AD#)FD&4 	5 	7 	7 /D DO(D"D$D(DD%-ND*-ND*-ND*- 	. DI,D6 	7 ,KD($D,D%>D"%>D"(DD%$<D!&@D#,LD)$D%>D"*HD'rb   )NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN__name__
__module____qualname____doc__r  rx   rb   ra   r   r   `  s	   ) "$(,0%)#"&$(#""&!!%(,!%"& ##'$(##"&!%"$( $&*!%#'&*37%)"%)+/#'#" "&#'-1.2&*$("#!$(!""#''+"!%"&)-/3*.)-(,"& &* $!"&$(!%(,*.!"& $!% $ %)#'-1,015/3/3!%""#'"&!%,0=A&*+/!% $ "& -1 %)'+"&$(/3 $!%$(3759#'(,(,(,,059&* $ $#'#!%'+ $%)kIrb   r   c                      e Zd ZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)UpdateClusterOptionsz!Options to pass to UpdateCluster.Nc                 8
   || _         t        |      | _        t        |      | _        || _        || _        || _        || _        || _        |	| _	        || _
        |
| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        | | _         |!| _!        |"| _"        |#| _#        |$| _$        |%| _%        |(| _&        |)| _'        |*| _(        |+| _)        |&| _*        |'| _+        |,| _,        |-| _-        |.| _.        |/| _/        |0| _0        |1| _1        |2| _2        |3| _3        |4| _4        |5| _5        |6| _6        |7| _7        |8| _8        |9| _9        |:| _:        |;| _;        |<| _<        |=| _=        |>| _>        |?| _?        @| _@        A| _A        B| _B        C| _C        D| _D        E| _E        F| _F        G| _G        H| _H        I| _I        J| _J        K| _K        L| _L        M| _M        N| _N        O| _O        P| _P        R| _Q        Q| _R        S| _S        T| _T        U| _U        V| _V        W| _W        X| _X        Y| _Y        Z| _Z        [| _[        \| _\        ]| _]        ^| _^        _| __        `| _`        a| _a        b| _b        c| _c        d| _d        e| _e        f| _f        g| _g        h| _h        i| _i        j| _j        k| _k        l| _l        m| _m        n| _n        o| _o        p| _p        q| _q        r| _r        s| _s        t| _t        u| _u        v| _v        w| _w        x| _x        y| _y        z| _z        {| _{        || _|        }| _}        ~| _~        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        | _        || _        y r   )versionboolupdate_masterupdate_nodes	node_poolmonitoring_servicelogging_servicer   r   r   no_master_logsr:  r9  rS  rT  disable_addonsr   r   rD  rE  rF  rH  rG  r   r   r   r   r   r   r   r   r   	locationsr   r   r   r   r  r  r  r  r  r   r   enable_peering_route_sharingr
  r  disable_workload_identityr  r  r  r  r  r  r  r   r  r	  r  disable_database_encryptionr   r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r;  r/  r0  r1  r2  r3  r6  r   r   r   r7  r<  r>  rI  rJ  disable_autopilotadd_cross_connect_subnetworks remove_cross_connect_subnetworksclear_cross_connect_subnetworksrO  r   rK  r   rL  rU  disable_managed_prometheusrV  rW  rX  r  r  r  r  r  r  r\  r]  r^  r_  r`  ra  r   rb  rZ  rg  rh  additional_pod_ipv4_ranges"removed_additional_pod_ipv4_rangesrd  re  rf  unset_membership_typeclear_fleet_projectrj  rk  rn  ro  rp  rq  rr  rs  rt  remove_workload_policiesru  rv  rw  ri  rx  rz  convert_to_autopilotconvert_to_standardr{  r|  r}  r~  r  r  r  rl  rm  r  r  r  r  additional_ip_rangesremove_additional_ip_rangesr   r  r  $enable_l4_lb_firewall_reconciliationr  autoprovisioning_cgroup_moder  r  r  'enable_autopilot_compatibility_auditingr  r  r  r  r  r  disable_auto_ipamr  r  r  r  r  r  r  r  control_plane_soak_duration)r  r  r  r  r  r  r  r   r   r   r:  r  r9  rS  rT  r  r   r   rD  rE  rF  rH  rG  r   r   r   r   r   r   r   r   r   r  r   r   r   r   r  r   r   r  r  r  r  r  r
  r  r  r  r  r  r  r  r  r  r   r  r	  r  r  r   r$  r%  r&  r'  r(  r)  r*  r+  r,  r-  r.  r;  r/  r0  r1  r2  r3  r6  r   r   r7  r   r<  r>  rI  rJ  r  r  r  r  rO  r   rK  r   rL  rU  r  rV  rW  rX  r  r  r  r  r  r  r\  r]  r^  r_  r`  ra  r   rb  rZ  rg  rh  r  r  rd  re  rf  r  r  rj  rk  rn  ro  rp  rq  rr  rs  rt  r  ru  rv  rw  ri  rx  rz  r  r  r{  r|  r}  r~  r  r  r  rl  rm  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  s                                                                                                                                                                                           ra   r  zUpdateClusterOptions.__init__  s<   t DLm,D\*DDN0D*D)FD&- 	. +ID'(D"D!6DDL DO(D$D,D"D.D0D&@D#)FD&0DDNDN*D*D*D DODJ&DDN-ND*&@D#&@D#+JD(4 	5 -D*HD'2D"D(DD%$<D!(DD%&D.D%>D"(DD%$<D!"D*D#:D !6D 4D+JD(*HD', 	- $;D 'BD$"8D#:D (DD%,LD)#:D &@D#DLDL DO DO*D*D*D'BD$.PD+0 	1 	, 	, /QD+-ND* DO&D)FD&'BD$2D+JD(-ND*+ 	, /D)FD&,LD)+JD(&@D#(D"D)FD&"8D%>D"&@D#!6D0D 4D$D'BD$(DD%. 	/ 	0 	0 ,KD((DD%. 	/ 	. 	. 	3 	3 	1 	1 	1 	1 $;D &@D# DO"D*D&@D#.PD+&D$D*D!6D2D#:D &@D# 4D DO 4D,D+JD(, 	- /D$<D!&@D#%>D"!6D#:D 'BD$. 	/ !5D2D!6D*HD',LD)0D'BD$)FD&0 	1 	. 	. 	? 	? 'AD#)FD&4 	5 	7 	7 !5D'BD$ 4D.D- 	. 	- 	- DI(DD%,D6 	7 +ID'/ 	0 .OD*(DD%-ND*+JD($D,D.D%>D"%>D"(DD%$<D!&@D#,LD)$D%>D"'BD$*HD'rb   )NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNr  rx   rb   ra   r  r    s4   ) $(,0%) !%$((,!%!%&*37#'#%)#' $#'#" &*%)+/""&!"#''+"!%"&)-/3*.)-(,"&$(&*(,*.$('+&*!%$(! $!% "&#'-1.2&*#'-1,015/3/3"!%!%)- "!%&*+/#!% $ ""&-1 %)'+"&$(/3,0=A!%$(3759"&,0+/#'59.2#'(,(,&* $ $#'#!%'+ $"&%)qaIrb   r  c                   $    e Zd ZdZdZdZdZddZy)SetMasterAuthOptionsz!Options to pass to SetMasterAuth.SetPasswordGeneratePasswordSetUsernameNc                 .    || _         || _        || _        y r   )actionusernamer   )r  r  r  r   s       ra   r  zSetMasterAuthOptions.__init__?  s    DKDMDMrb   NNN)r  r  r  r  SET_PASSWORDGENERATE_PASSWORDSET_USERNAMEr  rx   rb   ra   r  r  8  s    ),(,rb   r  c                       e Zd Zd Zy)SetNetworkPolicyOptionsc                     || _         y r   enabled)r  r  s     ra   r  z SetNetworkPolicyOptions.__init__G  s	    DLrb   N)r  r  r  r  rx   rb   ra   r  r  E  s    rb   r  c                       e Zd ZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)CreateNodePoolOptionsz"Options to pass to CreateNodePool.Ncc                 `   || _         || _        || _        || _        || _        || _        a| _        || _        || _        |
| _	        |	| _
        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        | | _         |!| _!        |"| _"        |#| _#        |$| _$        |%| _%        |&| _&        |'| _'        |(| _(        |)| _)        |*| _*        |+| _+        |,| _,        |-| _-        |.| _.        |/| _/        |0| _0        |1| _1        |2| _2        |3| _3        |4| _4        |5| _5        |6| _6        |7| _7        |8| _8        |9| _9        |:| _:        |;| _;        |<| _<        |=| _=        |>| _>        |?| _?        @| _@        S| _A        T| _B        A| _C        B| _D        C| _E        D| _F        E| _G        F| _H        G| _I        H| _J        I| _K        J| _L        K| _M        L| _N        M| _O        N| _P        O| _Q        P| _R        Q| _S        R| _T        U| _U        V| _V        W| _W        X| _X        Y| _Y        Z| _Z        [| _[        \| _\        ]| _]        ^| _^        _| __        `| _`        b| _a        y r   )bmachine_typedisk_size_gbr4   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r$  r   r   r   r   r   r   r   r   r   tpu_topologyr   r   r   r   r   r   r   r   r   r   r   r   sandboxr  r  r!  r"  r#  r   r  r  r  r4  r5  
node_grouprK  rL  r8  pod_ipv4_rangecreate_pod_ipv4_ranger   rP  rQ  rR  enable_blue_green_upgradeenable_surge_upgradenode_pool_soak_durationstandard_rollout_policyautoscaled_rollout_policyrX  rk  r?  r@  rA  rY  enable_fast_socketrh  windows_os_versionenable_best_effort_provisionmin_provision_nodesadditional_node_networkadditional_pod_networksole_tenant_node_affinity_filesole_tenant_min_node_cpusrv  opportunistic_maintenancerl  ry  rx  secondary_boot_disksrB  rC  r  r  accelerator_network_profile)cr  r  r  r4   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r$  r   r   r   r   r   r   r   r   r  r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r!  r"  r#  r   r  r  r  r4  r5  r  rK  rL  r8  r  r  r   rP  r  r  r  r  r  rX  rk  r?  r@  rA  rY  r  rh  r  r  r  r  r  rQ  rR  r  r  rv  r  rl  ry  rx  r  rB  rC  r  r  r   r  sc                                                                                                      ra   r  zCreateNodePoolOptions.__init__N  s   J %D$DDK$DDN*D,D$<D!.D'BD$ 4D.DDI$DDK"D"D0DDNDN*D*D#:D  DO*DDJ&D$D"DDI(D,D$D&@D#,D DO.D0D*DDN$D,D.D'BD$.DDLDM&D0D.D#:D (D 4D)FD&#:D  4D"D DO"D"8DDJ(D!6D 4D,D(DD%'BD$%>D" 4D#:D #:D %>D" 4D&@D#%>D""8D'BD$*HD'0D*D0D(DD%2D#:D "8D*HD'%>D"%>D"%>D"- 	. "7D'BD$ 4D&D%>D"&@D#,LD)'BD$rb   )bNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNr  rx   rb   ra   r  r  K  s5   * #"&"!%"&"$("!  $"" $!% $!"&%)#'"!#'"&%) $ $ $,0 "& $!%'+"&GHCrb   r  c                       e Zd ZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZd Zd Zd Zy)UpdateNodePoolOptionsz"Options to pass to UpdateNodePool.Nc1                    || _         || _        || _        || _        || _        |"| _        || _        || _        || _        |	| _	        |
| _
        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        | | _         |!| _!        |#| _"        |$| _#        |%| _$        |&| _%        |'| _&        |(| _'        |)| _(        |*| _)        |+| _*        |,| _+        |-| _,        |.| _-        |$| _#        |/| _.        |0| _/        y r   )0r   r   r   r   r   r   r   r   r   r$  r   r   r   r"  r#  r  r   r   r   r   r   rK  r8  rL  r  r  r  r  r  rk  r?  r@  r  rh  r  rl  ry  rx  r  r  r   r  r   r   r   rB  provisioned_iopsprovisioned_throughput)1r  r   r   r   r   r   r   r   r   r$  r   r   r   r"  r#  r  r   r   r   r   r   rK  r8  rL  r  r  r  r  r  rk  r?  r@  r  rh  r   r  rl  ry  rx  r  r  r   r  r   r   r   rB  r  r  s1                                                    ra   r  zUpdateNodePoolOptions.__init__  s   f /D0D0DDNDN$D*D*D*D#:D .D'BD$(D.D#:D #:D DK"D"DDI 4D"DDJ"8D%>D" 4D#:D #:D %>D"&@D#%>D""8D0D*D0D- 	. "7D'BD$ 4D$DDN$D&@D#,D DO&D- 	. 7D"BDrb   c                     | j                   d uxs^ | j                  d uxsN | j                  d uxs> | j                  d uxs. | j                  d uxs | j
                  d uxs | j                  d uS r   )r   r   r   r   r   r$  r   r  s    ra   IsAutoscalingUpdatez)UpdateNodePoolOptions.IsAutoscalingUpdate  s    t+ 	,>>%	,>>%	, t+	, t+		,
 ''t3	, t+rb   c                 >    | j                   d uxs | j                  d uS r   )r   r   r  s    ra   IsNodePoolManagementUpdatez0UpdateNodePoolOptions.IsNodePoolManagementUpdate  s(    d* 	/""$.rb   c                    | j                   d uxsQ | j                  d uxs@ | j                  d uxs/ | j                  d uxs | j                  d uxs | j
                  d uxs | j                  d uxs | j                  d uxs | j                  d uxs | j                  d uxs | j                  d uxs | j                  d uxs | j                  d uxs | j                  d uxst | j                  d uxsc | j                  d uxsR | j                   d uxsA | j"                  d uxs0 | j$                  d uxs | j&                  d uxs | j(                  d uxs | j*                  d uxs | j,                  d uxs | j.                  d uxs | j0                  d uxs | j2                  d uxs | j4                  d uxs | j6                  d uxs | j8                  d uxs~ | j:                  d uxsn | j<                  d uxs^ | j>                  d uxsN | j@                  d uxs> | jB                  d uxs. | jD                  d uxs | jF                  d uxs | jH                  d uS r   )%r   r   r   r"  r#  r  r   r   r   r   r   rK  r8  rL  r  r  r  r  r  rk  r?  r@  r  rh  r  r   ry  rx  r  r   r  r   r   r   rB  r  r  r  s    ra   IsUpdateNodePoolRequestz-UpdateNodePoolOptions.IsUpdateNodePoolRequest  s   d* $	3++47$	3d*$	3 !!-$	3 ''t3	$	3
 ''t3$	3 ;;d"$	3 4'$	3 4'$	3 99D $	3 $$D0$	3 4'$	3 ::T!$	3 &&d2$	3 $$D0$	3 ))5$	3  ''t3!$	3" ''t3#$	3$ ))5%$	3& **$6'$	3( ))5)$	3* &&d2+$	3, ""$.-$	3. t+/$	30 ""$.1$	32 D(3$	34 %%T15$	36 ++477$	38 D(9$	3: >>%;$	3< D(=$	3> **$6?$	3@   ,A$	3B ??$&C$	3D T)E$	3F   ,G$	3H &&d2K&rb   )0NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)r  r  r  r  r  r  r  r  rx   rb   ra   r  r    s    * ""&""! $"" $!% $!,0 "&!%!%'+cgCR	'rb   r  c                      e Zd ZdZd ZdwdZdwdZdwdZd Zd Z	d	 Z
d
 Zd ZdwdZd Z	 dxdZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdydZd Z d  Z!d! Z"d" Z#d# Z$d$ Z%d% Z&d& Z'd' Z(d( Z)d) Z*d* Z+d+ Z,	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dzd,Z-d- Z.d. Z/d/ Z0d0 Z1d1 Z2d2 Z3d3 Z4d4 Z5d5 Z6d6 Z7d7 Z8d8 Z9d9 Z:d: Z;d; Z<d< Z=d= Z>d> Z?d? Z@dwd@ZAdA ZBdB ZCdC ZDdD ZEdE ZFdF ZGdG ZHdH ZIdwdIZJdJ ZKdK ZLdL ZMdwdMZNdN ZOdO ZPdP ZQdQ ZRdR ZSdwdSZTdT ZUdU ZVdV ZWdW ZXdX ZYdY ZZdZ Z[d[ Z\d\ Z]d] Z^d^ Z_d_ Z`d` Zada Zbdb Zcdc Zddd Zede Zfdf Zg	 	 	 d{dgZhdh Zidi Zjdj Zkdk Zldl Zmdm Zndn Zodo Zpdp Zqdq Zrdr Zsds Ztdt Zudu Zvdv Zwy)|
APIAdapterz6Handles making api requests in a version-agnostic way.c                 .    || _         || _        || _        y r   )r   clientr   )r  r   r  r   s       ra   r  zAPIAdapter.__init__  s    DMDKDMrb   Nc                     |xs2 t         j                  j                  j                  j	                         }| j
                  j                  t        j                  |      ||dd      S )N	projectIdzonez!container.projects.zones.clustersparams
collection	r   VALUEScoreproject	GetOrFailr   Parser	   LocationalResourceToZonal)r  namelocationr  s       ra   ParseClusterzAPIAdapter.ParseCluster  sc    C**//77AACG ==&&t, 
 7   rb   c                     |xs2 t         j                  j                  j                  j	                         }| j
                  j                  t        j                  |      ||dd      S )Nr  z#container.projects.zones.operationsr  r  )r  operation_idr  r  s       ra   ParseOperationzAPIAdapter.ParseOperation  sa    C**//77AACG==&&|4 
 9   rb   c                 0   |xs2 t         j                  j                  j                  j	                         }| j
                  j                  t        j                  |      |t         j                  j                  j                  j                  |dd      S )N)r  	clusterIdr  z+container.projects.zones.clusters.nodePoolsr  )r   r  r  r  r  r   r  r	   r  r~   rX   )r  node_pool_idr  r  s       ra   ParseNodePoolzAPIAdapter.ParseNodePool  s}    C**//77AACG==&&|4 #**44<<FF

 A   rb   c           	         	 | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    S # t        j                  $ r@}t        j                  |t        j                        }| j                  ||       Y d}~yd}~wt        j                   $ r)}t        j                  |t        j                        d}~ww xY w)aQ  Get a running cluster.

    Args:
      cluster_ref: cluster Resource to describe.

    Returns:
      Cluster message.
    Raises:
      Error: if cluster cannot be found or caller is missing permissions. Will
        attempt to find similar clusters in other zones for a more useful error
        if the user has list permissions.
    r  N)r  projects_locations_clustersGetr   ,ContainerProjectsLocationsClustersGetRequestProjectLocationClusterr  r  r  r\   HttpNotFoundErrorr   HttpExceptionr	   HTTP_ERROR_FORMATCheckClusterOtherZonesr]   r  cluster_referror	api_errors       ra   
GetClusterzAPIAdapter.GetCluster  s    D[[4488
--
D
D)'')9)9;;P;P E   00 :**5$2H2HIi
!!+y99(( D$$UD,B,BCCD$   A'A* *C7=6B88C7$C22C7c           	         	 | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    S # t        j                  $ r@}t        j                  |t        j                        }| j                  ||       Y d}~yd}~wt        j                   $ r)}t        j                  |t        j                        d}~ww xY w)am  Get cluster upgrade info.

    Args:
      cluster_ref: cluster Resource to get upgrade info for.

    Returns:
      Cluster Upgrade Info message.
    Raises:
      Error: if cluster cannot be found or caller is missing permissions. Will
        attempt to find similar clusters in other zones for a more useful error
        if the user has list permissions.
    r  N)r  r  FetchClusterUpgradeInfor   @ContainerProjectsLocationsClustersFetchClusterUpgradeInfoRequestr!  r  r  r  r\   r"  r   r#  r	   r$  r%  r]   r&  s       ra   GetClusterUpgradeInfoz APIAdapter.GetClusterUpgradeInfo	  s    D[[44LL
--
X
X)'')9)9;;P;P Y   00 :**5$2H2HIi
!!+y99(( D$$UD,B,BCCDr+  c           	      @   	 | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    }| j                  |j                  |j                        S # t        j                  $ r@}t        j                  |t        j                         }| j#                  ||       Y d}~yd}~wt        j$                  $ r)}t        j                  |t        j                         d}~ww xY w)a  Complete control plane upgrade for a cluster.

    Args:
      cluster_ref: cluster Resource to complete control plane upgrade for.

    Returns:
      The operation to be executed.
    Raises:
      exceptions.HttpException: if cluster cannot be found or caller is missing
        permissions. Will attempt to find similar clusters in other zones for a
        more useful error if the user has list permissions.
    r  N)r  r  CompleteControlPlaneUpgrader   DContainerProjectsLocationsClustersCompleteControlPlaneUpgradeRequestr!  r  r  r  r  r  r\   r"  r   r#  r	   r$  r%  r]   r  r'  opr(  r)  s        ra   r1  z&APIAdapter.CompleteControlPlaneUpgrade%  s    D;;22NN
--
\
\)'')9)9;;P;P ] b   +*:*:;;00 :**5$2H2HIi
!!+y99(( D$$UD,B,BCCD$   BB D#6CD4$DDc           	         	 | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    S # t        j                  $ r@}t        j                  |t        j                        }| j                  ||       Y d}~yd}~wt        j                   $ r)}t        j                  |t        j                        d}~ww xY w)a|  Check autopilot compatibility of a cluster.

    Args:
      cluster_ref: cluster resource to check.

    Returns:
      A list of autopilot compatibility issues.
    Raises:
      Error: if cluster cannot be found or caller is missing permissions. Will
        attempt to find similar clusters in other zones for a more useful error
        if the user has list permissions.
    r  N)r  r  CheckAutopilotCompatibilityr   DContainerProjectsLocationsClustersCheckAutopilotCompatibilityRequestr!  r  r  r  r\   r"  r   r#  r	   r$  r%  r]   r&  s       ra   r7  z&APIAdapter.CheckAutopilotCompatibilityB  s    D[[44PP
--
\
\)'')9)9;;P;P ]   00 :**5$2H2HIi
!!+y99(( D$$UD,B,BCCDr+  c           
         t        j                  t        j                  ||j                  |j
                              }	 | j                  |j
                        j                  }|D ]  }|j                  |j                  k(  s|j                  |j                  k(  r|t        j                  t         j                  ||j                  | j#                  |      |j                               |# t        j                  $ r |t        j                  $ r)}t        j                  |t         j                        d}~ww xY w)ac  Searches for similar clusters in other locations and reports via error.

    Args:
      cluster_ref: cluster Resource to look for others with the same ID in
        different locations.
      api_error: current error from original request.

    Raises:
      Error: wrong zone error if another similar cluster found, otherwise not
      found error.
    )r(  r  r  N)r(  r  
wrong_zoner  )r	   ErrorNO_SUCH_CLUSTER_ERROR_MSGrl   r  r  ListClustersclustersr\   HttpForbiddenErrorr]   r   r#  r$  r  r  WRONG_ZONE_ERROR_MSGZone)r  r'  r)  not_found_errorr>  r(  rX   s          ra   r%  z!APIAdapter.CheckClusterOtherZones^  s)    jj!((&&)) 	) 	
OD"";#8#89BBh 	..	. <<;+++/ jj '' **99[1\\	 ( 
 	
 $ 1 11  (( D$$UD,B,BCCDs   %C2 2'E$D==Ec                    d}|rW|j                   D ]  }|j                  |k(  s|c S  t        j                  |j                  |      t        j
                  z   }n't        |j                         dk(  r|j                   d   S |t        t        j
                  j                  |j                   D cg c]  }|j                   c}      z   z  }t        j                  |      c c}w )z6Find the node pool with the given name in the cluster. rX   r     r   )	nodePoolsr  NO_SUCH_NODE_POOL_ERROR_MSGrl   oslineseplenNO_NODE_POOL_SELECTED_ERROR_MSGjoinr	   r;  )r  rX   	pool_namemsgnps        ra   FindNodePoolzAPIAdapter.FindNodePool  s    
C!!"77i) " &
,
,ll -  JJ 
 
W	1	$q!!*RZZ__",,-,R,-.  C **S/ 	.s   0C#c           	          | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    S Nr  )	r  projects_locations_operationsr  r   .ContainerProjectsLocationsOperationsGetRequestProjectLocationOperationr  r  operationId)r  operation_refs     ra   GetOperationzAPIAdapter.GetOperation  sZ    ;;4488DD)''"")) 	E 	
 rb   c                       fd fd} |       }|j                   r't        j                  d| d|j                    z         |S )a  Poll container Operation until its status is done or timeout reached.

    Args:
      operation_ref: operation resource.
      message: str, message to display to user while polling.
      timeout_s: number, seconds to poll with retries before timing out.
      poll_period_s: number, delay in seconds between requests.

    Returns:
      Operation: the return value of the last successful operations.get
      request.

    Raises:
      Error: if the operation times out or finishes with an error.
    c                  <   t        d      D ]  } 	 j                        c S  y# t        j                  $ rb}t	        j
                  d| dz   |       t        j                         | dk(  r$t        j                  |t        j                        Y d}~d}~ww xY w)z@Gets the operation or throws an exception, with limited retries.   z$GetOperation failed (attempt %d): %srF     N)r   rY  r\   r]   r   debugtimesleepr   r#  r	   r$  )attemptr(  rX  poll_period_sr  s     ra   _MustGetOperationz6APIAdapter.WaitForOperation.<locals>._MustGetOperation  s     1X'	J""=1
1  #,, 	J
)):GaK
O
**]
#\**5$2H2HII 	Js   &BABBc                     dt        j                  dfd      5  t        j                         }         }t        j                         | z
  kD  rj                  |      r?t        j                         | z
  }t	        j
                  d| d|dd       |cddd       S |j                  t        j                                 }t        j                         | z
  kD  rt        j                  j                  d	|        t        j                  d
| dd|j                   dz         # 1 sw Y   yxY w)zDRetries getting the operation until it finishes, times out or fails.NTc                       S r   rx   )detail_messages   ra   <lambda>zHAPIAdapter.WaitForOperation.<locals>._WaitForOperation.<locals>.<lambda>  s    .rb   )autotickdetail_message_callbackz
Operation z finished after z.3z secondsz Timed out waiting for operation Operation [z)] is still running, check its status via z&'gcloud container operations describe ')r   ProgressTrackerr_  IsOperationFinishedr   infodetailr`  errPrintr	   r;  r  )	
start_timer4  durationrf  rc  messagerb  r  	timeout_ss	      @ra   _WaitForOperationz6APIAdapter.WaitForOperation.<locals>._WaitForOperation  s   n++
D:P YY[
 499;34%%b)yy{Z/HHHz"%5hr](KL  99.
**]
# "" 499;34 	8=>jj"FG6rwwiqAB
 	
! s   A<D5&AD5)AD55D>rj  z] finished with error: )statusMessager	   r;  )r  rX  rt  ru  rb  rv  	operationrc  s   `````  @ra   WaitForOperationzAPIAdapter.WaitForOperation  s]    &J 
 
0 "#IJJ	{"9
:&&') 
 rb   c                     |j                   S r   )r  r  r'  s     ra   rA  zAPIAdapter.Zone  s    rb   c                 l   | j                  |      }| j                  ||      }| j                  j                  |j                  |      }|j
                  r| j                  j                  j                  t        |j
                  j                               D cg c]6  \  }}| j                  j                  j                  j                  ||      8 c}}      |_
        |j                  r(t        |j                  g|j                  z         |_        |j                  rt        |j                        |_        |j                  r|j                  |_        |j"                  r|j"                  |_        |j$                  r|j$                  |_        |j(                  h|j(                  rMd|_        d|_        |j.                  |j.                  sd|_        |j0                  q|j0                  sed|_        n]d|_        d|_        nN|j.                  |j.                  rd|_        nd|_        |j0                  |j0                  rd	|_        nd|_        |j2                  r|j2                  |_        |j4                  r| j7                  |j4                  j9                  t:        d
       xr |j<                   |j4                  j9                  t>        d
       xr |j<                   |j4                  j9                  t@        d
       |j4                  j9                  tB        d
       |j4                  j9                  tD              |j4                  j9                  tF        d
      |j4                  j9                  tH        d
      |j4                  j9                  tJ        d
      |j4                  j9                  tL        d
      |j4                  j9                  tN        d
      |j4                  j9                  tP        d
      |j4                  j9                  tR        d
      |j4                  j9                  tT        d
      |j4                  j9                  tV        d
      |j4                  j9                  tX        d
      |j4                  j9                  tZ        d
            }t\        |j4                  v r|j(                  sU|j^                  t`        |j^                  vs|jb                  +t`        |jb                  vrte        jf                  th              |jj                  te        jf                  tl              | j                  jo                  d      |_8        |jr                  5| j                  ju                  |jr                        |jv                  _<        |jz                  5| j                  j}                  |jz                        |jv                  _?        |j                  |j                  |j                  _B        ||_C        |j                  r|j                  |_E        |j                  r7|j                  ste        jf                  t              |j                  |_H        ng |_H        |j                  P|j                  ste        jf                  t              | j                  j                  |j                        |_M        |j                  r|j                  ste        jf                  t              |j                  ste        jf                  t              | j                  j                  |j                        }	|j                  "| j                  j                  |	      |_S        n|	|j                  _U        |j                  p|j                  rd|j                  | j                  j                         |_S        | j                  j                  j                  j                  |j                  _Y        |j                  rS|j                  ,| j                  j                  |j                        |_S        n|j                  |j                  _[        | j                  |      }
|
?|j                  "| j                  j                  |
      |_S        n|
|j                  _]        | j                  |      }|?|j                  "| j                  j                  |      |_S        n||j                  __        |j                  4| j                  j                  t        |j                              |_c        |j                  rT| j                  j                  |j                  | j                  j                  j                  j                        |_h        |j                  +| j                  j                  |j                        |_k        |j                  ?|j                  | j                  j                  te        j                  | j                  d
      j                  |j                              |_k        |j                  D ]q  }|j                  j                  j                  | j                  j                  |d   d|v r(| j                  j                  j                  |d         nd             s nY| j                  j                  te        j                  | j                  d
      j                  |j                              |_k        |j                  r6|j                  s*te        jf                  t        j                  dd            |j                  `| j                  j                  | j                  j                  | j                  j                  |j                                    |_z        n|j                  |j                  j                         }|j                  j                         }| j                  j                  | j                  j                  | j                  j                  | j                  j                  ||       |j                   !      "            |_z        | j                  ||       |j                  -| j                  j                  |j                        |_        |j
                  t        || j                        |_        |j                  .| j                  j                  d|j                  #      |_        |j                  -| j                  j                  |j                        |_        |jj                  r,| j                  j                  |jj                  $      |_        |j                   xr |j                   j#                         d%k(  }|s| j%                  ||       | j'                  ||       | j)                  ||       | j+                  ||       |j,                  -| j                  j/                  |j,                        |_        |j2                  r| j                  j5                  |j2                  &      }| j                  j7                  |'      |_        |j:                  rd|j8                  _        |j>                  | j                  jA                  |j>                        |j8                  _        nN|j:                  te        jf                  tD              |j>                  te        jf                  tF              |jH                  |jJ                  ~| j                  jM                  |jH                  |jN                  (      |_        |jJ                  8| j                  jS                  |jJ                  )      |jP                  _        |jV                  U|j                  -| j                  j                  |jV                  *      |_S        n|jV                  |j                  _        |jZ                  rY| j                  j]                  |jZ                  | j                  j\                  j^                  j`                  +      |_        |jd                  r/|jf                  D ]  }|jd                  |jh                  _        ! tm        || j                        |_        |j
                  t        || j                        |_        |j<                  rX| j                  jq                         |_        |j<                  |j<                  _        |jt                  r/|jv                  "| j                  jy                  d
      |_        |jz                  r/|j|                  "| j                  j                  d
      |_        |jd                  r|j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        |jd                  |j                  j                  _        |j                  r|j<                  1| j                  jq                         |_        d
|j<                  _        |j<                  j                  *| j                  j                         |j<                  _        |j                  d,k(  rd|j<                  j                  _        |j                  r-| j                  j                  |j                        |_        |j                  C| j                  j                  |j                  t        || j                        -      |_        |j                  v|j                  | j                  j                         |_S        te        j                  | j                  d
      j                  |j                        |j                  _        |j                  "|j<                  rte        jf                  t              |j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        |j                  j                  j                  6| j                  j                         |j                  j                  _        |j                  |j                  j                  j                  _        |j                  	 |j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        |j                  |j                  j                  _        |j                  r|j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        | j                  j                  |j                        |j                  j                  _        |j                  |j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        | j                  j                         |j                  j                  _        te        j                  |j                  j                  j                  |j                  | j                         |j                  re|j                   | j                  j                         |_        | j                  j                  |j                  .      |j                  _        |j                  \|j                   | j                  j                         |_        | j                  |j                        }||j                  _        |j                  r|j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        | j                  j                  |j                        |j                  j                  _        |j                  r|j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        t        || j                        |j                  j                  _        |j                  r|jj                  s*te        jf                  t        j                  d/d0            |j                   | j                  j                         |_        |j                  |j                  _        t        ||| j                         t        || j                        |_        t        || j                  d
d      |_        |j                  rt        || j                        |_        |j                  b|j                  | j                  j                         |_S        | j                  j                  |j                        |j                  _        |j                  r-| j                  j                  |j                        |_        |j                  |j                   <| j                  j                  | j                  j                         1      |_         |j                  rJ| j                  j                  j                  j                  |j                   j
                  _        nI| j                  j                  j                  j                  |j                   j
                  _        |j                  |j                   !| j                  j                         |_         |j                  r?| j                  j                  j                  j                  |j                   _
        n>| j                  j                  j                  j                  |j                   _
        |j                  |j                  !| j                  j                         |_        |j                  j#                         d2k(  r?| j                  j                  j                  j                  |j                  _        n]|j                  j#                         dk(  r>| j                  j                  j                  j"                  |j                  _        |j$                  |j$                  j#                         d3k(  rO| j                  j'                  | j                  j&                  j(                  j*                  4      |_        n|j$                  j#                         d5k(  rO| j                  j'                  | j                  j&                  j(                  j                  4      |_        n5te        jf                  t.        j                  |j$                  4            |j0                  r|j2                  !| j                  j5                         |_        |j6                  |j2                  _        |j:                  )t=        || j                  |j2                        |_        |j>                  r|j2                  !| j                  j5                         |_        |j>                  |j2                  _        |j:                  )t=        || j                  |j2                        |_        |j@                  -|j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        |j                  j                  j                  6| j                  jC                         |j                  j                  _        | j                  jE                  tG        | j                  |j@                        6      |j                  j                  j                  _$        |jJ                  r#| j                  jM                  d      |_'        |jP                  rV|j                  -| j                  j                  |jP                  7      |_S        n|jP                  |j                  _)        |jT                  .|jV                  !| j                  jY                         |_+        |jT                  j#                         d8k(  r?| j                  jX                  jZ                  j\                  |jV                  _/        n|jT                  j#                         d5k(  r?| j                  jX                  jZ                  j                  |jV                  _/        nDte        jf                  t`        j                  |jT                  j#                         9            |jb                  |jT                  9|jT                  j#                         d5k(  rte        jf                  td              |jT                  !| j                  jY                         |_+        |jb                  jg                  d:      D cg c]  }| j                  ji                  |;      ! c}|jV                  _5        |jl                  |jn                  !| j                  jq                         |_7        |jl                  r?| j                  jp                  jZ                  j                  |jn                  _/        n>| j                  jp                  jZ                  j                  |jn                  _/        |jr                  |jn                  !| j                  jq                         |_7        |jr                  j#                         d<k(  r@| j                  jp                  jZ                  jt                  |jn                  _/        n |jr                  j#                         d=k(  r?| j                  jp                  jZ                  j                  |jn                  _/        n|jr                  j#                         d5k(  r?| j                  jp                  jZ                  j                  |jn                  _/        nDte        jf                  tv        j                  |jr                  j#                         9            |jx                  |jn                  !| j                  jq                         |_7        |jx                  j#                         d=k(  r@| j                  jp                  jz                  j|                  |jn                  _?        n |jx                  j#                         d5k(  r?| j                  jp                  jz                  j                  |jn                  _?        n|jx                  j#                         d<k(  r?| j                  jp                  jz                  j                  |jn                  _?        nDte        jf                  t        j                  |jx                  j#                         9            |j                  |j                  !| j                  j                         |_D        |j                  r?| j                  j                  jZ                  j                  |j                  _/        n>| j                  j                  jZ                  j                  |j                  _/        |j                  rR| j                  |      }|j                  "| j                  j                  |>      |_S        n||j                  _I        |j                  r?| j                  j                         |_L        |j                  |j                  _M        |j                  r|j                   | j                  j                         |_        |j                  j                  +| j                  j                         |j                  _        t        || j                  t              |j                  j                  _Q        |j                  u|j                  | j                  j                         |_S        te        j                  | j                        j                  |j                        |j                  _T        |jt                  J|jv                   | j                  jy                         |_        |jt                  |jv                  _        |j                  |jv                   | j                  jy                         |_        |jv                  j                  ,| j                  j                         |jv                  _V        |j                  |jv                  j                  _        |j                  |jv                   | j                  jy                         |_        |jv                  j                  ,| j                  j                         |jv                  _V        |j                  |jv                  j                  _Y        |jz                  J|j|                   | j                  j                         |_        |jz                  |j|                  _        |j                  |j|                   | j                  j                         |_        |j|                  j                  ,| j                  j                         |j|                  _V        |j                  |j|                  j                  _        |j                  |j|                   | j                  j                         |_        |j|                  j                  ,| j                  j                         |j|                  _V        |j                  |j|                  j                  _Y        |j                  H|j                  | j                  j                         |_S        |j                  |j                  _^        |j                  H|j                  | j                  j                         |_S        |j                  |j                  _`        |j                  L|j                  !| j                  j                         |_b        |j                  |j                  _d        |j                  L|j                  !| j                  j                         |_b        |j                  |j                  _f        |j                  |j<                  1| j                  jq                         |_        d
|j<                  _        |j<                  j                  J|j                  jg                  d:      }| j                  j                  |?      |j<                  _h        |j                  L|j                  !| j                  j                         |_k        |j                  |j                  _m        |j                  L|j                  !| j                  j                         |_k        |j                  |j                  _o        |j                  L|j                  !| j                  j                         |_k        |j                  |j                  _q        |j                  L|j                  !| j                  j                         |_k        |j                  |j                  _s        |j                  a|j                  !| j                  j                         |_k        |j                  j                  j                  |j                         |j                  a|j                  !| j                  j                         |_k        |j                  j                  j                  |j                         |j                  L|j                  !| j                  j                         |_k        |j                  |j                  _z        |j                  L|j                  !| j                  j                         |_k        |j                  |j                  _|        |j                  H|j                  | j                  j                         |_S        |j                  |j                  _~        |j                  t        || j                        |_        | j                  ||       |j                  G|j                  | j                  j                         |_S        |j                  |j                  _        |j                  t        || j                        |_        |j                  \|j                  !| j                  j                         |_        | j                  j                  d      |j                  _        |j                  V|j                  !| j                  j                         |_        t        || j                        |j                  _        |j                  K|j                   !| j                  j#                         |_        t%        || j                        |_        |S c c}}w c c}w )@a  Returns a CreateCluster operation.

    This function is for code that is common across all channels, and the
    return value is intended to be modified by each.

    Args:
      cluster_ref: A Cluster message from the calling channel.
      options: User selected options passed to the cluster creation.

    Returns:
      A CreateCluster operation.

    Raises:
      A util.Error if options selected are invalid.
    )r  rG  keyvalue)additionalPropertiesN!logging.googleapis.com/kubernetes$monitoring.googleapis.com/kubernetesnonezlogging.googleapis.comzmonitoring.googleapis.comF)disable_ingressdisable_hpadisable_dashboarddisable_network_policyenable_node_local_dnsenable_gcepd_csi_driverenable_filestore_csi_driverenable_application_managerenable_cloud_buildenable_backup_restoreenable_gcsfuse_csi_driverenable_stateful_haenable_parallelstore_csi_driverenable_high_scale_checkpointingenable_lustre_csi_driverenable_ray_operatorTr  maxPodsPerNodedisabled)defaultSnatStatus)enableL4ilbSubsetting)	dnsConfig)gatewayApiConfigr  providerhidden)evaluationModer  enforcement-moder  enforcementModezbinauthz-evaluation-modezbinauthz-policy-bindingsprerequisiteopt	startTime)dailyMaintenanceWindowwindowr  endTimer  
recurrence)recurringWindowr  securityGroupworkloadPoolipv6	datasetIdbigqueryDestinationr  r   )issueClientCertificate)enableIntraNodeVisibilitykeyNamestateallow-net-adminr  confidentialInstanceTyper   workload-poolzenable-mesh-certificates)workloadConfigperformance	autofleettyper  variant)enableMultiNetworkingr  mode,standard
enterpriser  )networkPerformanceConfigallowlistPaths(  ParseNodeConfigParseNodePoolsr   Clusterr  r   	TagsValuer   itemsAdditionalPropertyr   r   r  r  r   r   initialClusterVersionr   r   clusterIpv4Cidrr   loggingServicemonitoringServicer   r   r   r   _AddonsConfigr   INGRESSr=  rK   	DASHBOARDNETWORK_POLICYNODELOCALDNSGCEPDCSIDRIVERGCPFILESTORECSIDRIVERAPPLICATIONMANAGER
CLOUDBUILDBACKUPRESTOREGCSFUSECSIDRIVER
STATEFULHAPARALLELSTORECSIDRIVERHIGHSCALECHECKPOINTINGLUSTRECSIDRIVERRAYOPERATORCONFIGCONNECTORrT  r@   rS  r	   r;  9CONFIGCONNECTOR_STACKDRIVER_KUBERNETES_DISABLED_ERROR_MSGr
  4CONFIGCONNECTOR_WORKLOAD_IDENTITY_DISABLED_ERROR_MSGConfigConnectorConfigconfigConnectorConfigr  RayClusterLoggingConfigrayOperatorConfigrayClusterLoggingConfigr  RayClusterMonitoringConfigrayClusterMonitoringConfigr  lustreCsiDriverConfigenableLegacyLustrePortaddonsConfigr   enableKubernetesAlphar   EALPHA_CLUSTER_FEATURE_GATES_WITHOUT_ENABLE_KUBERNETES_ALPHA_ERROR_MSGalphaClusterFeatureGatesr   r   4DEFAULT_MAX_PODS_PER_NODE_WITHOUT_IP_ALIAS_ERROR_MSGMaxPodsConstraintdefaultMaxPodsConstraintr  /DISABLE_DEFAULT_SNAT_WITHOUT_IP_ALIAS_ERROR_MSGr   4DISABLE_DEFAULT_SNAT_WITHOUT_PRIVATE_NODES_ERROR_MSGDefaultSnatStatusnetworkConfigNetworkConfigr  r  DatapathProviderValueValuesEnumADVANCED_DATAPATHdatapathProviderr   r  ParseClusterDNSOptionsr  ParseGatewayOptionsr  r   
LegacyAbacr  
legacyAbacr   r(   ProviderValueValuesEnumCALICOnetworkPolicyr   BinaryAuthorizationbinaryAuthorizationr   r   GetBinauthzEvaluationModeMapperGetEnumForChoicepolicyBindingsr   PolicyBindingEnforcementModeValueValuesEnumPREREQUISITE_OPTION_ERROR_MSGrl   r   MaintenancePolicyMaintenanceWindowDailyMaintenanceWindowmaintenancePolicyr  	isoformatr  RecurringTimeWindow
TimeWindowr  ParseResourceLabelsr   PodSecurityPolicyConfigpodSecurityPolicyConfigr  _GetGkeAutoUpgradeConfiggkeAutoUpgradeConfigr   AuthenticatorGroupsConfigauthenticatorGroupsConfigr  ShieldedNodesshieldedNodesWorkloadIdentityConfigworkloadIdentityConfigrZ  lowerParseIPAliasOptionsParseAllowRouteOverlapOptionsParsePrivateClusterOptionsParseTpuOptionsr   VerticalPodAutoscalingverticalPodAutoscalingr   BigQueryDestinationResourceUsageExportConfigresourceUsageExportConfigr  enableNetworkEgressMeteringr	  ConsumptionMeteringConfigconsumptionMeteringConfig(ENABLE_NETWORK_EGRESS_METERING_ERROR_MSG.ENABLE_RESOURCE_CONSUMPTION_METERING_ERROR_MSGr   r   
MasterAuthr   
masterAuthClientCertificateConfigclientCertificateConfigr   r  r  DatabaseEncryptionStateValueValuesEnum	ENCRYPTEDdatabaseEncryptionr   rG  configr6   _GetReleaseChannelreleaseChannel	Autopilotr  r{  secretManagerConfigSecretManagerConfigr~  secretSyncConfigSecretSyncConfigautoscalingClusterAutoscaling autoprovisioningNodePoolDefaults AutoprovisioningNodePoolDefaultsrt  workloadPolicyConfigWorkloadPolicyConfigallowNetAdminr?  ConfidentialNodesconfidentialNodesr@  #_ConfidentialNodeTypeEnumFromStringr>  $GetPrivateIpv6GoogleAccessTypeMapperprivateIpv6GoogleAccessrl  .NODECONFIGDEFAULTS_READONLY_PORT_NOT_SUPPORTEDnodePoolDefaultsNodePoolDefaultsnodeConfigDefaultsNodeConfigDefaultsnodeKubeletConfigNodeKubeletConfig"insecureKubeletReadonlyPortEnabledrm  nodePoolAutoConfigNodePoolAutoConfigrK  
GcfsConfig
gcfsConfigrx  ContainerdConfigcontainerdConfigLoadContainerdConfigFromYAMLr   NetworkTagsnetworkTagsrz  _ResourceManagerTagsresourceManagerTagsrL  rX  _GetStableFleetConfigstableFleetConfigr  meshCertificatesMeshCertificatesenableCertificates_AddNotificationConfigToCluster_GetLoggingConfigloggingConfig_GetMonitoringConfigmonitoringConfigrW  _GetManagedOpenTelemetryConfigmanagedOpentelemetryConfigrO  ServiceExternalIPsConfigserviceExternalIpsConfigr  IdentityServiceConfigidentityServiceConfigr\  protectConfigProtectConfigWorkloadConfigAuditModeValueValuesEnumBASICr  	auditModeDISABLEDr]  (WorkloadVulnerabilityModeValueValuesEnumworkloadVulnerabilityModer  podAutoscalingPodAutoscalingHpaProfileValueValuesEnumPERFORMANCE
hpaProfiler?   rc  ManagedConfigTypeValueValuesEnum	AUTOFLEETmanagedConfig MANGED_CONFIG_TYPE_NOT_SUPPORTEDre  fleetFleetr  r  rf  _GetFleetMembershipTyperd  rh  NodePoolLoggingConfigLoggingVariantConfigVariantConfigEnumFromStringvariantConfigr   CostManagementConfigcostManagementConfigri  r  ro  compliancePostureConfigCompliancePostureConfigModeValueValuesEnumENABLEDr  COMPLIANCE_MODE_NOT_SUPPORTEDrp  !COMPLIANCE_DISABLED_CONFIGURATIONsplitComplianceStandardcomplianceStandardsrj  securityPostureConfigSecurityPostureConfigrq  
ENTERPRISE#SECURITY_POSTURE_MODE_NOT_SUPPORTEDrr   VulnerabilityModeValueValuesEnumVULNERABILITY_BASICvulnerabilityModeVULNERABILITY_DISABLEDVULNERABILITY_ENTERPRISE2WORKLOAD_VULNERABILITY_SCANNING_MODE_NOT_SUPPORTEDrs  !runtimeVulnerabilityInsightConfig!RuntimeVulnerabilityInsightConfigPREMIUM_VULNERABILITY_SCANrk  #_GetClusterNetworkPerformanceConfigr  rn  K8sBetaAPIConfigenableK8sBetaApisenabledApisrv  _GetHostMaintenancePolicyCLUSTERhostMaintenancePolicyrw  (GetCreateInTransitEncryptionConfigMapperinTransitEncryptionConfigr|  rotationConfigRotationConfigr}  rotationIntervalr  SyncRotationConfigr  r  $enableCiliumClusterwideNetworkPolicyru  enableFqdnNetworkPolicyr  rbacBindingConfigRBACBindingConfig(enableInsecureBindingSystemAuthenticatedr  *enableInsecureBindingSystemUnauthenticatedr  privilegedAdmissionConfigPrivilegedAdmissionConfigr  userManagedKeysConfigUserManagedKeysConfig	clusterCar  aggregationCar  
etcdPeerCar  	etcdApiCar  serviceAccountVerificationKeysr   r  serviceAccountSigningKeysr  controlPlaneDiskEncryptionKeyr  gkeopsEtcdBackupEncryptionKeyr  !disableL4LbFirewallReconciliationr  _GetEnterpriseConfigenterpriseConfig!_ParseControlPlaneEndpointsConfigdefaultEnablePrivateNodesr  !_GetAnonymousAuthenticationConfiganonymousAuthenticationConfigr  ipAllocationPolicyIPAllocationPolicyAutoIpamConfigautoIpamConfigr  _GetNetworkTierConfignetworkTierConfigr  controlPlaneEgressControlPlaneEgress_GetControlPlaneEgress)r  r'  r   r   poolsrX   kvr   default_snat_status
dns_configgateway_configbindingwindow_start
window_endis_cluster_ipv6bigquery_destinationpoolrm_tagsr  perfadmission_valuess                         ra   CreateClusterCommonzAPIAdapter.CreateClusterCommon  so*     &&w/K5Emm##)>)>%#PG]]**44 !!5!5!;!;!=> >$!Q mm##--@@Qa@P>  5 gl  +"2"2!3g6N6N!NOg !7!78g&-&=&=g#go   ' 9 9g,,8		.	.!D$J!
 ((400#)'
 ++733&,'
#!'$*! 
	%	%	1''#;'
 #)'
 		(	(	4**&A'
#&,'
#"--g~~!!%nn00%@@ $###!..,,S%88 $### ' 2 29e DD%,^^%7%7%N!N ' 2 2< @").."4"4^U"K&-nn&8&8#U' &-^^%7%7 %& %^^//
EB ' 2 2=% H$+NN$6$67G$O$^^//
EB*1..*<*<$e+ +2..*<*<$e+ $+>>#5#5ou#M%nn00eD5 " f: 
GNN	*44"".'"4"44+goo0M

G    (

OP
P'+}}'J'J (K (
$ 
	+	+	7MM11:: 2  	  8
 
	.	.	:MM44== 5  	  ;
 
	*	*	6-- 	$$; $g&&&-&E&Eg#**,,jjQ
 	
 *1)L)Lg&)+g&((4$$jjMNN)-)H)H :: *I *g& ##$$jjHII))jjMNN MM;;// <  
			& $ ; ;1 !< !
 3F/'G,@,@				& $ ; ; =
--
%
%
E
E
W
W , ''				& $ ; ;")"B"B !< !

 ,, 	3 ,,W5J				& $ ; ;  !< !
 +5'--g6N!				& $ ; ;+ !< !
 2@.**6==33w::; 4 g
 $$"mm99//==..FFMM : g
 *$(MM$E$E)) %F %g! ''3		)	)	5&*mm&G&G??ew??@ 'H '
#
 77G

%
%
4
4
;
;mm))v (72 #'--"="="\"\01#  * 	 8 '+mm&G&G??ew??@ 'H '
# 	((00JJ
'
.
.5, /   !!-"&--"A"A00%)]]%I%I#66 &J & 1  #B #g 
	)	)	555??Al11;;=j"&--"A"A00"mm??11 ,j 2  %BB	 @  1  #B 	#g 	Wg.))5(,(M(M44 )N )g% '%=
4==&g" ) --
1
1'*@*@ 2  '
 $$0"mm99// : g '+}}'K'K,, (L (g$
 	Cw11779VC  
w0&&w8##GW5'*..:'+}}'K'K99 (L (g$ ..!]]>>;; ?  --
1
1"6 2  '
 
	/	/HL))E		5	5	AMM33DD 4  	))C
 
	/	/	;JJ?@@		5	5	AJJEFF ||7#C#C#O==33<<'*:*: 4 g 
	)	)	5MM11'.'G'G 2  	2 ++7				& $ ; ;&-&J&J !< !

 00 	7 &&#'==#C#C1100EEOO $D $g 
   ##$%,%>%>" $ 0GG'%=
4==&g" --113g")"3"3g		&	&&&.(,(I(I )J )'
% 
	#	###+%)]]%C%C &D &'
" 
	"	"& $ @ @ B'
??Gmm<<> 


> %% 	<<K   				" MM335$)!				/	/	7MM..0 	. 
	"	"&7	7?C..<(("&--"A"A33 #B #g %%1"&--"A"A33#Ft}}$ #B #g ..:				& $ ; ; =

3
3mmEWDDE 3 44@			jjGHH		!	!	)#'==#A#A#C 		!	!	4	4	<MM,,. 	  3 
	!	!	4	4	F	F	NMM++- 	  33E
 
7
7 11CCf 	FF	 
	#	#	+%)]]%E%E%G"		#	#	5	5	=MM++- 	""4
 
H
H   22U 		!	!	)#'==#A#A#C 		!	!	4	4	<MM,,. 	  3 --
"
"7+>+>
"
? 11< **6		!	!	)#'==#A#A#C 		!	!	4	4	<MM,,. 	  3 --
(
(
* 11B ''

"
"
5
5
F
F

-
-
-- ,,		#	#	+%)]]%E%E%G"/3}}/H/H44 0I 0g  , 55A		#	#	+%)]]%E%E%G"))

8
8g 8?g  4%%		!	!	)#'==#A#A#C 		!	!	4	4	<MM,,. 	  3 --
"
"7+I+I
"
J 11< ##		!	!	)#'==#A#A#C 		!	!	4	4	<MM,,. 	  3  
7 11C ''""jj)00,2L 1 
 	

 
	!	!	)#'==#A#A#C 

*
* 1 $GWdmmD-gt}}EG3t G !!+I
4==,g( ))5				& $ ; ; =
--
0
088 1  4 &&&*mm&I&I11 'J 'g# ++7				& $ ; ;==779 !< !
 
	-	-MM((AAGG 	,,6
 MM((AAJJ 	,,6 55A				& $ ; ; =		7	7MM''PPVV 	7
 MM''PPYY 	7 &				'!%!=!=!?				"	"	$	5MM((BBNN 	) $$&&0MM((BBGG 	) )				%	%	';	6 $ ; ;,,@@JJ !< !
 !!'')Z7 $ ; ;,,@@II !< !
 jj,339O9O3P
 	
 		++-)33gmm		 	 	,/04w}}N 		++-%33gmm		 	 	,/04w}}N *		!	!	)#'==#A#A#C 		!	!	4	4	<MM,,. 	  3 
	!	!	4	4	B	B	JMM//1 	  33A QUP]P]PrPr-mmW44 Qs Qg11??M %%%)]]%G%G &H &g" &&				& $ ; ;")"A"A !< !

 ++ 	3 %		(	(	0MM113 	' 
			!	!	#y	0MM11EEMM 	'', ##%3MM11EENN 	'', jj)00''--/ 1 
 	
 ##/ 


(  &&(J6jj:;;				#MM113 	' "66<<SA=Ah --
*
*H
*
=A=g%%9
 &&2		&	&	.(,(K(K(M%		(	(MM//CCII 	%%*
 MM//CCLL 	%%* +		&	&	.(,(K(K(M%		!	!	'	'	)\	9MM//CCNN 	%%* ##))+z9MM//CCII 	%%* ##))+z9MM//CCLL 	%%* jj/66--335 7 
 	
 ..:		&	&	.(,(K(K(M%		0	0	6	6	8J	FMM//PPdd 	%%7 2288:jHMM//PPgg 	%%7 2288:lJMM//PPii 	%%7 jj>EE<<BBD F 
 	
 33?		2	2	:MM;;= 	1 
	5	5MM;;OOjj 	116
 MM;;OOXX 	116 ))55g>d				& $ ; ;%) !< !
 :>6##"&--"@"@"Bg.5.J.Jg+((		!	!	)#'==#A#A#C 		!	!	4	4	<MM,,. 	  3 $GT]]G
D 11G $$0				& $ ; ; =

7
7mmW::; 5 $$0		$	$	,&*mm&G&G&I#,3,I,Ig!!)--9		$	$	,&*mm&G&G&I#		$	$	3	3	;MM((* 	##2 
0
0 !!008 //;		$	$	,&*mm&G&G&I#		$	$	3	3	;MM((* 	##2 
2
2 !!00A !!-		!	!	)#'==#A#A#C )0)C)Cg&**6		!	!	)#'==#A#A#C 		!	!	0	0	8MM,,. 	  / 
-
- --5 ,,8		!	!	)#'==#A#A#C 		!	!	0	0	8MM,,. 	  / 
/
/ --> 77C				& $ ; ; =

:
: @ ))5				& $ ; ; =

,
, 3 ;;G		"	"	*$(MM$C$C$E!

>
> H ==I		"	"	*$(MM$C$C$E!

@
@ J --9				" MM335$)!				4	4	<"AAGGL6:mm6]6]+ 7^ 7
3 %		&	&	.(,(K(K(M%070B0Bg##-)		&	&	.(,(K(K(M%4;4J4Jg##1'		&	&	.(,(K(K(M%181E1Eg##.&		&	&	.(,(K(K(M%070C0Cg##-00<		&	&	.(,(K(K(M%##BBII

3
3 ++7		&	&	.(,(K(K(M%##==DD

.
. 00<		&	&	.(,(K(K(M%

3
3 ##A 00<		&	&	.(,(K(K(M%

3
3 ##A 44@				& $ ; ; =

7
7 = ||!5gt}}!Mg**7G<##/				& $ ; ; =

&
& 5 ..:.O
4==/g+ +		#	#	+%)]]%E%E%G"26--2N2N 3O 3g  / '		#	#	+%)]]%E%E%G"5J7TXTaTa5bg  2((4		#	#	+%)]]%E%E%G"#9'4==#Qg Nk B=s   ;CW?
R.$CXc                     |j                   }| j                  j                         }|D ]O  }|j                  dd      j	                         }|s&| j                  j                  j                  |      |_        Q |S )Ntotal-egress-bandwidth-tierrD  )rk  r   ClusterNetworkPerformanceConfigr   upper'TotalEgressBandwidthTierValueValuesEnumtotalEgressBandwidthTierr  r   network_perf_argsnetwork_perf_configsrC  
total_tiers         ra   r  z.APIAdapter._GetClusterNetworkPerformanceConfig  sw    ::==HHJ#::;R@FFHj	8<8e8e  9N  9N9
5 $  rb   c                 v	   | j                   j                         }|j                  r|j                  |_        |j                  r|j                  |_        |j                  r|j                  |_        |j                  rt        j                  d      |j                  s|j                  r| j                  |      |_        t        ||       |j                   r|j                   |_        | j%                  ||       | j'                  ||       | j)                  ||       | j+                  ||       | j-                  ||       | j/                  ||       | j1                  ||       |j2                  r|j2                  |_        ng |_        |j4                  r|j4                  |_        | j9                  ||       t;        ||       t=        ||       t?        ||       | jA                  ||       |jB                  "|jB                  }| jE                  |      |_#        |jH                  r|jH                  |_$        |jJ                  r|jJ                  |_%        | jM                  ||       |jN                  |jN                  |_(        | jS                  ||| j                          tU        ||| j                          tW        ||| j                          tY        ||| j                          |jZ                  t        j\                  ||jZ                  |j^                  | j                          |j^                  >|j`                  2|j`                  jb                  	 |j`                  jb                  |_/        | je                  ||       |jf                  -| j                   ji                  |jf                        }||_3        |jj                  |jj                  dk(  rJ| j                   jm                  | j                   jl                  jn                  jp                        |_9        nX|jj                  dk(  rI| j                   jm                  | j                   jl                  jn                  jt                        |_9        |jv                  |jv                  |_<        |jz                  |jz                  |_>        |S )z1Creates node config based on node config options.z4cannot specify node source image in container v1 apir  RDMAgpuDirectStrategyTCPX)?r   
NodeConfigr   machineTyper   r7   r   r8   r   r	   r;  r  r  ParseBootDiskConfigbootDiskr   r   localSsdCount%_AddLocalSSDVolumeConfigsToNodeConfig _AddEphemeralStorageToNodeConfig(_AddEphemeralStorageLocalSsdToNodeConfig!_AddLocalNvmeSsdBlockToNodeConfig)_AddEnableConfidentialStorageToNodeConfig_AddStoragePoolsToNodeConfig&_AddLocalSsdEncryptionModeToNodeConfigr   r   r9   ParseCustomNodeConfig_AddNodeLabelsToNodeConfig_AddLabelsToNodeConfig_AddMetadataToNodeConfig_AddNodeTaintsToNodeConfigry  rh  ri  r   r   ParseAcceleratorOptionsr   r-    _AddWorkloadMetadataToNodeConfig_AddLinuxNodeConfigToNodeConfig&_AddShieldedInstanceConfigToNodeConfig#_AddReservationAffinityToNodeConfigr  LoadSystemConfigFromYAMLrl  kubeletConfigr^  ParseAdvancedMachineFeaturesr8  
VirtualNICr!  GPUDirectConfig GpuDirectStrategyValueValuesEnumr  gpuDirectConfigr  r   maxRunDurationr   	flexStart)r  r   r   r   r8  s        ra   r  zAPIAdapter.ParseNodeConfig  s   --**,K   ' 9 9k  &88k$..k  JJMNN**33!55g>k#G[9")"9"9k..{GD))+w?11+wG**;@22;H%%k7;//WE|| kk%00kw4{G4;0['2##K9$$0**d(,(A(A$(Gk% ' 3 3k|| k  +6+#*#;#;k ))+wN#K$--H*;O'WdmmL&&2
##


)
)

7
7
--	 
	6	6	>%%1))LL ''JJ 
7 	%%g{;}} mm&&w}}&=ek!!-		#	#v	-&*mm&C&C--NNSS 'D '
#
 %%/&*mm&C&C--NNSS 'D '
# +#*#;#;k %%00krb   c                     | j                   j                         }|j                  r|j                  |_        |j                  r|j                  |_        |S r   )r   BootDiskr  provisionedIopsr  provisionedThroughput)r  r   boot_disk_configs      ra   r  zAPIAdapter.ParseBootDiskConfig^  sO    }}--/)))0)K)K&//

2
2 , rb   c                 x   | j                   j                         }|j                  r|j                  |_        |j                  r|j                  |_        |j                  r.|j                  |j                  j                               |_	        |j                  s|j                  s|j                  r||_
        yy)z4Parses advanced machine feature node config options.N)r   AdvancedMachineFeaturesrP  threadsPerCorerQ  enableNestedVirtualizationrR  (PerformanceMonitoringUnitValueValuesEnumr  performanceMonitoringUnitadvancedMachineFeatures)r  r   r   featuress       ra   r  z'APIAdapter.ParseAdvancedMachineFeaturesh  s    }}446H ' 8 8h++,3,P,Ph)**

;
;11779 ( 	  //..,4k) /rb   c                 >   | j                   j                         }|j                  r|j                  |_        |j                  r|j                  |_        |j
                  r|j
                  |_        |j                  s|j                  s|j
                  r||_        yy)z"Parses custom node config options.N)r   CustomImageConfigr   r   imageProjectr   imageFamilynodeImageConfig)r  r   r   custom_configs       ra   r  z APIAdapter.ParseCustomNodeConfig}  sz    MM335M}}#MMm#*#8#8m ")"6"6m}}--1E1E$1k! 2Frb   c           
         |j                   xs t        }|j                  |z   dz
  |z  }|dk(  rdg}n(t        d|      D cg c]  }dj	                  |       }}g }|j                  t        |      z   dz
  t        |      z  }|j                  }|D ]  }	||kD  r|n|}
| j                  j                  |	|
||j                  | j                  |            }|j                  r| j                  j                  |j                  |j                  |j                  |j                  |j                        |_        |j"                  /t%        | j                  |j"                        |j                   _        |j(                  rP|j*                  st-        j.                  t0              | j                  j3                  |j(                        |_        |j6                  |j8                  U| j                  j;                         |_        |j6                  |j<                  _        |j8                  |j<                  _         |jB                  dk(  s|jD                  | j                  jG                         |_$        |jB                  dk(  r9| j                  jF                  jJ                  jL                  |jH                  _'        |jD                  |jD                  |jH                  _(        |jR                  :| j                  jU                         |_+        |jR                  |jV                  _,        |j[                  |       ||
z  } |S c c}w )	Creates a list of node pools for the cluster by parsing options.

    Args:
      options: cluster creation options
      node_config: node configuration for nodes in the node pools

    Returns:
      List of node pools.
    rF  default-poolr   zdefault-pool-{0}r  initialNodeCountrC  r  r1   r  minNodeCountmaxNodeCounttotalMinNodeCounttotalMaxNodeCountr  rU   ).r   DEFAULT_MAX_NODES_PER_POOLr   r   rl   rK  r   NodePoolr   _GetNodeManagementr   NodePoolAutoscalingr   r   r   r   rK  r   LocationPolicyEnumFromStringlocationPolicyr   r   r	   r;  ,MAX_PODS_PER_NODE_WITHOUT_IP_ALIAS_ERROR_MSGr  maxPodsConstraintr"  r#  UpgradeSettingsr.   maxSurgemaxUnavailabler   r   PlacementPolicyplacementPolicyr  rU   r  
policyNamer   QueuedProvisioningqueuedProvisioningr  r   )r  r   r   r   r  
pool_namesiper_poolto_addr  nodesr  s               ra   r  zAPIAdapter.ParseNodePools  s    	""@&@  !33a7<NNEz"#j ;@5/J/Q&--a0/jJE!!C
O3a7C
OKHF!H,h6e]]## &&,,W5 $ d 
	#	#==<<.. ** **%55%55 = 
 "".,HmmW44-$


) 
	"	"&&

GH
H!%!@!@"44 "A "
 
#
#
/,,8#}}<<>(/(A(A%.5.M.M+

 
 I
-%%1#}}<<>			9	,MM))==EE 	! 
	!	!	-*1*B*B'		+	+	7"&--"B"B"D*1*L*L'll4ofc d Lo Ks   M	c                 X   |j                   |j                   d   }t        |j                   j                  dd            }| j                  j	                  ||      }|j                   j                  dd      }|r||_        t        |j                   j                  dd	            }|r||_        |j                   j                  d
d      }|j                   j                  dd      }	|	s|r|	d}	nt        |	      }	| j                  j                  j                  }
||
j                  }n=|dk(  r|
j                  }n+|dk(  r|
j                  }nt        j                  t              | j                  j                  |	|      }||_        |j                   j                  dd      }||j                         dk(  r+| j                  j                   j"                  j$                  }n|j                         dk(  r+| j                  j                   j"                  j&                  }nW|j                         dk(  r+| j                  j                   j"                  j(                  }nt        j                  t*              | j                  j!                  |      }||_        |g|_         yy)z9Parses accrelerator options for the nodes in the cluster.Nr  countrF  )acceleratorTypeacceleratorCountzgpu-partition-sizerD  zmax-time-shared-clients-per-gpur   zgpu-sharing-strategyzmax-shared-clients-per-gpur]  ztime-sharingmps)maxSharedClientsPerGpugpuSharingStrategyzgpu-driver-versiondefaultlatestr  )gpuDriverVersion)r   intr   r   AcceleratorConfiggpuPartitionSizemaxTimeSharedClientsPerGpuGPUSharingConfig!GpuSharingStrategyValueValuesEnumTIME_SHARINGMPSr	   r;  GPU_SHARING_STRATEGY_ERROR_MSGgpuSharingConfigr,  GPUDriverInstallationConfigGpuDriverVersionValueValuesEnumDEFAULTLATESTINSTALLATION_DISABLEDGPU_DRIVER_VERSION_ERROR_MSGgpuDriverInstallationConfig)r  r   r   	type_namerL  accelerator_configgpu_partition_sizemax_time_shared_clients_per_gpugpu_sharing_strategymax_shared_clients_per_gpustrategy_enumgpu_sharing_configgpu_driver_versiongpu_driver_installation_configs                 ra   r  z"APIAdapter.ParseAcceleratorOptions  s   '&&v.i'&&**7A67e==::#e ;  #//334H"M	.@+(+



"
"#Da
H)% 
)+ 	5 %1155
 $ $+#7#7#;#;
&$  
$';%-'(
$'*+E'F
$ MM**LL 	  '!.!;!;
!^3!.!;!;
!U*!.!2!2


9:
:!]];;#=3 < 
 /A+"//334H$O		'##%2mm77WW__   %%'83mm77WW^^   %%':5mm77WWmm  

78
8 MM55!3 6  	' + 	6
 "k] (rb   c                 *   |j                   | j                  j                  j                         }g }t	        t        j                  |j                               D ]'  \  }}|j                  |j                  ||             ) ||_	        ||_
        yy)z/Parses resource labels options for the cluster.Nr}  )r   r   r  ResourceLabelsValuer   six	iteritemsr   r  r  resourceLabels)r  r   rX   r   propsr  r  s          ra   r!  zAPIAdapter.ParseResourceLabels(  sz    ~~!}}$$88:few~~67$!QV..1A.>? 8$)f!%g "rb   c           
         d|j                   fd|j                  fd|j                  fd|j                  fd|j                  fd|j
                  fd|j                  fg}|j                  s6|D ]1  \  }}|s	t        j                  t        j                  d|	             |j                  r%|j                  t        j                  t              |j                  rd
}d
}|j                  v|j                  D ]/  }|dvst        j                  t        j                  |             |j                  j                  dd
      }|j                  j                  dd
      }| j                   j#                  |j                  |j                  d
u||j$                  ||j                   |j                  |j                        }	|j                  +| j                   j'                  |j                        |	_        |j*                  r|j*                  |	_        |j
                  =t        j.                  | j                         j1                  |j
                        |	_        |j                  =t        j4                  | j                         j1                  |j                        |	_        d
|_        |	|_        |S |j                  !| j                   j#                  d      |_        |S )z Parses the options for IP Alias.zservices-ipv4-cidrzcreate-subnetworkzcluster-secondary-range-namezservices-secondary-range-namezdisable-pod-cidr-overprovisionz
stack-typezipv6-access-typeenable-ip-aliasr  Nr  r   r~  r  r   )useIpAliasescreateSubnetworksubnetworkNameclusterIpv4CidrBlocknodeIpv4CidrBlockservicesIpv4CidrBlockclusterSecondaryRangeNameservicesSecondaryRangeNamedisableT)	useRoutes)r   r   r   r   rY  rZ  r[  r   r	   r;  r  rl   r   +CREATE_SUBNETWORK_WITH_SUBNETWORK_ERROR_MSG'CREATE_SUBNETWORK_INVALID_KEY_ERROR_MSGr   r   r  r   PodCIDROverprovisionConfigpodCidrOverprovisionConfigr   tpuIpv4CidrBlockGetCreateStackTypeMapperr  	stackTypeGetIpv6AccessTypeMapperipv6AccessTyper  r  )
r  r   rX   ip_alias_only_optionsr  r  subnetwork_namenode_ipv4_cidrr~  policys
             ra   r-  zAPIAdapter.ParseIPAliasOptions2  s    
w99:	g778	')M)MN+11	

 -22	
 
w))*	W556 "",)$

+220d 3   - g77CJJBCCon		"	"	.,,C))**7>>3>G  -
 "3377E 2266wE}}//.."44D@(&88* ' : :$+$H$H%,%J%J 0 	f 
	/	/	;MM44>> 5  	)
 
		")"7"7				'88MM


7--
. 	 
	!	!	- $ < <MM!


733
4 	 !%g#)g  N 
	 	 	,#'==#C#C $D $g  Nrb   c                    |j                   sy|j                  t        j                  t              |j
                  t        j                  t              |j                  r%|j                  t        j                  t              |j                  $| j                  j                  d      }||_	        yd|j                  _        y)z*Parse the options for allow route overlap.NT)allowRouteOverlap)r   r   r	   r;  1ALLOW_ROUTE_OVERLAP_WITHOUT_EXPLICIT_NETWORK_MODEr   2ALLOW_ROUTE_OVERLAP_WITHOUT_CLUSTER_CIDR_ERROR_MSGr   3ALLOW_ROUTE_OVERLAP_WITHOUT_SERVICES_CIDR_ERROR_MSGr  r   r  r  )r  r   rX   r  s       ra   r.  z(APIAdapter.ParseAllowRouteOverlapOptions  s    &&&JJHII  (JJIJJ7#=#=#EJJJKK !!)}}//$/Gf#)g 59g  2rb   c                    |j                   %|j                  t        j                  t              |j                   |j                  |_         |j                   r6|j
                  s*t        j                  t        j                  dd            |j                  r6|j                   s*t        j                  t        j                  dd            |j                  r6|j                   s*t        j                  t        j                  dd            |j                  rC| j                  j                  |j                   |j                  |j                        }||_        |S )zEParses the options for Private Clusters (for backward compatibility).rw  zenable-private-nodesr  zenable-private-endpointzmaster-ipv4-cidr)enablePrivateNodesenablePrivateEndpointmasterIpv4CidrBlock)r   r   r	   r;  3ENABLE_PRIVATE_NODES_WITH_PRIVATE_CLUSTER_ERROR_MSGr   r  rl   r   r   r   PrivateClusterConfigprivateClusterConfig)r  r   rX   rC  s       ra   r/  z%APIAdapter.ParsePrivateClusterOptions  sI    	$$0##/JJJKK##+%,%<%<g"##G,C,CJJ
'
.
.,2H /   &&w/K/KJJ
'
.
.17P /   (D(DJJ
'
.
.17I /   }}11$99 ' ? ?%66 2 f
 &,g"Nrb   c                 l   |j                   r6|j                  s*t        j                  t        j                  dd            |j                   s6|j                  r*t        j                  t        j                  dd            |j                   s6|j                  r*t        j                  t        j                  dd            |j                   rb|j                   |_        |j                  rD| j                  j                  |j                   |j                  |j                        }||_        yyy)zParses the options for TPUs.rw  z
enable-tpur  ztpu-ipv4-cidrzenable-tpu-service-networkingr  ipv4CidrBlockuseServiceNetworkingN)r   r   r	   r;  r  rl   r   r   	enableTpur   	TpuConfig	tpuConfig)r  r   rX   
tpu_configs       ra   r0  zAPIAdapter.ParseTpuOptions  s!   '"9"9JJ
'
.
.,, /   '"7"7JJ
'
.
.'_ /   '"G"G JJ
'
.
.'-L /   !,,g		.	.]],,&&!//!(!F!F - 


 ' 
/ rb   c                 z   |j                   r%|j                  st        j                  t              |j                  @|j
                  ,|j
                  j                  d|j
                  j                  _        n|j                  sI| j                  j                  d      }| j                  |       ||j
                  j                  _        n| j                  j                  |j                        }|j                   rF|j                   D ]7  }|j                  j                  | j                  j                  |             9 | j                  |       ||j
                  j                  _        |j                  | j                  |       |j
                  j                  j                  	 5| j                  j                  d      |j
                  j                  _        |j                  |j
                  j                  j                  _        |j                   | j                  |       |j
                  j                  j                  	 5| j                  j                  d      |j
                  j                  _        |j                   |j
                  j                  j                  _        yy)z2Parses the options for master authorized networks.NFr  	cidrBlock)r   r   r	   r;  &MISMATCH_AUTHORIZED_NETWORKS_ERROR_MSGcontrolPlaneEndpointsConfigipEndpointsConfigauthorizedNetworksConfigr   MasterAuthorizedNetworksConfig _InitIPEndpointsConfigIfRequired
cidrBlocksr   	CidrBlockrb  gcpPublicCidrsAccessEnabledr  !privateEndpointEnforcementEnabled)r  r   rX   authorized_networksr   s        ra   #ParseMasterAuthorizedNetworkOptionsz.APIAdapter.ParseMasterAuthorizedNetworkOptions  sf    	**99 JJ=>>		2	2	:

-
-
911CCO  //AAZ66 MMHH I  ++G4  
-
-
?
?
X !MMHH;; I  
	+	+99G

(
(
/
/mm%%%8 : ++G4  
-
-
?
?
X ))5
++G4

-
-
?
?
X
X

 MM888G //AAZ 
,
, 
-
-
?
?
X
X
t ==I
++G4

-
-
?
?
X
X

 MM888G //AAZ 
@
@ 
-
-
?
?
X
X
z Jrb   c                 *   |j                   l|j                  r*t        j                  t        j                  dd            |j                  r*t        j                  t        j                  dd            |j                   3|j                  '|j                  |r|j                  |j                  y| j                  j                         }|rI| j                  |      }|j                  r,|j                  j                  r|j                  j                  }|j                   | j                  j                  j                  }|j                   j                         dk(  r|j                   }n6|j                   j                         dk(  r|j"                  }n|j$                  }||j&                  k7  r |rt)        j*                  dd	
       ||_        |j                  `| j                  j                  j,                  }|j                  j                         dk(  r|j.                  |_        n|j2                  |_        |j                  |j                  |_        |j                  |j                  |_        |r|j                  rd|_        |S )z"Parses the options for ClusterDNS.Nzcluster-dnszcluster-dns-scoper  zcluster-dns-domainclouddnskubednszAll the node-pools in the cluster need to be re-created by the user to start using the new DNS provider. It is highly recommended to perform this step shortly after completing the update.Trt  cancel_on_norX   rD  )rD  rE  r	   r;  r  rl   rF  rH  rG  r   	DNSConfigr*  r  r  ClusterDnsValueValuesEnumr,  	CLOUD_DNSKUBE_DNSPLATFORM_DEFAULT
clusterDnsr   PromptContinueClusterDnsScopeValueValuesEnumCLUSTER_SCOPEclusterDnsScope	VPC_SCOPEclusterDnsDomainadditiveVpcScopeDnsDomain)	r  r   	is_updater'  r  rX   provider_enumdesired_cluster_dns
scope_enums	            ra   r  z!APIAdapter.ParseClusterDNSOptions   sP   "		"	"jj)00*0C 1 
 	

 
	#	#jj)00*0D 1 
 	
 	#%%-&&.g@@H119((*J,g			7#8#8#B#B**44
&mm--GGm				"	"	$
	2+55$$&)3+44+<<	
 5 5	5

#
#+
   !4
  ,==**IIj		"	"	(	(	*i	7%/%=%=
"%/%9%9
"!!-$+$>$>j!,,8

/
/ * W77-/j*rb   c                 v   |j                   y| j                  j                         }| j                  j                  j                  }|j                   j	                         dk(  r|j
                  |_        |S |j                   j	                         dk(  r|j                  |_        |S |j
                  |_        |S )zParses the options for Gateway.Nr  r  )rg  r   GatewayAPIConfigChannelValueValuesEnumr,  CHANNEL_DISABLEDchannelCHANNEL_STANDARD)r  r   r  channel_enums       ra   r  zAPIAdapter.ParseGatewayOptionsk  s     "]]335N==11HHL  "j0+<<n  
			"	"	$
	2+<<n   ,<<nrb   c                    | j                  |      }j                  j                  j                  | j	                  |d      |_        j                  rt        fdt        D              rΉj                  sUj                  t        j                  vsj                  +t        j                  vrt        j                  t              t         j                  vrt        j                  t"              t%        | j&                        }| j&                  j)                  d|      |j*                  _        | j&                  j/                  t1        |j2                  |j4                        |      }| j6                  j8                  j;                  |      }| j=                  |j>                  |j4                        S )a1  Handles CreateCluster options that are specific to a release track.

    Overridden in each release track.

    Args:
      cluster_ref: Name and location of the cluster.
      options: An UpdateClusterOptions containining the user-specified options.

    Returns:
      The operation to be executed.
    Fc              3   :   K   | ]  }|j                   v   y wr   r   .0r  r   s     ra   	<genexpr>z+APIAdapter.CreateCluster.<locals>.<genexpr>       <Oqa7>>!O   r  loadBalancerTypeparentrX   ) r  r$  r  r  CreateClusterAutoscalingCommonrK  r   anyCLOUDRUN_ADDONSr   rT  r@   rS  r	   r;  2CLOUDRUN_STACKDRIVER_KUBERNETES_DISABLED_ERROR_MSGr  .CLOUDRUN_INGRESS_KUBERNETES_DISABLED_ERROR_MSG_GetCloudRunLoadBalancerTyper   CloudRunConfigr  cloudRunConfigCreateClusterRequestProjectLocationr  r  r  r  Creater  r  )r  r'  r   rX   load_balancer_typereqrx  s     `    ra   CreateClusterzAPIAdapter.CreateCluster{  s|    &&{G<G''3&&2//; ??
wg ~~	<O<	<44"".'"4"44+goo0M

MN
N'..(

IJ
J9T]]
 /3mm.J.J-? /K /
+ --
,
,{44k6F6FG - C 77>>sCIy~~{/?/?@@rb   c                 	   | j                   j                         }|rZ|r| j                  |      nd}|rT|j                  rH|j                  j                  |_        |j                  j
                  |_        n|j                  |_        |j                  +| j                   j                  |j                        |_        g }|j                  t        j                  |j                         t        j                  |j                        }|j                  t              }|j                  t               }|j                  t"              }	d}
d}|j                  t$              }|r*|j                  t&              }
|j                  t(              }|j                  t*              }d}d}|r*|j                  t,              }|j                  t.              }|j                  t0              }|j                  t2              }|j                  t4              }|j                  t6              }|j                  t8              }|j                  t:              }|j                  t<              }d}d}|r|j                  t>              }|j                  t@              }n| jC                  |      }|jD                  }|jF                  }	|jH                  }
|jJ                  }|jL                  }|jN                  }|jP                  }|jR                  }|jT                  }d}d}d}d}d}|j                  #|j                  |_        |g }||_+        |	g }	d}d}|
2|0|jX                  s$|jZ                  s|j\                  |j^                  | ja                  ||
|      }||| j                   jc                  ||      }d}||(| j                   je                         }||_3        ||_4        |r+| j                   jk                  ||	||||||||
      |_6        n*| j                   jk                  ||	||||||||
      |_6        |rto        |      |_8        |jr                  | ju                  |      |_;        | jy                  ||       |S   Create cluster's autoscaling configuration.

    Args:
      cluster_ref: Cluster reference.
      options: Either CreateClusterOptions or UpdateClusterOptions.
      for_update: Is function executed for update operation.

    Returns:
      Cluster's autoscaling configuration.
    Nr  r2   r3   
r,   r   r.   r1   r-   r6   r7   r8   r9   r:   )=r   rL  r*  rK  enableNodeAutoprovisioningdefaultComputeClassConfigr$  r  DefaultComputeClassConfigr%  r	   "ValidateAutoprovisioningConfigFiler   loadr   RESOURCE_LIMITSSERVICE_ACCOUNTr   UPGRADE_SETTINGSMAX_SURGE_UPGRADEMAX_UNAVAILABLE_UPGRADENODE_MANAGEMENTENABLE_AUTO_UPGRADEENABLE_AUTO_REPAIRAUTOPROVISIONING_LOCATIONSMIN_CPU_PLATFORM
IMAGE_TYPEBOOT_DISK_KMS_KEY	DISK_TYPEDISK_SIZE_GBSHIELDED_INSTANCE_CONFIGENABLE_SECURE_BOOTENABLE_INTEGRITY_MONITORINGResourceLimitsFromFlagsr&  r'  r0  r1  r2  r3  r(  r6  r/  r+   r_  r^  r`  ra  UpdateUpgradeSettingsForNAPNodeManagementShieldedInstanceConfigr;   r<   rN  rM  r   r5   r  CreateAutoscalingProfileCommonautoscalingProfileValidateClusterAutoscaling)r  r'  r   
for_updaterK  rX   resource_limitsrC  r   r4   r"  r#  upgrade_settingsmanagement_settingsr   r   r(  r   r/  r   r   r  shielded_instance_configenable_secure_bootenable_integrity_monitoringr1   s                             ra   r  z)APIAdapter.CreateClusterAutoscalingCommon  s    --224K0;,g	W((:: 	. 99 	- 07/N/Nk,++7
--
1
1:: 2  +
 O++7
--

.
. yy==>f

?3o

?3ozz&!f $$45	,001BC"2"6"67N"O"JJ7	0445HI/334FG#)::.H#I $45$*JJz$:! **%67**Y'iZZ-l!',D!E$(!	!599:LM&>&B&B''
# 44W=o@@o..f!DD ' P P"FF!DD#*#E#E  BB$+$G$G!il$(!&&2/6/N/Nk,		 #2k 	j

'$0??::==I==I;;&(?
 
	&*<*H]]11*7H 2 

 "&

((4#'==#G#G#I 4F 1' 	!: 
MM::." 0%/0'"5'? ;  	4  MM::." 0%/0'"5'? ;  	4 
$06&1
- "".'+'J'J
(k$ 	##K<rb   c                    |j                   r!|j                  rt        j                  d      | j                  j                         }||_        ||_        |j                   r/| j                  j
                  j                  j                  |_
        |j                  r/| j                  j
                  j                  j                  |_
        |j                  |j                  | j                  ||      |_        |S )z7Updates upgrade settings for autoprovisioned node pool.zUpgradeSettings must contain only one of: --enable-autoprovisioning-surge-upgrade, --enable-autoprovisioning-blue-green-upgrade)r^  r_  r	   r;  r   r>  r?  r@  StrategyValueValuesEnumSURGEstrategy
BLUE_GREENr`  ra  UpdateBlueGreenSettingsForNAPblueGreenSettings)r  r   	max_surgemax_unavailabler  s        ra   r  z&APIAdapter.UpdateUpgradeSettingsForNAPM  s     	55>>JJ:  }}446 )&5#44
--
'
'
?
?
E
E  99
--
'
'
?
?
J
J  	88D;;G+/+M+M
G,( rb   c                 R   |j                   xs | j                  j                         }|j                  |j                  |_        |j
                  |j                  xs | j                  j                         }d|j
                  v r#d|j
                  v rt        j                  d      dx|_
        |_        d|j
                  v r|j
                  d   |_        n"d|j
                  v r|j
                  d   |_
        d|j
                  v r|j
                  d   |_        ||_        |S )zSUpdate blue green settings field in upgrade_settings for autoprovisioned node pool.Nbatch-node-countbatch-percentz`Autoprovisioning StandardRolloutPolicy must contain only one of: batch-node-count, batch-percentbatch-soak-duration)r  r   BlueGreenSettingsra  nodePoolSoakDurationr`  standardRolloutPolicyStandardRolloutPolicyr	   r;  batchPercentagebatchNodeCountbatchSoakDuration)r  r  r   blue_green_settingsr  s        ra   r  z(APIAdapter.UpdateBlueGreenSettingsForNAPn  sN    	**Odmm.M.M.O  77C

:
: . 77C

3
3 3]]002   P P
P==> jj/
 	
 -
!
0	wOO	O<<=OP 	 . gNNN<<_M 	 /
  ==> <<% 	 1
 3J/rb   c                 $   | j                   j                  }|j                  }|j                         D cg c]  }|dk7  rt	        j
                  |       }}t	        j                  t	        j
                  |j                        ||      S c c}w )zCreate and validate cluster's autoscaling profile configuration.

    Args:
      options: Either CreateClusterOptions or UpdateClusterOptions.

    Returns:
      Cluster's autoscaling profile configuration.
    zprofile-unspecified)choice	enum_typevalid_choices)r   rL  !AutoscalingProfileValueValuesEnumnamesr   EnumNameToChoiceChoiceToEnumr  )r  r   cluster_autoscalingprofiles_enumnr-  s         ra   r  z)APIAdapter.CreateAutoscalingProfileCommon  s     --::'IIM $$&&A%% 	""1%&  
 !!))'*E*EF# s   !Bc                    |j                   r|r|j                  rut        d |j                  D              }t        d |j                  D              }|r|st        j                  t
              |j                  }|r|j                  rN|j                  j                  du}|j                  j                  du}||k7  rt        j                  t              |j                  rN|j                  j                  du}|j                  j                  du}	|	|k7  rt        j                  t              |j                  rO|j                  j                   du}
|j                  j"                  du}|
|k7  rt        j                  t$              yyyy|j                  rt        j                  t&              |j                  rF|j                  j(                  s|j                  j*                  rt        j                  t,              yy)Validate cluster autoscaling configuration.

    Args:
      autoscaling: autoscaling configuration to be validated.
      for_update: Is function executed for update operation.

    Raises:
      Error if the new configuration is invalid.
    c              3   :   K   | ]  }|j                   d k(    ywcpuNresourceTyper  limits     ra   r  z8APIAdapter.ValidateClusterAutoscaling.<locals>.<genexpr>  s       
5OEE%'5O   c              3   :   K   | ]  }|j                   d k(    ywmemoryNr:  r<  s     ra   r  z8APIAdapter.ValidateClusterAutoscaling.<locals>.<genexpr>  s#      
3 (*3r>  N)r  r+   r  r	   r;  $NO_AUTOPROVISIONING_LIMITS_ERROR_MSGrM  r.   r?  r@  0BOTH_AUTOPROVISIONING_UPGRADE_SETTINGS_ERROR_MSGr1   r2   r3   3BOTH_AUTOPROVISIONING_MANAGEMENT_SETTINGS_ERROR_MSGr:   r;   r<   :BOTH_AUTOPROVISIONING_SHIELDED_INSTANCE_SETTINGS_ERROR_MSG#LIMITS_WITHOUT_AUTOPROVISIONING_MSGr,   r   %DEFAULTS_WITHOUT_AUTOPROVISIONING_MSG)r  rK  r  	cpu_found	mem_founddefaultsmax_surge_foundmax_unavailable_foundauto_upgrade_foundauto_repair_foundsecure_boot_foundintegrity_monitoring_founds               ra   r  z%APIAdapter.ValidateClusterAutoscaling  s    --;55 
5@5O5O
 
	  
$33
 
	 	

?@
@??%%&66??tKO((77tC " %7JJOPP  !)!4!4!@!@!L ( 3 3 > >d J $66JJE  ,,//@@L  //II ' !$>>JJL  ? -  6L 
	#	#JJ:;;		5	544CC77CCJJ<== D 
6rb   c                    |j                   6|j                   s*| j                  j                  j                  j                  S |j                   r|dk(  s|dk(  ry|j                   r4|dk7  r/|dk7  r*| j                  j                  j                  j
                  S |j                  r*| j                  j                  j                  j                  S y)z/Gets the cluster telemetry from create options.Nr  )r   r   ClusterTelemetryr  r  r  r   SYSTEM_ONLY)r  r   r  r  s       ra   _GetClusterTelemetryTypez#APIAdapter._GetClusterTelemetryType  s     	--955]]++??HHH ,,6!%76%A 	--v%&(]]++??GGG
 44]]++??KKKrb   c           
      >   g }|j                   |j                  A|j                  | j                  j	                  d|j                   |j                               |j
                  |j                  A|j                  | j                  j	                  d|j
                  |j                               |j                  |j                  j                  d      }d}|j                  S|j                  j                  d      |k7  rt        j                  t              |j                  j                  dd      }|j                  | j                  j	                  |j                  j                  d      ||j                  j                  dd                   |S )zCreate cluster's autoscaling resource limits from command line flags.

    Args:
      options: Either CreateClusterOptions or UpdateClusterOptions.

    Returns:
      Cluster's new autoscaling resource limits.
    r9  )r;  minimummaximumrA  r  r   rL  )r)  r*  r   r   ResourceLimitr+  r,  r.  r   r-  r	   r;  *MISMATCH_ACCELERATOR_TYPE_LIMITS_ERROR_MSG)r  r   new_resource_limitsaccelerator_type	min_counts        ra   r  z"APIAdapter.ResourceLimitsFromFlags  sx    "goo&A  
--
%
% oooo &  %););)G  
--
%
%#(((( &  * 0044V<i		 	 	,""&&v.2BB

EF
F++//;	  
--
%
%"2266v>--11'1= &  rb   c                 b   d}|j                   sd|_         |j                  r| j                  j                  |j                   |j                  |j
                  |j                  |j                        }|j                  | j                  j                  |j                        |_
        n|j                  r| j                  j                  |j                         }|j                  +| j                  j                  |j                        |_
        |j                  | j                  j                  |j                        |_        n|j                  r*| j                  j                         }d|_        d|_        n|j                  *| j                  j                         }d	|_        d	|_        ny|j$                  s|j&                  rW| j                  j                         }|j$                  r|j$                  |_        |j&                  r|j&                  |_        n
|j(                  sm|j*                  sa|j,                  sU|j.                  sI|j0                  s=|j2                  s1|j4                  s%|j6                  s|j8                  s|j:                  rt=        || j                        }|j:                  s|j6                  s|j8                  r||j2                  p|j4                  d| j?                  |      }|rQ|j@                  rE|j@                  jB                  r/|j@                  jB                  jD                  rd
|_        nd
|_        d}|j0                  r| j?                  |      }|tG        jH                  d      |j@                  jJ                   |j@                  jJ                  jL                  s(|j0                  dk(  rtG        jH                  tN              |j@                  jJ                  jL                  rtQ        || j                  d
d
      }n1tQ        || j                  d
d      }ntQ        || j                  dd      }| j                  j                         }|r||_)        |	r||_*        	n|jV                  rx|jV                  jY                  tZ              }| j]                  |jV                  jY                  t^              |jV                  jY                  t`              |jV                  jY                  tb              |jV                  jY                  td              || nd      }|jV                  jY                  tf              ?| j                  ji                  |jV                  jY                  tf                     |_5        |jV                  jY                  tl              ?| j                  jo                  |jV                  jY                  tl                     |_8        |jV                  jY                  tr              ?| j                  ju                  |jV                  jY                  tr                     |_;        |jV                  jY                  tx              ?| j                  j{                  |jV                  jY                  tx                     |_>        |jV                  jY                  t~              ?| j                  j                  |jV                  jY                  t~                     |_A        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_D        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_G        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_J        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_M        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_P        | j                  j                  |      }n)|j                  |j                  |j                  | j]                  || j                        }|j                  5| j                  j                  |j                        |j                  _U        |j                  5| j                  j                  |j                        |j                  _W        |j                  |j                  |j                  _X        | j                  j                  |      }n"|j                  | j                  j                  |j                        }	|j                  ru|j                  |	_\        |j                  |	_^        |j                  |	_`        |j                  |	_b        |j                  %t        | j                  |j                        |	_e        | j                  j                  |j                  |	      }nF|j                  r(| j                  j                  |j                        }n|j                  |j                  |j                  1| j                  ||d
      }	| j                  j                  |	      }n|j                  D| j                  j                  |j                        }
| j                  j                  |
      }nm|j                  D| j                  j                  |j                        }| j                  j                  |      }n|j                  | j                  j                  | j                  j                  |j                              }|j                  rd
|_s        |j                  +| j                  j                  |j                        |_v        | j                  j                  |      }ni|j                  tG        jH                  t              |j                  tG        jH                  t              |j                  7| j                  j                         }| j                  j                  |      }n|j                  C| j                  j                  |j                        }| j                  j                  |      }n|j                  C| j                  j                  |j                        }| j                  j                  |      }n>|j                  r2t        || j                        }| j                  j                  |      }|j                  (|j                  |j                   |j                  _        |j                   r'|j                  stG        jH                  t              |j                  ro| j                  j                  | j                  j	                  |j                  | j                  j                  j
                  j                              }no|j                  rb| j                  j                  | j                  j	                  | j                  j                  j
                  j                              }|j                  B| j                  j                  | j                  j                  |j                              }|j                  1| j                  j                  t        || j                               }|j                  1| j                  j                  t        || j                        !      }|j                  1| j                  j                  t!        || j                        "      }|j"                  D| j                  j%                  |j"                  #      }| j                  j                  |$      }|j&                  D| j                  j)                  |j&                        }| j                  j                  |%      }|j*                  W| j                  j                  tG        j,                  | j                  d&      j/                  |j*                        '      }| j1                  |d
|(      }|| j                  j                  |)      }| j3                  |      }|| j                  j                  |*      }|j4                  1| j                  j                  t7        || j                        +      }|j8                  7| j                  j                  | j                  j;                  d      ,      }|j<                  C| j                  j                  | j                  j?                  d
|j<                  -      .      }|j@                  B| j                  j                  | j                  jC                  |j@                        /      }|jD                  B| j                  j                  | j                  jG                  |jD                  0      1      }|jH                  ;|jH                  }| jK                  |      }| j                  j                  |2      }|jL                  B| j                  j                  | j                  jC                  |jL                        /      }|jN                  B| j                  j                  | j                  jQ                  |jN                  3      4      }|jR                  1| j                  j                  tU        || j                        5      }|jV                  B| j                  j                  | j                  jY                  |jV                        6      }|jZ                  B| j                  j                  | j                  j]                  |jZ                        7      }|j^                  |j`                  k| j                  jc                         }|j^                  | j                  je                         |_        |j^                  r>| j                  jd                  jh                  jj                  |jf                  _        n=| j                  jd                  jh                  jn                  |jf                  _        |j`                  r|j`                  r3| j                  jb                  jp                  jj                  |_        n2| j                  jb                  jp                  jn                  |_        | j                  j                  |8      }|jt                  |jt                  d9k(  re| j                  jw                  | j                  jv                  jx                  jz                  :      }| j                  j                  |;      }nt|jt                  d	k(  rd| j                  jw                  | j                  jv                  jx                  j|                  :      }| j                  j                  |;      }|j~                  y| j                  j                         }| j                  j                  t        | j                  |j~                        <      |_        | j                  j                  |=      }|j                  s|j                  r| j                  j                         }|j                  r-| j                  j                  |j                  >      |_        |j                  r-| j                  j                  |j                  >      |_        |j                  U| j                  j                  tG        j                  | j                        j/                  |j                        ?      }|j                  B| j                  j                  | j                  j                  |j                        @      }| j                  j                  j                  j                  | j                  j                  j                  j                  dA}|j                  r^| j                  j                  | j                  j                  |j                  |jY                  |j                  d      B      C      }|j                  r^| j                  j                  | j                  j                  |j                  |jY                  |j                  d      B      C      }|j                  rT|j                  xs |j                  }| j                  j                  | j                  j                  d|D      C      }|j                  I| j                  j                         }|j                  |_        | j                  j                  |E      }|j                  r7| j                  j                  | j                  j                  dFG      C      }|j                  |j                  C|j                  dHk(  r'|j                  rtG        jH                  t              | j                  j                         }| j?                  |      }|j                  r|j                  j                         nd}|+|j                  |j                  j                  |_        n|dHk(  r3| j                  j                  j                  jn                  |_        nn|dIk(  r3| j                  j                  j                  j                  |_        n6tG        jH                  t        j                  |j                  J            |j                  +|j                  |j                  j                  |_        n|j                  s6tG        jH                  t        j                  |j                  K            |j                  j                  dL      D cg c]  }| j                  j                  |M      ! c}|_        | j                  j                  |N      }|j                  | j                  j                         }|j                  r3| j                  j                  j                  jj                  |_        n2| j                  j                  j                  jn                  |_        | j                  j                  |O      }|j                  r| j                  j                         }|j                  j                         dPk(  r3| j                  j                  j                  j                  |_        n|j                  j                         dQk(  r3| j                  j                  j                  jj                  |_        n|j                  j                         dHk(  r3| j                  j                  j                  jn                  |_        nEtG        jH                  t        j                  |j                  j                         J            | j                  j                  |O      }|j                  r| j                  j                         }|j                  j                         dQk(  r3| j                  j                  j                  j                  |_        n|j                  j                         dHk(  r3| j                  j                  j                  j                  |_        n|j                  j                         dPk(  r3| j                  j                  j                  j                  |_        nEtG        jH                  t        j                  |j                  j                         J            | j                  j                  |O      }|j                  | j                  j                         } |j                  r3| j                  j                  j                  j                  | _        n2| j                  j                  j                  jn                  | _        | j                  j                  | R      }|j                  r.| j                  |      }!| j                  j                  |!S      }|j                  N| j                  j                         }"|j                  dTk(  rd
|"_        | j                  j                  |"U      }|j                  N| j                  j                         }"|j                  dTk(  rd|"_        | j                  j                  |"U      }|j                  7| j                  j                  t        || j                  t               V      }|j                  U| j                  j                  tG        j                  | j                        j/                  |j                        W      }|j                  '| j                  j                  |j                  X      }|j                  m| j                  j                  | j                  j                         Y      }tG        j                  |j                  |j                  | j                         |j                  |j                  |j                  a| j?                  |      }#|#j                  }$|j                  /|$| j                  j                         }$|j                  |$_&        |j                  h|$| j                  j                         }$|$j                  !| j                  j                         |$_        |j                  |$j                  _&        |j                  i|$| j                  j                         }$|$j                  !| j                  j                         |$_        |j                  |$j                  _        | j                  j                  |$Z      }|j                   |j"                  |j$                  a| j?                  |      }#|#j&                  }%|j                   /|%| j                  j)                         }%|j                   |%_&        |j$                  h|%| j                  j)                         }%|%j                  !| j                  j+                         |%_        |j$                  |%j                  _&        |j"                  i|%| j                  j)                         }%|%j                  !| j                  j                         |%_        |j"                  |%j                  _        | j                  j                  |%[      }|j,                  '| j                  j                  |j,                  \      }|j.                  '| j                  j                  |j.                  ]      }|j0                  |j2                  w| j                  j5                         }&|j0                  |j0                  |&_        |j2                  |j2                  |&_        | j                  j                  |&^      }|j:                  |j:                  }'t=        |'t>              r@|'j                  dL      D (cg c]%  }(|(jA                         s|(jA                         ' }'}(| j                  j                  | j                  jC                  |'_      `      }|jD                  '| j                  j                  |jD                  a      }|jF                  h|jH                  [|jJ                  N|jL                  A|j                  4|jN                  '|jP                  |jR                  |jT                  /| jW                  ||      })| j                  j                  |)b      }|jX                  |jZ                  | j?                  |      }i }*|j\                  rH|j\                  j^                  }
|
r.|
D ])  }+ta        |+jb                        },|,|*|+jd                  <   + |jX                  g|jX                  D ]W  }+tg        |+dc   |j                  |jh                        }-|-|*v r|*|-   n
ta               },|,jk                  |+dd          |,|*|-<   Y |jZ                  |jZ                  D ]  }.tg        |.dc   |j                  |jh                        }-|-|*vr+tG        jH                  tl        j                  |-e            dd|.v r3|.dd   }/	 |*|-   jo                  |/       |*|-   s|*jq                  |-       |*jq                  |-        | j                  j                  | j                  jw                  |*jy                         D -,cg c]-  \  }-},| j                  j{                  |-t}        |,      g      / c},}-h      i      }|j~                  r| j                  j                  d
j      }|j                  r| j                  j                  dj      }|j                  1| j                  j                  t        || j                        k      }|j                  J| j                  j                         }"|j                  |"_D        | j                  j                  |"U      }|j                  u| j?                  |      }| j                  j                         }0|j                  |j                  }0|j                  |0_H        | j                  j                  |0l      }|j                  u| j?                  |      }| j                  j                         }0|j                  |j                  }0|j                  |0_J        | j                  j                  |0l      }|j                  u| j?                  |      }| j                  j                         }0|j                  |j                  }0|j                  |0_L        | j                  j                  |0l      }|j                  r7| j                  j                  | j                  j                  d      m      }|j                  r7| j                  j                  | j                  j                  d
      m      }|j                  | j                  j                  j                  j                  | j                  j                  j                  j                  dn}1| j                  j                         }
|1|j                     |
_        | j                  j                  |
o      }|j                  1| j                  j                  t        || j                        p      }|j                  | j                  j                  j                  j|                  | j                  j                  j                  j                  dq}1| j                  j                         }
|1|j                     |
_        | j                  j                  |
r      }|S c c}w c c}(w # tr        $ r, tG        jH                  tt        j                  |/f            w xY wc c},}-w )s#Returns an UpdateCluster operation.N-desiredNodeVersiondesiredNodePoolIddesiredImageTypedesiredImagedesiredImageProjectr  desiredMasterVersioncontrolPlaneSoakDurationr  r  r  T:Cannot enable Auto Monitoring. The cluster does not exist.ALLFr  r  r  r  r  r  desiredAddonsConfigrb  desiredNodePoolAutoscalingdesiredLocationsdesiredClusterAutoscalingdesiredPodSecurityPolicyConfigdesiredVerticalPodAutoscalingr  r   desiredResourceUsageExportConfigsecurityProfile desiredIntraNodeVisibilityConfig!desiredManagedOpentelemetryConfigr  desiredDatabaseEncryptionr  desiredShieldedNodesdesiredTpuConfigdesiredReleaseChannelr%  r  desiredDefaultSnatStatusdesiredL4ilbSubsettingConfigr  desiredPrivateIpv6GoogleAccessr  r'  desiredDnsConfigdesiredGatewayApiConfigdesiredNotificationConfigdesiredAutopilotr   desiredAuthenticatorGroupsConfigdesiredGcfsConfigr  $desiredNodePoolAutoConfigNetworkTags,desiredNodePoolAutoConfigResourceManagerTagsrn  desiredMeshCertificatesdesiredStableFleetConfigdesiredServiceExternalIpsConfigdesiredIdentityServiceConfigdesiredProtectConfigr  r  desiredPodAutoscalingr  desiredNodePoolLoggingConfigpodRangeNamesdesiredStackTypedesiredCostManagementConfigLIGHTWEIGHTMEMBERSHIP_TYPE_UNSPECIFIEDr  membershipTypedesiredFleetr  r  desiredK8sBetaApisrD  r  r  r  r  	standardsr  r  desiredCompliancePostureConfigdesiredSecurityPostureConfigr  r  (desiredRuntimeVulnerabilityInsightConfigdesiredNetworkPerformanceConfigr  $desiredAutopilotWorkloadPolicyConfigdesiredHostMaintenancePolicy desiredInTransitEncryptionConfigdesiredEnableMultiNetworkingdesiredContainerdConfigdesiredSecretManagerConfigdesiredSecretSyncConfig+desiredEnableCiliumClusterwideNetworkPolicydesiredEnableFqdnNetworkPolicydesiredRBACBindingConfigr   desiredPrivilegedAdmissionConfig desiredDefaultEnablePrivateNodes"desiredControlPlaneEndpointsConfigr   pod-ipv4-ranger   r   r   podIpv4RangeNamesadditionalIpRangesConfigsdesiredAdditionalIpRangesConfig(desiredDisableL4LbFirewallReconciliationdesiredEnterpriseConfigdesiredUserManagedKeysConfigdesiredAutoIpamConfigLIMITEDr  $desiredAnonymousAuthenticationConfigdesiredNetworkTierConfigr?   VIA_CONTROL_PLANE)desiredControlPlaneEgress(X  r  r  r   ClusterUpdater  r   r   r   r  SecurityProfiler|  r  r  RollbackSafeUpgradedesiredRollbackSafeUpgrader   desiredLoggingServicedesiredMonitoringServicer  r  rS  rT  rU  r  rV  r  r  r  r  r  rp  r*  rs  #advancedDatapathObservabilityConfigenableMetricsr	   r;  managedPrometheusConfigr  8AUTO_MONITORING_NOT_SUPPORTED_WITHOUT_MANAGED_PROMETHEUSrr  desiredLoggingConfigdesiredMonitoringConfigr  r   r  r  r  rK   r  r  r  r  r  r   GcePersistentDiskCsiDriverConfig gcePersistentDiskCsiDriverConfigr  GcpFilestoreCsiDriverConfiggcpFilestoreCsiDriverConfigr  GcsFuseCsiDriverConfiggcsFuseCsiDriverConfigr  StatefulHAConfigstatefulHaConfigr  ParallelstoreCsiDriverConfigparallelstoreCsiDriverConfigr  HighScaleCheckpointingConfighighScaleCheckpointingConfigr  LustreCsiDriverConfigr  r  GkeBackupAgentConfiggkeBackupAgentConfigr  RayOperatorConfigr  r  r  r  r  r  r  r  r  r   r9  r   r2  r   r3  r   r4  r   r5  r   r:  r;  r  r$  r  r  r  r   r"  r   r1  r   r4  r3  r  r6  r	  r7  r8  r9  r:  %clear_resource_usage_bigquery_datasetr   IntraNodeVisibilityConfigrW  rt  r  disableRuntimeRulesr   r   r  r  r?  r@  rA  r  	DECRYPTEDr  r(  r   _GetTpuConfigForClusterUpdater;  rD  r  r$  r  r  r   ILBSubsettingConfigr>  -GetPrivateIpv6GoogleAccessTypeMapperForUpdater  r  r  r<  &_GetNotificationConfigForClusterUpdater  rF  r   r&  rK  ra  r   rf  rz  rh  rL  r  rm  rX  rj  rO  rv  r  rx  r\  r]  r{  r|  r  r}  r~  r  r  r  r  r  r  r  r  r?   rh  r  r  r  r  r  r  AdditionalPodRangesConfigadditionalPodRangesConfig removedAdditionalPodRangesConfigrZ  GetUpdateStackTypeMapperr   r  r  MembershipTypeValueValuesEnumr  r  re  r  rf  rd  r  rn  r  r  r  ro  rp  r  r  r,  r  r  r  r  r  rl   r  *COMPLIANCE_INVALID_STANDARDS_CONFIGURATIONr  r  rj  r  rq  r  r  rr  r  r  r  r  r  r  rs  r  r  rk  r  rt  rP  rQ  r  rv  r  r  rw  (GetUpdateInTransitEncryptionConfigMapperri  rx  rc  re  r  r|  r}  r{  rG  rH  r  r  r  r~  r  r  rI  rJ  r  r  ru  r  r  r  r  r  r  
isinstancestrstripr  r   r  r  r7  r   rb  r  r  r  &_GetDesiredControlPlaneEndpointsConfigr  r  r  r  r   r  r   SubnetworkNameToPathr  add ADDITIONAL_SUBNETWORKS_NOT_FOUNDremovepopKeyError*ADDITIONAL_SUBNETWORKS_POD_RANG_ENOT_FOUNDDesiredAdditionalIPRangesConfigr  AdditionalIPRangesConfiglistr  r  r  _GetDesiredEnterpriseConfigr  %autopilotCompatibilityAuditingEnabledr  r  r  r  r  r  r  r  r  r  r  r  $DesiredAnonymousAuthenticationConfigr  r  r  r  DesiredControlPlaneEgressr  2r  r'  r   updaterS  rX   rT  disable_node_local_dnsr   rK  rC  vertical_pod_autoscalingexport_configr  intra_node_visibility_configmanaged_otel_configr  ilb_subsettting_configr  r  r   r  protect_configpod_autoscaling_configlogging_configmembership_typesrd  
config_objcompliance_updatecompliance_moder  security_posture_config$runtime_vulnerability_insight_configr  rt  old_clustersecret_manager_configsecret_sync_configconfgallowlist_pathspcp_endpoints_configdesired_ip_rangesip_rangesecondary_rangesr   	ip_removeremoved_range updated_user_managed_keys_configmodess2                                                     ra   UpdateClusterCommonzAPIAdapter.UpdateClusterCommon>  sk*   F??go}}**$__#--"--}}%33 + f 
	!	!	-!%!>!>)) "? "
 
		}}***Pf		!	!	-!%!>!>)) "? "

 
	,	,	8,0MM,M,M%,%H%H -N -
) 
	.	.}}**,f%Hf"(Nf%		.	.	:}}**,f%+f"(.f%		#	#w'>'>}}**,f		#	#*1*D*D'		 	 '.'>'>$,,--((..//99::22!'4==9g 55??@@11922://+.((((LL &&JJXX26G/37G0j		&	&//+.?

J 
 $$<<D++CCKK++u4

F  ##;;CC+GT]]D$O*+GT]]D%P*)'4==%N
}}**,f	&-#	)3&			&5599,G!!!0044W=,,005#2266yA!(!7!7!;!;N!K#/ %; : " f 
			#	#O	4	@'+}}'J'J //33ODD (K (
$ 
			#	#N	3	?MM::#2266~FF ;  	/
 
			#	#$9	:	FMM55#22667LMM 6  	*
 
			#	#$4	5	A(,(L(L..223CDD )M )
% 
			#	#J	/	;"&--"@"@..22:>> #A #
 
			#	#$:	;	GMM66#22667MNN 7  	+
 
			#	#$:	;	GMM66#22667MNN 7  	+
 
			#	#O	4	@MM//#2266GG 0  	$
 
			#	#M	2	>&*mm&H&H..22=AA 'I '
# 
			#	#K	0	<#'==#B#B..22;?? $C $
  }}**v*Ff**600<,,8!!'4==9f		+	+	7MM11:: 2  	  8 
	.	.	:MM44== 5  	  ; 
	*	*	6-- 	$$; }}**v*Ff		#	#	/MM55,, 6 k 
	#	##*#4#4 #*#4#4 (/(?(?%(/(?(?%"".'CmmW44(+
$ }}**#--%0 + f 
		}}**G<M<M*Nf''3&&2//;77
wk }}**$/ + f 
	+	+	7}}4444 5 f }}**)/ + f 
	0	0	<!%!E!E99 "F " }}**(@ + f 
	0	0	<mm=="mm???? @  > m
 
	/	/481		5	5	AMM33DD 4  	/
 }}**+8 + f 
	/	/	;JJ?@@		5	5	AJJEFF		6	6	Bmm==?m}}**+8 + f 
	!	!	-66'' 7  }}**;K*Lf		-	-	9%)]]%L%L66 &M &" }}**+G + f 
	#	#:
4== }}**,? + Af 	  ,22> 44
4 0 	**99 JJ=>>&&}}**$(MM$D$D55MM44IISS %E % + f 
	,	,}}**$(MM$D$DMM44IISS %E % + f $$0}}**#}}::33  ;   + f
 %}}**8$--P + f *}}** 27DMM J + f '}}**7O + f ##/!]]<<// =  }}**#7 + f ''3#}}@@22  A   }}**'= + f ..:}}**)-)[)[mmE*55 + f ,,4[ - J }}**J*Gf--g6N!}}**"0 + f "".}}**$Jt}}% + f   ,}}**==2252A + f )}}**+/==+R+R'*@*@ ,S , + f &}}** MM44)) 5  + f ,,8}}**/3}}/H/H88 0I 0 + f 55A;;d))$/g}}**7> + f %%1}}** MM4444 5  + f ''3}}**"&--"@"@!(!A!A #A # + f ##/}}**#8$--#P + f ))5}}***.--*P*P88 +Q + + f &&2}}**'+}}'J'J55 (K ( + f 	,,899E}}224n		-	-	9(,(D(D(F%//mm**CCII 
'
'
1
 mm**CCLL 
'
'
1 
	7	7	C99mm))RRXX 
2
 mm))RR[[ 
2 }}***Of&				-!%!=!=}}33MMYY "> "
 ,,"8 - 
 &(!%!=!=}}33MMRR "> "
 ,,"8 - 
 *}}::<n%)]]%G%G-mmW44 &H &n"
 }}**'5 + f
 	**55}}**,f		+	+MM33%@@ 4  	(
 
	3	3MM33%HH 4  	/ %}}**88mmW//0 + f %%1}}**&*mm&H&H44 'I ' + f MM==II MM==YY }}**}}**!++-11'2I2I4P +  + f }}**}}**++-11'2I2I4P +  + f $$++D{/D/Dm}}**}}**  + " + f ##/==113j&;;j}}**j*If""}}**}}**2*6 + f
 	&''3 
		z	)g.J.Jjj:;; --??A,g )0(:(:'


"
"
$  
!**6#*#B#B#G#G

 j(MM11EENN 	 i'MM11EEMM 	 jj)00g6H6H0I
 	
 
	%	%	-**6--AA 
/ ++jj6==!66 > 
 	
 $88>>sC1
C MM,,h,?C1
-
 }}**): + f &&2 $ C C E		(	(MM//CCII 	 $
 MM//CCLL 	 $ }}**'> + f + $ C C E		!	!	'	'	)\	9MM//CCNN 	 $ ##))+z9MM//CCII 	 $ ##))+z9MM//CCLL 	 $ jj/66--335 7 
 	

 }}**'> + f ..: $ C C E		0	0	6	6	8J	FMM//PPdd 	 1 2288:jHMM//PPgg 	 1 2288:lJMM//PPii 	 1 jj>EE<<BBD F 
 	

 }}**'> + f 33?
--
9
9
; + 
	5	5MM;;OOjj 	-1
 MM;;OOXX 	-1 }}**2 + f ))55g>d}}**4*Pf  ,--<<>		"	"&7	7*.'}}**/@ + f ''3--<<>		)	)->	>*/'}}**/@ + f ((4}}**'@t}}g( + f $$0}}**+/+X+Xmm,++ + f &&2}}**'.'F'F + f **6}}**"&--"@"@"B + f ''

(
(

-
-
-- 	..:33?((4OOK0k)==		&	&	2 ("&--"C"C"E
(/(E(E%		/	/	; ("&--"C"C"E
 //7151M1M1O

.22 	,,4 
	1	1	= ("&--"C"C"E
 //7151M1M1O

.44 	,,= }}**%: + f
 	"".00<..:OOK0k&77		#	#	/%#}}==?
%,%?%?"		,	,	8%#}}==?
,,4.2mm.N.N.P

+// 	))1 
	.	.	:%#}}==?
,,4.2mm.J.J.L

+11 	)): }}**"4 + f 77C}}**>> + f ))5}}**)0)K)K + f
 	<<HAAMmm--/e		=	=	I@@ 	6 
	?	?	KBB 	8 }}**E*Jf--9>>o	OS	).44S9
9!QWWYAGGI9 	 
 }}**+/==+R+R, ,S , + f ##/}}**+2+G+G + f
 	!!-##/..:**644@--9AAM,,8++7 GG
w }}**-@ + f
 	$$0..:,g		#	#++EE h"8#=#=>5Eh112 ! 
	%	%	144H+|$k&;&;[=M=M*
 00  
+5 
 

x(89
:*:
J
' 5 
	,	,	8 <<I+%{'<'<k>N>N* 00**077:7N  *%&67M	
+22=A&z2!%%j1 !!*-+ =. }}***.--*W*W 7H6M6M6O)
 7P2j"2	 --88!+(,-=(> 9  7P) +X + + 
f 44}}**37 + f 33}}**38 + f ||}}**"=t}}# + f 66B--<<>

9
9 = }}**/@ + f 00<,g)-)L)L)N&		&	&	2+2+H+H(

3
3 'E }}**'G + f ++7,g)-)L)L)N&		&	&	2+2+H+H(

.
. '@ }}**'G + f 00<,g)-)L)L)N&		&	&	2+2+H+H(

3
3 'D }}**'G + f   }}** $ < <U < K + f }}** $ < <T < J + f ..: mm@@TT\\ mm@@TT\\e }}AACf'AABfk}}**/5 + f '}}**#8t}}$ + f ((4 mm55IINN mm55II[[e }}668f';;<fk}}**$* + f M]1
P
T  JJ<CC) D  )s0   w
$CDdCDd%CDn=,CD$p=2CED$6CEc           	         | j                  |      }j                  rA| j                  j                  | j                  j	                  j                              }nBj
                  r6| j                  j                  | j                  j	                  d            }|st        j                  t              j                  pt        fdt        D              rXt        | j                        }| j                  j                  t        fdt        D              |      |j                  _        | j                   j"                  j%                  | j                  j'                  t)        |j*                  |j,                  |j.                        |            }| j1                  |j2                  |j,                        S )a1  Handles UpdateCluster options that are specific to a release track.

    Overridden in each release track.

    Args:
      cluster_ref: Name and location of the cluster.
      options: An UpdateClusterOptions containining the user-specified options.

    Returns:
      The operation to be executed.
    r  desiredWorkloadIdentityConfigrD  c              3   X   K   | ]!  }j                   j                  |      d u # y wr   r  r   r  s     ra   r  z+APIAdapter.UpdateCluster.<locals>.<genexpr>  +      ?N!7!!%%a(4   '*c              3   \   K   | ]#  }j                   j                  |      xs d  % ywFNra  r  s     ra   r  z+APIAdapter.UpdateCluster.<locals>.<genexpr>  2      , **..q1:U:,   ),r  r  r>  )r\  r
  r   r   r*  r  r	   r;  NOTHING_TO_UPDATE_ERROR_MSGr  r  r  r  r  rn  r  r  r  UpdateUpdateClusterRequestr!  r  r  r  r  r  )r  r'  r   r>  r  r4  s     `   ra   UpdateClusterzAPIAdapter.UpdateCluster`  s    %%k7;F}}**(,(L(L"00 )M ) + f
 
	*	*}}**(,(L(L )M ) + f  JJ233)	 ?N 
 :T]]
 MM(( ,  "4 )  	""1 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	          | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )N)r  r  )r  r  
SetLoggingr   SetLoggingServiceRequestr!  r  r  r  r  r  )r  r'  r  r4  s       ra   SetLoggingServicezAPIAdapter.SetLoggingService  sx    		0	0	;	;..'%%{'7'79N9N +	 	/ 	

B rww(8(899rb   c           	      2   | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                        t        |                  }| j                  |j                  |j                        S )N)r  r  )r  r  SetLegacyAbacr   SetLegacyAbacRequestr!  r  r  r  r  r  r  )r  r'  r   r4  s       ra   SetLegacyAuthorizationz!APIAdapter.SetLegacyAuthorization  s~    		0	0	>	>**'%%{'7'79N9N 45	 	+ 	

B rww(8(899rb   c                    | j                   j                         }|!| j                   j                  |      |_        |!| j                   j	                  |      |_        |!| j                   j                  |      |_        |!| j                   j                  |      |_	        |!| j                   j                  |      |_        |r!| j                   j                  d      |_        |r!| j                   j                  d      |_        |r!| j                   j!                  d      |_        |	r!| j                   j%                  d      |_        |
r!| j                   j)                  d      |_        |r!| j                   j-                  d      |_        |r!| j                   j1                  d      |_        |r!| j                   j5                  d      |_        |r!| j                   j9                  d      |_        |r!| j                   j=                  d      |_        |r!| j                   jA                  d      |_!        |S )a(  Generates an AddonsConfig object given specific parameters.

    Args:
      disable_ingress: whether to disable the GCLB ingress controller.
      disable_hpa: whether to disable the horizontal pod autoscaling controller.
      disable_dashboard: whether to disable the Kubernetes Dashboard.
      disable_network_policy: whether to disable NetworkPolicy enforcement.
      enable_node_local_dns: whether to enable NodeLocalDNS cache.
      enable_gcepd_csi_driver: whether to enable GcePersistentDiskCsiDriver.
      enable_filestore_csi_driver: wherher to enable GcpFilestoreCsiDriver.
      enable_application_manager: whether to enable ApplicationManager.
      enable_cloud_build: whether to enable CloudBuild.
      enable_backup_restore: whether to enable BackupRestore.
      enable_gcsfuse_csi_driver: whether to enable GcsFuseCsiDriver.
      enable_stateful_ha: whether to enable StatefulHA addon.
      enable_parallelstore_csi_driver: whether to enable ParallelstoreCsiDriver.
      enable_high_scale_checkpointing: whether to enable HighScaleCheckpointing.
      enable_lustre_csi_driver: whether to enable LustreCsiDriver.
      enable_ray_operator: whether to enable RayOperator.

    Returns:
      An AddonsConfig object that contains the options defining what addons to
      run in the cluster.
    r  r  T)"r   AddonsConfigr   httpLoadBalancingr   horizontalPodAutoscalingr   kubernetesDashboardNetworkPolicyConfignetworkPolicyConfigDnsCacheConfigdnsCacheConfigr  r  r  r  
KalmConfig
kalmConfigCloudBuildConfigcloudBuildConfigr  r  r  r  r  r  r  r  r  r  r  r  r  r  )r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   s                     ra   r  zAPIAdapter._AddonsConfig  sK   V ]]'')F"!%!@!@" "A "f (,(N(N )O )f% $#'==#D#D$ $E $f  )#'==#D#D) $E $f  ("mm::' ; f 
--
8
8
8
F - #
--
3
3D
3
A ( "--2242@f $ > >t > Lf$(MM$F$F %G %f! !&*mm&J&J 'K 'f#  $ > >t > Lf&
--
4
4T
4
B ) '
--
4
4T
4
B )  
--
-
-d
-
; " !%!@!@!@!NfMrb   c                    |j                   sy| j                  j                  j                  }g }|j                   D ]  }t	        |d         }|d   j                         }|d   j                         dk(  r|j                  }nO|d   j                         dk(  r|j                  }n,t        j                  t        j                  |d               |j                  | j                  j                  |||              ||_        y)	z(Add LocalSSDVolumeConfigs to nodeConfig.NrL  r  rl   fsblock)
err_format)rL  r  rl   )r   r   LocalSsdVolumeConfigFormatValueValuesEnumrU  r,  FSBLOCKr	   r;  $LOCAL_SSD_INCORRECT_FORMAT_ERROR_MSGrl   r   localSsdVolumeConfigs)	r  r   r   format_enumlocal_ssd_volume_configs_listrC  rL  ssd_type
ssd_formats	            ra   r  z0APIAdapter._AddLocalSSDVolumeConfigsToNodeConfig  s    ++--44JJK$&!22&/"e%%'h					!T	) ^^
(!!#w. &&
jj077!(+ 8 
 	

 $**
--
,
, -  3$ )FK%rb   c                     |j                   y |j                   }d }d|v r|d   }| j                  j                  |      |_        y )Nzlocal-ssd-countr  )r   r   EphemeralStorageConfigephemeralStorageConfigr  r   r   rC  rL  s        ra   r   z+APIAdapter._AddEphemeralStorageToNodeConfig9  sT      (&&FEF"&'e)-)M)M *N *K&rb   c                    |j                   |j                  y|j                   A|j                  5| j                  j                  t	        |j                              |_        y|j                   }d}d|v r|d   }d}|j                  t	        |j                        }| j                  j                  ||      |_        y)z1Add EphemeralStorageLocalSsdConfig to nodeConfig.N)dataCacheCountrL  )r  r  )r   r   r   EphemeralStorageLocalSsdConfigrU  ephemeralStorageLocalSsdConfig)r  r   r   rC  rL  dcounts         ra   r  z3APIAdapter._AddEphemeralStorageLocalSsdToNodeConfigD  s     	++3$$,++3$$0 --
6
6 !9!9: 7  0
 00FE&WoeF+7++,f44 	5 	
 .rb   c                     |j                   y |j                   }d }d|v r|d   }| j                  j                  |      |_        y )NrL  r  )r   r   LocalNvmeSsdBlockConfiglocalNvmeSsdBlockConfigr  s        ra   r  z,APIAdapter._AddLocalNvmeSsdBlockToNodeConfigd  sR    ##+))FE&Woe*.--*O*O +P +K'rb   c                 @    |j                   sy |j                   |_        y r   )rA  enableConfidentialStorager  r   r   s      ra   r  z4APIAdapter._AddEnableConfidentialStorageToNodeConfigo  s    ..,3,O,OK)rb   c                 @    |j                   sy |j                   |_        y r   )rB  storagePoolsr  s      ra   r  z'APIAdapter._AddStoragePoolsToNodeConfigt  s      &44Krb   c                     |j                   W|j                   dk(  r|j                  j                  |_        y|j                   dk(  r|j                  j                  |_        yyy)z)Add localSsdEncryptionMode to nodeConfig.NEPHEMERAL_KEY_ENCRYPTIONSTANDARD_ENCRYPTION)rC  %LocalSsdEncryptionModeValueValuesEnumr  localSsdEncryptionModer  r  s      ra   r  z1APIAdapter._AddLocalSsdEncryptionModeToNodeConfigy  sg    ((4		*	*.H	H==VV 	* ,,0EE==QQ 	* F 5rb   c                    |j                   yg }| j                  j                  j                  }t	        t        j                  |j                               D ]  \  }}|j                  d      }t        |      dk7  r*t        j                  t        j                  ||            |d   }|d   }|dk(  r|j                  }	nP|dk(  r|j                  }	n>|d	k(  r|j                  }	n,t        j                  t         j                  |d   
            |j#                  | j                  j                  |||	              ||_        y)zAdd nodeTaints to nodeConfig.N:r]  r}  r   rF  
NoSchedulePreferNoSchedule	NoExecuteeffectr~  r  r  )r   r   	NodeTaintEffectValueValuesEnumr   rr  rs  r  rK  r	   r;  %NODE_TAINT_INCORRECT_FORMAT_ERROR_MSGrl   NO_SCHEDULEPREFER_NO_SCHEDULE
NO_EXECUTE%NODE_TAINT_INCORRECT_EFFECT_ERROR_MSGr   taints)
r  r   r   r  effect_enumr~  r  strstaint_effectr  s
             ra   r
  z%APIAdapter._AddNodeTaintsToNodeConfig  s0   "F--))??KS]]7+>+>?@
U[[d	Tajj188S8N
 	
 1ge!Wl		%((--//;&''jj188Q8H
 	
 mm
--
!
!cv
!
F% A,  Krb   c                    |y | j                   j                  j                         }g }t        j                  |      D ]'  \  }}|j                  |j                  ||             ) ||_        | j                   j                  |      S )Nr}  r  )r   ResourceManagerTagsr  rr  rs  r   r  r  )r  r   r  ru  r~  r  s         ra   rh  zAPIAdapter._ResourceManagerTags  sz    |mm//99;GEmmD)
Ull7--#U-CD *#(G ==,,',::rb   c                 D   |j                   |j                   }|dk(  r6|j                  |j                  j                  j                        |_        y|dk(  r6|j                  |j                  j                  j
                        |_        yt        j                  t        j                  |            |j                  \|j                  }|dk(  r6|j                  |j                  j                  j                        |_        y|dk(  r6|j                  |j                  j                  j
                        |_        y|dk(  r6|j                  |j                  j                  j                        |_        y|dk(  r6|j                  |j                  j                  j                        |_        y|d	k(  r6|j                  |j                  j                  j                        |_        yt        j                  t        j                  |            y)
z$Adds WorkLoadMetadata to NodeConfig.NGCE_METADATAr  GKE_METADATA)optionSECURE)nodeMetadataEXPOSEDGKE_METADATA_SERVER)r   WorkloadMetadataConfigr  r  workloadMetadataConfigr  r	   r;  #UNKNOWN_WORKLOAD_METADATA_ERROR_MSGrl   r   NodeMetadataValueValuesEnumr  EXPOSEr  )r  r   r   r   r  s        ra   r  z+APIAdapter._AddWorkloadMetadataToNodeConfig  s     ,((f	>	!-5-L-L00DDQQ .M .
* ^#-5-L-L00DDQQ .M .
* jj/66f6E
 	
 
	,	,	822f	>	!-5-L-L00DDQQ .M .
* ^#-5-L-L00DDQQ .M .
* X-5-L-L!88TT[[ .M .
* Y-5-L-L!88TT[[ .M .
* **-5-L-L!88TThh .M .
* jj/66f6E
 	
1 
9rb   c                     | j                   j                  |j                  | j                   j                  j                  j                        S )z%Returns a SetNetworkPolicy operation.r  )r   r(   r  r  r  )r  r   s     ra   SetNetworkPolicyCommonz!APIAdapter.SetNetworkPolicyCommon  s>    ==&&,,DDKK '  rb   c                 B   | j                  |      }| j                  j                  t        |j                  |j
                  |j                        |      }| j                  | j                  j                  j                  |      j                  |j
                        S )N)r  r  )r  r   SetNetworkPolicyRequestr!  r  r  r  r  r  r  SetNetworkPolicyr  )r  r'  r   netpolr  s        ra   r  zAPIAdapter.SetNetworkPolicy  s    ((1F
--
/
/#!!;#3#3[5J5J
 	 0 C //@@EJJ rb   c                    | j                   j                  |j                  |j                        }|j                  t
        j                  k(  r.| j                   j                  j                  j                  }||fS |j                  t
        j                  k(  r.| j                   j                  j                  j                  }||fS | j                   j                  j                  j                  }||fS )zReturns a SetMasterAuth action.r  )r   r;  r  r   r  r  r  SetMasterAuthRequestActionValueValuesEnumr  r  )r  r   r>  r  s       ra   SetMasterAuthCommonzAPIAdapter.SetMasterAuthCommon  s    ]]%%!!G,<,< & F ~~-:::
--
,
,
B
B
O
O  6> 
/AA	A
--
,
,
B
B
T
T  6> --
,
,
B
B
O
O  6>rb   c                 N   | j                  |      \  }}| j                  j                  t        |j                  |j
                  |j                        ||      }| j                  j                  j                  |      }| j                  |j                  |j
                        S )N)r  r  r>  )r  r   r  r!  r  r  r  r  r  SetMasterAuthr  r  )r  r'  r   r>  r  r  r4  s          ra   r  zAPIAdapter.SetMasterAuth  s    --g6NFF
--
,
,#!!;#3#3[5J5J
  - C 
	0	0	>	>s	CBrww(8(899rb   c           	          | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )N)r  rotateCredentials)r  r  StartIpRotationr   StartIPRotationRequestr!  r  r  r  r  r  )r  r'  rotate_credentialsrx  s       ra   r  zAPIAdapter.StartIpRotation  sx    77GG,,'%%{'7'79N9N 1	 	- 	
I y~~{/?/?@@rb   c           	         | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    }| j                  |j                  |j                        S rS  )r  r  CompleteIpRotationr   CompleteIPRotationRequestr!  r  r  r  r  r  )r  r'  rx  s      ra   r  zAPIAdapter.CompleteIpRotation  ss    77JJ//'%%{'7'79N9N 	0 	
I y~~{/?/?@@rb   c                 $   | j                   j                  t        |j                  |j                  |j
                        |      }| j                  j                  j                  |      }| j                  |j                  |j                        S )zOGiven a policy, sends a SetMaintenancePolicy request and returns the operation.)r  r  )r   SetMaintenancePolicyRequestr!  r  r  r  r  r  SetMaintenancePolicyr  r  )r  r'  r  r  rx  s        ra   _SendMaintenancePolicyRequestz(APIAdapter._SendMaintenancePolicyRequest"  s    
--
3
3#!!;#3#3[5J5J
 !	 4 C 77LLI y~~{/?/?@@rb   c                 l   |dk(  rd}n| j                   j                  |      }|| j                   j                         }|j                  | j                   j	                         |_        t        |j                  d      rd|j                  _        ||j                  _        | j                  ||      S )z0Sets the daily maintenance window for a cluster.NoneNr  r  )	r   r  r  r  r  hasattrr  r  r  )r  r'  existing_policyr   daily_windows        ra   SetDailyMaintenanceWindowz$APIAdapter.SetDailyMaintenanceWindow/  s     V#l]]99& : l 779o%#}}>>@o %%'89/3o,4@O1--k?KKrb   c           	         	 | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    }| j                  |j                  |j                        S # t        j                  $ r@}t        j                  |t        j                         }| j#                  ||       Y d}~yd}~ww xY w)aS  Delete a running cluster.

    Args:
      cluster_ref: cluster Resource to describe

    Returns:
      Cluster message.
    Raises:
      Error: if cluster cannot be found or caller is missing permissions. Will
        attempt to find similar clusters in other zones for a more useful error
        if the user has list permissions.
    r  N)r  r  Deleter   /ContainerProjectsLocationsClustersDeleteRequestr!  r  r  r  r  r  r\   r"  r   r#  r	   r$  r%  )r  r'  rx  r(  r)  s        ra   DeleteClusterzAPIAdapter.DeleteClusterI  s    :++99@@
--
G
G)'')9)9;;P;P H i   1A1ABB00 :**5$2H2HIi
!!+y99:s   BB C##6CC#c                     |sd}| j                   j                  t        ||            }| j                  j                  j                  |      S Nr_  r  )r   -ContainerProjectsLocationsClustersListRequestr  r  r  Listr  r  r  r  s       ra   r=  zAPIAdapter.ListClustersd  sK    h
--
E
Ew1 F C ;;2277<<rb   c           	         | j                   j                         }|j                  r|j                  |_        |j                  r|j                  |_        |j                  r|j                  |_        |j                  r|j                  |_	        |j                  s|j                  r| j                  |      |_        | j                  ||       | j                   j                         }|j                   r|j                   |_        |j"                  r|j"                  |_        |j&                  r|j&                  |_        |j                   s|j"                  s|j&                  r||_        t-        ||       |j.                  r|j.                  |_        | j3                  ||       | j5                  ||       | j7                  ||       | j9                  ||       | j;                  ||       | j=                  ||       |j>                  r|j>                  |_         |jB                  r|jB                  |_"        |jF                  r|jF                  |_#        ng |_#        | jI                  ||       tK        ||       tM        ||       tO        ||       | jQ                  ||       |jR                  "|jR                  }| jU                  |      |_+        |jX                  r|jX                  |_,        |jZ                  r|jZ                  |_-        |j\                  |j\                  |_/        |j`                  |j`                  |_1        |jd                  -| j                   jg                  |jd                        }||_4        |jj                  -| j                   jg                  |jj                        }||_4        |jl                  -| j                   jo                  |jl                        }||_6        |jp                  |jp                  |_9        |jt                  |jt                  |_;        |jx                  r-| j                   j{                  |jx                        }||_>        |j~                  D| j                   j{                  |jx                  t        || j                   d            }||_>        |j                  -| j                   j                  |j                        }	|	|_C        |j                  rt        || j                         |_F        |j                  `| j                   j                         }
| j                   j                  t        | j                   |j                              |
_K        |
|_L        |j                  s|j                  r t        || j                   t              |_Q        |j                  T| j                   j                         |_T        t        j                  |j                  |j                  | j                          | j                  ||| j                          t        ||| j                          t        ||| j                          t        ||| j                          t        ||| j                          t        ||| j                          |j                  2|j                  &t        |j                  |j                        |_^        n|j                  d|_^        | j                   j                  |j                  |j                  ||j                  | j                  |            }|j                  s|j                  r| j                   j                         |_g        |j                  r|j                  |j                  _h        |j                  |j                  _j        |j                  |j                  _l        |j                  |j                  _n        |j                  |j                  _p        |j                  /t        | j                   |j                        |j                  _s        |j                  rK| j                   j                         |_v        d|j                  _h        |j                  |j                  _x        |j                  r|j                  |j                  _y        |j                  +| j                   j                  |j                  	      |_|        |j                  sL|j                  s@|j                  4|j                   '|j                  |j                  |j                  :| j                   j	                         |_        | j                  d||
      |_        |j                  t        |j                        |_        |j                  9t        j                  ||j                  |j                  | j                          |j                  J|j                   | j                   j                         |_        |j                  |j                  _        | j!                  |      |_        |j$                  r"| j'                  |      |j"                  _        |j*                  dk(  s|j,                   | j                   j/                         |_        |j*                  dk(  r=| j                   j.                  j2                  j4                  |j0                  _        |j,                  |j,                  |j0                  _        |j:                  |j:                  dk(  rN| j                   j=                  | j                   j<                  j>                  j@                        |_        n]|j:                  dk(  rM| j                   j=                  | j                   j<                  j>                  jD                        |_        |j                  rI|j0                   | j                   j/                         |_        |j                  |j0                  _        |jH                  =| j                   jK                         |_        |jH                  |jL                  _h        |jN                  1t        jP                  |jN                  | j                         |_        |jT                  J|jR                   | j                   jW                         |_        |jT                  |jR                  _        |jZ                  | j                   j\                  j^                  }d|j`                  i}g |_        |jZ                  D ]c  }|d   }d}d|v r|d   |v r	||d      }n|jd                  }|jb                  jg                  | j                   j]                  ||             e |S )z#Returns a CreateNodePool operation.Nr  Tfor_node_poolr  r  r\  r/  r  )r  rU   r  r  r  CONTAINER_IMAGE_CACHEz
disk-imager  )	diskImager  )r   r  r  r  r  r7   r   r8   r   r9   r  r  r  r  r  r'  r   r   r(  r   r)  r*  r   r   r  r  r   r  r  r  r  rA  r  r   r6   r   r  r	  r  r  r
  ry  rh  ri  r   r   r   r-   r  	nodeGrouprK  ra  rb  rL  r8  r  r   r  r   r  r?  rR  rS  r@  rT  r  
FastSocket
fastSocketrX  rj  rk  rh  r  r  r  r  rq  rv  r  r  NODEPOOLr  rx  rc  rd  r	   re  r  r  r  r  _AddSandboxConfigToNodeConfig!_AddWindowsNodeConfigToNodeConfigr  r   TpuTopologyToNumNodesr7  
nodePoolIdr   r8  r   r$  r9  rK  r  r   r2  r   r3  r   r4  r   r5  r   r:  r;  r  BestEffortProvisioningbestEffortProvisioningr  minProvisionNodesautoprovisionedr   r  r=  r  r  r"  r#  r  r  r  r>  r.   UpdateUpgradeSettingsr   r   r  r  r  rl  r  r]  r^  _GetNetworkConfigr  rk  _GetNetworkPerformanceConfigr  r   r   rA  rB  r  rU   r  rC  r!  r  r  r  r  r  tpuTopologyr   rD  rE  r  (LoadSoleTenantConfigFromNodeAffinityYamlsoleTenantConfigr  SoleTenantConfigminNodeCpusr  SecondaryBootDiskr  r  secondaryBootDisksMODE_UNSPECIFIEDr   )r  node_pool_refr   r   r+  r   gcfs_configr8  confidential_nodesfast_socketrG  r  	mode_enummode_mapdisk_config
disk_imager  s                    ra   CreateNodePoolCommonzAPIAdapter.CreateNodePoolCommonl  s   --**,K ' 4 4k&33k$..k%00k**33!55g>k%%g{;MM335M}}#MMm#*#8#8m ")"6"6m}}--1E1E$1k!#G[9")"9"9k..{GD))+w?11+wG**;@%%k7;//WE**

-
- +   #*#<#<k || kk  +6['2;0{G4##K9$$0**d(,(A(A$(Gk% ' 3 3k|| k+#*#;#;k %%00k&MM,,W5H5H,Ik*k%%1MM,,00 - k  +k}} mm&&w}}&=ek+#*#;#;k %%00k((==::33 ;  '9k#%%1==::33#Ft}}D$ ;  '9k#!!-MM,,W5O5O,Pk*k##&;
4=='k# *}}::<n%)]]%G%G-mmW44 &H &n"
 #1k((G,M,M*C
4==(+k' **6%)]]%C%C%Ek"
''

&
&

-
-
-- 	))+wN#K$--H*;O'WdmmL!+wF%k7DMMJ 	(w/@/@/H/


 4 4g 
			"g==!!%% **$$**73 " D !!W%D%D::<d!!!(!;!;d&-&7&7d#&-&7&7d#+2+B+Bd(+2+B+Bd(		 	 	,*FMM722+
' ++$(MM$H$H$Jd!,0d!!)

%
% !!3 &&)0)H)Hd&  ,#}}>> 22  ?  d
 	$$,,$$0**6**6,,8**6!]]::<d!77
d 8 d )g445dn&&2
##


)
)

7
7
--	 44@		"	"	*$(MM$C$C$E!

7
7 B //8D))

+
+G
4 1
 	)+##/!]]::<d*
--
'
'
;
;
C
C  +(/(@(@d%!!-		#	#v	-&*mm&C&C--NNSS 'D '
#
 %%/&*mm&C&C--NNSS 'D '
# 				%#}}<<>)0)=)=d&))5 $ @ @ Bd(/(J(Jd% --9

7
744dmm "
 ((4		%	%	-'+}}'E'E'G$

+
+ "". ##/--11EEi
!9#B#Bh (*k$ 55+ .
 [  H,K/0D--D&&--MM++$ , 	
 6$ Krb   c                 H   | j                  ||      }| j                  j                  |t        |j                  |j
                  |j                              }| j                  j                  j                  |      }| j                  |j                  |j
                        S )z=CreateNodePool creates a node pool and returns the operation.nodePoolr  r  r   CreateNodePoolRequestr!  r  r  r  r  %projects_locations_clusters_nodePoolsr  r  r  r  r  r   r  r  rx  s         ra   CreateNodePoolzAPIAdapter.CreateNodePool  s    $$]G<D
--
-
-%##]%7%79P9P
 . C AAHHMIy~~}/A/ABBrb   c                     | j                   j                  t        |j                  |j                  |j
                              }| j                  j                  j                  |      S )Nr  )	r   6ContainerProjectsLocationsClustersNodePoolsListRequestr!  r  r  r  r  r  r  )r  r'  r  s      ra   ListNodePoolszAPIAdapter.ListNodePools  sZ    
--
N
N%!!;#3#3[5J5J
 O C
 ;;<<AA#FFrb   c                     | j                   j                  t        |j                  |j                  |j
                  |j                              }| j                  j                  j                  |      S rS  )
r   5ContainerProjectsLocationsClustersNodePoolsGetRequestProjectLocationClusterNodePoolr  r  r  r  r  r  r  r  r  r  s      ra   GetNodePoolzAPIAdapter.GetNodePool  se    
--
M
M+####$$	
 N C ;;<<@@EErb   c                     | j                   j                  t        |j                  |j                  |j
                  |j                              }| j                  j                  j                  |      S )zGet node pool upgrade info.

    Args:
      node_pool_ref: NodePool Resource to get upgrade info for.

    Returns:
      NodePool Upgrade Info message.
    r  )
r   JContainerProjectsLocationsClustersNodePoolsFetchNodePoolUpgradeInfoRequestr#  r  r  r  r  r  r  FetchNodePoolUpgradeInfor$  s      ra   GetNodePoolUpgradeInfoz!APIAdapter.GetNodePoolUpgradeInfo  sl     --
b
b+####$$	
 c C ;;<<UU rb   c                     | j                  |      }|j                  }|| j                  j                         }|j                  |j                  |_        |j                  |j                  |_        |S )zUpdates node pool's node management configuration.

    Args:
      node_pool_ref: node pool Resource to update.
      options: node pool update options

    Returns:
      Updated node management configuration.
    )r%  r1   r   r	  r   r3   r   r2   )r  r  r   r  node_managements        ra   UpdateNodePoolNodeManagementz'APIAdapter.UpdateNodePoolNodeManagement  so     M*DooO446o  ,#*#<#<o !!-$+$>$>o!rb   c                 &   | j                  |      }|j                  }|| j                  j                         }|j                  o|j                  |_        |j
                  sRd|_        d|_        d|_        d|_	        d|_
        | j                  j                  j                  j                  |_        |j                  +|j                  |_
        |j                  rd|_        d|_        |j                  |j                  |_        |j                   |j                   |_        |j"                  |j"                  |_	        |j$                  |j$                  |_        |j&                  %t)        | j                  |j&                        |_        |S )zUpdate node pool's autoscaling configuration.

    Args:
      node_pool_ref: node pool Resource to update.
      options: node pool update options

    Returns:
      Updated autoscaling configuration for the node pool.
    r   F)r%  rK  r   r9  r   r  r2  r3  r4  r5  r  LocationPolicyValueValuesEnumLOCATION_POLICY_UNSPECIFIEDr;  r$  r   r   r   r   r   r:  )r  r  r   r  rK  s        ra   UpdateNodePoolAutoscalingz$APIAdapter.UpdateNodePoolAutoscaling  sp    M*D""KMM557k!!-#66k  #$ #$ ()%()%&+#MM--KKgg 	" &&2$+$C$Ck!		$	$#$ ()%$!(!2!2k$!(!2!2k*&-&=&=k#*&-&=&=k#*#?
--00$k  rb   c                    |j                   !|j                  t        j                  d      |j                  xs | j
                  j                         }|j                  |j                  |_        |j                   |j                  xs | j
                  j                         }d|j                   v r#d|j                   v rt        j                  d      d|_        d|_        d|j                   v r|j                   d   |_        n"d|j                   v r|j                   d   |_        d|j                   v r|j                   d   |_        ||_	        d|_        |S |j                  _|j                  xs | j
                  j                         }d|_        d|j                  v r|j                  d   |_        ||_        d|_	        |S )z5Update blue green settings field in upgrade_settings.NzbBlueGreenSettings must contain only one of: --standard-rollout-policy, --autoscaled-rollout-policyr  r   zOStandardRolloutPolicy must contain only one of: batch-node-count, batch-percentr!  zwait-for-drain-duration)r  r  r	   r;  r  r   r"  r  r#  r$  r%  r'  r&  r(  autoscaledRolloutPolicyAutoscaledRolloutPolicywaitForDrainDuration)r  r  r   r)  r  r  s         ra   UpdateBlueGreenSettingsz"APIAdapter.UpdateBlueGreenSettings  s    	''3--9JJD 
 	**Odmm.M.M.O  &&2181P1P.&&2

3
3 3]]002   ? ?
?!@!@@jj
 	

 04,04-	w>>	>++,>? 	 . g===++O< 	 / 
'"A"A	A++,AB 	 1 3J/481  
	*	*	6

5
5 5]]224  
 8<4	"g&G&G	G--.GH 	"6 5N126/rb   c                    || j                  |      }|j                  r!|j                  rt        j                  d      |j
                  }|| j                  j                         }|j                  |j                  |_	        |j                  |j                  |_        |j                  r/| j                  j                  j                  j                  |_        |j                  r/| j                  j                  j                  j                  |_        |j                   |j"                  |j$                  | j'                  ||      |_        |S )z%Updates node pool's upgrade settings.z]UpgradeSettings must contain only one of: --enable-surge-upgrade, --enable-blue-green-upgrade)r%  r  r  r	   r;  r.   r   r>  r"  r?  r#  r@  r  r  r  r  r  r  r  r5  r  )r  r  r   r  r  s        ra   r  z APIAdapter.UpdateUpgradeSettingsV  s8   |m,d##(I(IJJ) 
 ++668  ,")";";&&2(/(G(G%##
--
'
'
?
?
E
E  ((
--
'
'
?
?
J
J  	''3**6,,8+/+G+G
G,( rb   c                 
   | j                   j                  t        |j                  |j                  |j
                  |j                              }| j                  ||       |j                  |j                  | j                  ||| j                          |S |j                  t        |j                        |_        |S |j                  sH|j                  s<|j                   0|j"                  $|j$                  |j&                  |j(                  | j+                  ||      |_        |S |j.                  |j0                  | j                   j3                         }|j.                  6t5        j6                  ||j.                  |j0                  | j                          |j0                  F|j8                  | j                   j;                         |_        |j0                  |j8                  _        |j>                  |_        |j8                  |_        |S |j@                  N| j                   jC                         }t5        jD                  ||j@                  | j                          ||_#        |S |jH                  | j                   jK                         }|jM                         }g }tO        jP                  |jH                        D ]'  \  }	}
|jS                  |jU                  |	|
             ) ||_+        ||_$        ||_,        |S |jZ                  | j                   j]                         }|jM                         }g }tO        jP                  |jZ                        D ]'  \  }	}
|jS                  |jU                  |	|
             ) ||_+        ||_$        ||_$        |S |j^                  ^g }| j                   j`                  jb                  }t        tO        jP                  |j^                              D ]  \  }	}
|
je                  d      }tg        |      dk7  r*t5        jh                  tj        jm                  |	|
            |d   }
|d   }|dk(  r|jn                  }nP|dk(  r|jp                  }n>|d	k(  r|jr                  }n,t5        jh                  tt        jm                  |d   
            |jS                  | j                   ja                  |	|
|              | j                   jw                         }||_<        ||_<        |S |jz                  4| j                   j}                         }|jz                  |_=        ||_=        |S |j~                  4| j                   j                         }|j~                  |_A        ||_B        |S |j                  /| j                   j                  |j                        }||_E        |S |j                  /| j                   j                  |j                        }||_F        |S |j                  |j                  |_I        |S |j                  |j                  |_K        |S |j                  /| j                   j                  |j                        }||_E        |S |j                  9| j                   j                         }| j                  |      |_O        ||_B        |S |j                  /| j                   j                  |j                        }||_R        |S |j                  ;| j                   j                  t        || j                   d            }||_R        |S |j                  /| j                   j                  |j                        }||_W        |S |j                  b| j                   j                         }| j                   j                  t        | j                   |j                              |_\        ||_]        |S |j                  | j                   j                         }|j                  dk(  r0| j                   j                  j                  j                  |_b        n/| j                   j                  j                  j                  |_b        ||_d        |S |j                  $|j                  }| j                  |      |_g        |S |j                  0|j                  $|j                  |j                  |j                  |j                  |_m        |j                  |_n        |j                  |_o        |j                  |j                  [| j                   j                         }|j                  |j                  |_q        |j                  |j                  |_r        ||_s        |S |j                  <| j                   j                         |_v        |j                  |j                  _w        |S |j                  |j                  |_y        |S )zCreates an UpdateNodePoolRequest from the provided options.

    Arguments:
      node_pool_ref: The node pool to act on.
      options: UpdateNodePoolOptions with the user-specified options.

    Returns:

      An UpdateNodePoolRequest.
    r  r}  r  r]  r   rF  r  r  r  r  r  r  Tr  )r  r  ltsc2022)zr   UpdateNodePoolRequestr#  r  r  r  r  r  r   r   r  r   r   r  r  r  r"  r#  r  r  r  r  r.   r  rl  r  r	   r  r  r]  r^  linuxNodeConfigrx  rc  re  rd  r   ResourceLabelsLabelsValuerr  rs  r   r  r  rt  r   
NodeLabelsr   r  r  r  rK  r;  r  rl   r  r  r  r  
NodeTaintsr  r   rf  r   NodeNetworkConfigr  nodeNetworkConfigrK  ra  rb  r8  r  r   r  r   r  rL  rk  r  r  r?  rR  rS  r@  rT  r  r  r  rh  r  r  r  r  rq  r  WindowsNodeConfigOsVersionValueValuesEnumOS_VERSION_LTSC2022	osVersionOS_VERSION_LTSC2019windowsNodeConfigry  rh  ri  r  r   r  r  r  r  r8   r7   r  r  r  r  r   rD  rE  r  rB  r  )r  r  r   update_requestr   containerd_configresource_labelsr   ru  r~  r  r   r  r  r  r  r  r   	node_tagsnetwork_configr  r8  r  r  rG  windows_node_configr   boot_disk_cfgs                               ra   r9  z APIAdapter.UpdateNodePoolRequestz  s	    ]]88+####$$	
 9 N 	  .9 	!!-..:
++
'4==v q 
			+!'(>(>!?nn k 	))''$$0**6**6**6,,8'+'A'A
(n$Z S 	''388DMM,,.k		(	(	4%%++99MM		
 
	6	6	B$$,&*mm&E&E&G+
#99 	!!D
 (3'B'Bn$%0%>%>n"j g 
	,	,	8--88:
''
W@@$-- ):n%\ [ 
	#446o**,fegnn5*#uV..3e.DE 6$)f!%o&5n#J I 
			(MM,,.k&&(feg&9&9:*#uV..3e.DE ;$)f!!k)nx w 
			(fMM++AAks}}W-@-@AB*#u{{3t9>

3::s%:P  QAw<'**&//11&[())&

3::$q':J  	MM##5#H	
% C* MM,,.k!k)nB A 
	!--++-i||in%nz y 
	%	%	1}}668n*1*F*Fn')7n&r q 
			(MM,,W5H5H,Ik"-nl k 
	"mm&&w}}&=e"nf e 
	!	!	-&-&>&>n#b a 
			'!(!3!3n^ ] 
	'	'	3MM,,00 - k #.nT S 
	+	+	7}}668n

+
+G
4 - *8n&H G 
	*	*	6==::33 ;  *<n&~ } 
	'	'	3==::#Ft}}D$ ; 
 *<n&p o 
	#	#	/MM,,W5O5O,Pk"-nj i 
	 	 	,}}::<n%)]]%G%G-mmW44 &H &n"
 &4n"Z Y 
	#	#	/ MM;;=		#	#z	1MM++DDXX 	%
 MM++DDXX 	% *=n&D C 
	&	&	2**d+/+D+DT+Jn(> ; 	((+##/))5#*#7#7n  ' 1 1n")"6"6n 
"
"
.++7..0##/*1*B*B-
'))5070N0N-
-"/  
	+	+	7*.--*J*J*Ln'

,
, ''/
  
			*$+$9$9n!rb   c           	         |j                         r| j                  ||      }| j                  j                  |j                  |      }| j
                  j                  j                  | j                  j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S |j                         r| j!                  ||      }| j                  j#                  t%        |j                  |j                  |j                  |j                        |      }| j
                  j&                  j)                  |      }n]|j+                         r8| j-                  ||      }| j
                  j&                  j                  |      }nt/        j0                  d      | j                  |j                  |j                        S )zUpdates nodePool on a cluster.ro  rh  r  r1   Unhandled node pool update moder  r0  r   r   r  r  r  rj  rk  r!  r  r  r  r  r  r  r,  SetNodePoolManagementRequestr#  r  SetManagementr  r9  r	   r;  r  r  r   rK  r>  rx  r1   r  s           ra   UpdateNodePoolzAPIAdapter.UpdateNodePoolR  s   ""$22='Jk}}**)44%0 + f ++99@@
--
,
,)))$$))
  - 	i   1C1CDD		+	+	-44]GLjMM66-%%  %%&&	   7 c ++
;
;
I
I#
N  
	(	(	*&&}g>c++CCJJ3OiJJ899y~~}/A/ABBrb   c           
      4   | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                  |j                                    }| j                  |j                  |j                        S rS  )r  r  r  r   8ContainerProjectsLocationsClustersNodePoolsDeleteRequestr#  r  r  r  r  r  r  )r  r  rx  s      ra   DeleteNodePoolzAPIAdapter.DeleteNodePool{  s    AAHHNN/''""''((	 	O 	
	I y~~}/A/ABBrb   c           
      6   | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                  |j                        |            }| j                  |j                  |j                        S )z&Rolls back an upgrade for a node pool.)r  
respectPdb)r  r  Rollbackr   RollbackNodePoolUpgradeRequestr#  r  r  r  r  r  r  )r  r  respect_pdbrx  s       ra   RollbackUpgradezAPIAdapter.RollbackUpgrade  s    AAJJ44/''""''((	 # 	5 	

I y~~}/A/ABBrb   c                     | j                   j                  t        |j                  |j                  |j
                  |j                              }| j                  j                  j                  |      S rS  )
r   AContainerProjectsLocationsClustersNodePoolsCompleteUpgradeRequestr#  r  r  r  r  r  r  CompleteUpgrader$  s      ra   CompleteNodePoolUpgradez"APIAdapter.CompleteNodePoolUpgrade  sj    
--
Y
Y+####$$	
 Z C ;;<<LL rb   c                     | j                   j                  t        |j                  |j                  |j
                              }| j                  j                  j                  |      S rS  )	r   CancelOperationRequestrV  r  r  rW  r  rT  Cancel)r  op_refr  s      ra   CancelOperationzAPIAdapter.CancelOperation  sW    
--
.
.%fkk6+=+=
 / C
 ;;44;;C@@rb   c                 p    |j                   | j                  j                  j                  j                  k(  S r   )statusr   r  StatusValueValuesEnumRUNNINGr  rX   s     ra   	IsRunningzAPIAdapter.IsRunning  s'    >>T]]22HHPPPPrb   c                 p    |j                   | j                  j                  j                  j                  k(  S r   )ri  r   r  rj  DEGRADEDrl  s     ra   
IsDegradedzAPIAdapter.IsDegraded  s)    $--//EENNNrb   c                     |j                   rX|j                   D cg c]  }|j                   }}|j                   D cg c]  }|j                   }}dj                  ||      S t        j
                  S c c}w c c}w )NzCodes: {0}
Messages: {1}.)
conditionscodert  rl   gke_constantsDEFAULT_DEGRADED_WARNING)r  rX   	conditioncodesr   s        ra   GetDegradedWarningzAPIAdapter.GetDegradedWarning  su    /6/A/AB/A)y~~/AeB5<5G5GH5G	)##5GhH*225(CC333	 CHs
   A5A:c                     |sd}| j                   j                  t        ||            }| j                  j                  j                  |      S r  )r   /ContainerProjectsLocationsOperationsListRequestr  r  rT  r  r  s       ra   ListOperationszAPIAdapter.ListOperations  sK    h
--
G
Gw1 H C ;;4499#>>rb   c                 p    |j                   | j                  j                  j                  j                  k(  S r   )ri  r   	Operationrj  DONE)r  rx  s     ra   rm  zAPIAdapter.IsOperationFinished  s+    DMM33IINNNrb   c                     | j                   j                  t        ||            }| j                  j                  j                  |      S rS  )r   0ContainerProjectsLocationsGetServerConfigRequestr  r  projects_locationsGetServerConfigr  s       ra   r  zAPIAdapter.GetServerConfig  sC    
--
H
HWh/ I C ;;))99#>>rb   c                 &   | j                   j                  t        |j                  |j                  |j
                  |      |      }| j                  j                  j                  |      }| j                  |j                  |j                        S )N)r  	nodeCount)r   SetNodePoolSizeRequestr#  r  r  r  r  r  SetSizer  r  )r  r'  rN  sizer  rx  s         ra   ResizeNodePoolzAPIAdapter.ResizeNodePool  s    
--
.
.+!!!!	
  / C AAII#NIy~~{/?/?@@rb   c                     |j                   |j                  y| j                  j                         }|j                   |_        |j                  |_        |S )ae  Gets a wrapper containing the options for how nodes are managed.

    Args:
      options: node management options

    Returns:
      A NodeManagement object that contains the options indicating how nodes
      are managed. This is currently quite simple, containing only two options.
      However, there are more options planned for node management.
    N)r   r   r   r	  r3   r2   )r  r   r+  s      ra   r8  zAPIAdapter._GetNodeManagement  sR       (W-G-G-Omm224O!(!:!:O")"<"<Orb   c                 n   |j                   U|j                  I|j                  =|j                  1|j                  %|j
                  |j                  |j                  y| j                  j                         }|j                   |j                   |_
        |j                  |j                  D ]/  }|dvst        j                  t        j                  |             d|_        |j                  j!                  dd      |_
        |j                  j!                  dd      |_        |j                  |j                  |_        |j                  +| j                  j'                  |j                        |_        |j
                  ag |_        |j
                  D ]K  }| j                  j-                         }|d   |_        |d	   |_        |j*                  j3                  |       M |j                  g |_        |j                  D ]  }| j                  j7                         }|j!                  d	d      |_        |d
   |_        | j                  j;                  |j!                  dd            |_        |j4                  j3                  |        |j                  |j                  |_        |S )zGets a wrapper containing the network config for the node pool.

    Args:
      options: Network config options

    Returns:
      A NetworkConfig object that contains the options for how the network
      for the nodepool needs to be configured.
    Nrx  ry  Tr  r   r  r   r   r  zmax-pods-per-noder  ) r  r  r   rk  rY  r  r  r  r   r?  podRanger	   r;  &CREATE_POD_RANGE_INVALID_KEY_ERROR_MSGrl   createPodRanger   podIpv4CidrBlockr  r  r  additionalNodeNetworkConfigsAdditionalNodeNetworkConfigr   r   r   additionalPodNetworkConfigsAdditionalPodNetworkConfigsecondaryPodRanger  r  acceleratorNetworkProfile)r  r   rK  r~  node_network_optionnode_network_config_msgpod_network_optionpod_network_config_msgs           ra   r  zAPIAdapter._GetNetworkConfig  s    	&))1((0..622:++3**2//7]]446N) ' 6 6n$$0..#''

4;;;D  /
 '+n# ' = = A A&$ On(/(E(E(I(I
4)n% ##/*1*F*Fn'--9
--
2
2<< 3  / &&246n1!(!@!@
"&--"K"K"M*=i*H'-@-N*33::#	
	 "A %%135n0 ' > >
!%!I!I!K,>,B,B$-
) 4F4
0 150O0O-112EtL 1P 1
- 	2299"	
 !? **6

-
- . rb   c                     |j                   }| j                  j                         }|D ]O  }|j                  dd      j	                         }|s&| j                  j                  j                  |      |_        Q |S )z6Get NetworkPerformanceConfig message for the instance.r  rD  )rk  r   NetworkPerformanceConfigr   r  r  r  r  s         ra   r  z'APIAdapter._GetNetworkPerformanceConfig>  sy      ::==AAC#::;R@FFHj	8<8^8^  9G  9G9
5 $  rb   c                    d}	 | j                  |      }| j                  j                  j                         }g }t        t        j                  |            D ]'  \  }}|j                  |j                  ||             ) ||_        ||j"                  fS # t        j                  $ r Y t        j                  $ r)}t	        j
                  |t        j                        d}~ww xY w)zUpdate labels on a cluster.

    Args:
      cluster_ref: cluster to update.
      update_labels: labels to set.

    Returns:
      Operation ref for label set operation.
    Nr}  )r*  r\   r"  r]   r   r#  r	   r$  r   SetLabelsRequestrq  r   rr  rs  r   r  r  labelFingerprint)	r  r'  update_labelsclusr(  r   ru  r  r  s	            ra   UpdateLabelsCommonzAPIAdapter.UpdateLabelsCommonM  s     DD__[)d ]]++??AFEs}}]341ll6,,!,<= 5"'F4(((( 00 
(( D$$UD,B,BCCDs   B C(-C(?$C##C(c           	      L   | j                  ||      \  }}| j                  j                  j                  | j                  j                  t        |j                  |j                  |j                        ||            }| j                  |j                  |j                        S )zUpdates labels for a cluster.r  rt  r  )r  r  r  SetResourceLabelsr   r  r!  r  r  r  r  r  )r  r'  r  r   fingerprintrx  s         ra   UpdateLabelszAPIAdapter.UpdateLabelsf      11+}MFK77II&&'%%{'7'79N9N "( 	' 	
I y~~{/?/?@@rb   c                    d}	 | j                  |      }i }|j                  r=|j                  j                  D ]$  }t        |j                        ||j                  <   & |s3t        j                  t        j                  |j                               |D ]  }	 |j#                  |        | j(                  j*                  j-                         }t/        t1        j2                  |            D ]1  \  }}	|j                  j5                  |j7                  ||	             3 ||j8                  fS # t        j                  $ r Y 3t        j                  $ r)}t	        j
                  |t        j                        d}~ww xY w# t$        $ r5 t        j                  t&        j                  |j                   |            w xY w)zRemoves labels from a cluster.

    Args:
      cluster_ref: cluster to update.
      remove_labels: labels to remove.

    Returns:
      Operation ref for label set operation.
    N)rX   rE  r}  )r*  r\   r"  r]   r   r#  r	   r$  rt  r  r,  r  r~  r;  NO_LABELS_ON_CLUSTER_ERROR_MSGrl   r  r3  r4  NO_SUCH_LABEL_ERROR_MSGr   r  rq  r   rr  rs  r   r  r  )
r  r'  remove_labelsr  r(  clus_labelsitemr  r   r  s
             ra   RemoveLabelsCommonzAPIAdapter.RemoveLabelsCommont  s    DD__[)d K%%::$ #DJJDHH ; JJ5<<TYY<OPP
  ]]++??AFs}}[121!!((

#
#
#
3 3 4((((9 00 
(( D$$UD,B,BCCD  
jj#**4991*E
 	

s)   D2 F2FF$E>>F>Gc           	      L   | j                  ||      \  }}| j                  j                  j                  | j                  j                  t        |j                  |j                  |j                        ||            }| j                  |j                  |j                        S )zRemoves labels from a cluster.r  )r  r  r  r  r   r  r!  r  r  r  r  r  )r  r'  r  r   r  rx  s         ra   RemoveLabelszAPIAdapter.RemoveLabels  r  rb   c                     t        d      NzGetIamPolicy is not overriddenNotImplementedErrorr{  s     ra   GetIamPolicyzAPIAdapter.GetIamPolicy      
>
??rb   c                     t        d      r  r  r{  s     ra   SetIamPolicyzAPIAdapter.SetIamPolicy  r  rb   c                    | j                   j                  | j                   j                  |j                         |j                               |      }|| j                   j	                         }|j
                  | j                   j                         |_        d|j
                  _        ||j
                  _        | j                  ||      S )a  Sets a recurring maintenance window as the maintenance policy for a cluster.

    Args:
      cluster_ref: The cluster to update.
      existing_policy: The existing maintenance policy, if any.
      window_start: Start time of the window as a datetime.datetime.
      window_end: End time of the window as a datetime.datetime.
      window_recurrence: RRULE str defining how the window will recur.

    Returns:
      The operation from this cluster update.
    r  r  N)
r   r  r   r  r  r  r  r  r  r  )r  r'  r  r  r  window_recurrencerecurring_windows          ra   SetRecurringMaintenanceWindowz(APIAdapter.SetRecurringMaintenanceWindow  s    ( }}88}}''",,.
8L8L8N ( 
 %	 9  779o%#}}>>@o48O1-=O*--k?KKrb   c                    |8|j                   ,|j                   j                  /|j                   j                  t        j                  t
              d|j                   _        d|j                   _        | j                  ||      S )z2Removes the recurring or daily maintenance policy.N)r  r  r  r	   r;  ri  r  )r  r'  r  s      ra   RemoveMaintenanceWindowz"APIAdapter.RemoveMaintenanceWindow  s{     	!!)""99A&&66> JJ23348O1-1O*--k?KKrb   c                 n   | j                   j                  j                         }|8| j                   j                  | j                   j                  |            }|S |j                  #| j                   j                  |      |_        |S |j                  j
                  ||j                  _        |S )af  Given a maintenance policy (can be None), return a normalized form.

    This makes it easier to add and remove blackouts because the blackouts
    list will definitely exist.

    Args:
      policy: The policy to normalize.

    Returns:
      The modified policy (note: modifies in place, but there might not have
      even been an existing policy).
    )maintenanceExclusionsr  )r   r  MaintenanceExclusionsValuer  r  r  )r  r  
empty_excls      ra   (_NormalizeMaintenanceExclusionsForPolicyz3APIAdapter._NormalizeMaintenanceExclusionsForPolicy  s     00KKMJ~}}..00$. 1  / f M 
	 mm55 * 6 fm
 M 
	,	,	4,6fmm)Mrb   c                 |    |j                   j                  j                  D cg c]  }|j                   c}S c c}w )z>Returns a list of maintenance exclusion names from the policy.)r  r  r  r~  )r  maintenance_policyrS  s      ra   _GetMaintenanceExclusionNamesz(APIAdapter._GetMaintenanceExclusionNames  s?     $**@@UUUA 	
U  s   9c                 :   | j                  |      }|#t        j                  t        j                        }|4dt        j                  t        j                        j	                         z   }|| j                  |      v r$t        j                  dj                  |            |j                  j                  }| j                  j                  |j	                         |j	                               }||dk(  rI| j                  j                  | j                  j                  j                  j                        |_        |dk(  rI| j                  j                  | j                  j                  j                  j"                        |_        |dk(  rI| j                  j                  | j                  j                  j                  j$                        |_        |j&                  j)                  |j+                  ||             | j-                  ||      S )	a  Adds a maintenance exclusion to the cluster's maintenance policy.

    Args:
      cluster_ref: The cluster to update.
      existing_policy: The existing maintenance policy, if any.
      window_name: Unique name for the exclusion. Can be None (will be
        autogenerated if so).
      window_start: Start time of the window as a datetime.datetime. Can be
        None.
      window_end: End time of the window as a datetime.datetime.
      window_scope: Scope that the current exclusion will apply to.

    Returns:
      Operation from this cluster update.

    Raises:
      Error if a maintenance exclusion of that name already exists.
    zgenerated-exclusion-z1A maintenance exclusion named {0} already exists.r  no_upgradesr   no_minor_upgradesno_minor_or_node_upgradesr}  )r  r   NowUTCr  r  r	   r;  rl   r  r  r   r   MaintenanceExclusionOptionsScopeValueValuesEnumNO_UPGRADESmaintenanceExclusionOptionsNO_MINOR_UPGRADESNO_MINOR_OR_NODE_UPGRADESr  r   r  r  )	r  r'  r  window_namer  r  window_scope
exclusionsr  s	            ra   AddMaintenanceExclusionz"APIAdapter.AddMaintenanceExclusion	  s   6 CCO YYuyy)l +UYYuyy-A-K-K-MMkd88IIJJ
=
D
D  !''==J]]%%((*J4H4H4J & F 		&-1]]-V-V--;;PP\\ .W .
* 
,	,-1]]-V-V--;;PPbb .W .
* 
4	4-1]]-V-V--;;PPjj .W .
* ##**%%+V%D --k?KKrb   c                    | j                  |      }| j                  |      }||vr6dj                  |dj                  |            }t	        j
                  |      g }|j                  j                  j                  D ]#  }|j                  |k7  s|j                  |       % ||j                  j                  _        | j                  ||      S )zDRemoves a maintenance exclusion from the maintenance policy by name.zHNo maintenance exclusion with name {0} exists. Existing exclusions: {1}., )r  r  rl   rM  r	   r;  r  r  r  r~  r   r  )r  r'  r  exclusion_nameexisting_exclusionsrt  ru  exs           ra   RemoveMaintenanceExclusionz%APIAdapter.RemoveMaintenanceExclusionR  s     CCO <<_M00~tyy)<=>  JJwE$$::OO	>	!R P INO00E--k?KKrb   c                    g }||j                  d|z          ||j                  |       dj                  |      }| j                  j                  |j	                         d|      }| j
                  j                  j                  |      S )a4  List usable subnets for a given project.

    Args:
      project_ref: project where clusters will be created.
      network_project: project ID where clusters will be created.
      filter_arg: value of filter flag.

    Returns:
      Response containing the list of subnetworks and a next page token.
    znetworkProjectId=z AND i  )r  pageSizefilter)r   rM  r   7ContainerProjectsAggregatedUsableSubnetworksListRequestRelativeNamer  %projects_aggregated_usableSubnetworksr  )r  project_refnetwork_project
filter_argfiltersr  s         ra   ListUsableSubnetszAPIAdapter.ListUsableSubnetsi  s     G"nn(?:;nnZ ll7#G
--
O
O'') P C ;;<<AA#FFrb   c           	          |j                   }|rg }|r|D cg c]  }|j                  |vs| }}|r`t        |D cg c]  }|j                   c}      }|j                  |D 	cg c]"  }	|	|vr| j                  j                  |	      $ c}	       | j                  j                  |j                  |      }
| j                  j                  |
      }| j                  j                  |      }| j                  j                  j                  | j                  j                  t        |j                  |j                   |j"                        |            }| j%                  |j&                  |j                         S c c}w c c}w c c}	w )zOAdd/Remove/Clear cross connect subnetworks and schedule cluster update request.r  )r  r  )crossConnectConfig)desiredPrivateClusterConfigrh  )r  r   r   r   r   CrossConnectItemCrossConnectConfigr  r  r   r  r  rj  rk  r!  r  r  r  r  r  )r  r'  existing_cross_connect_configadd_subnetworksremove_subnetworksclear_all_subnetworksr  xexisting_subnetworksr   cross_connect_configprivate_cluster_configr>  r4  s                 ra   ModifyCrossConnectSubnetworksz(APIAdapter.ModifyCrossConnectSubnetworks  s    *//EeJ%Q1<<7I#Iq%eJ !>1!,,!>?ll++j33 --
(
(J
(
?+ 	  ==;;1==U <  "]]??/ @  ]](($: ) F 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(8997 K!>s   FFF%'Fc           	         | j                   j                  |j                  |j                  |      }| j                   j	                  |      }| j
                  j                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )zFUpdate enable_google_cloud_access and schedule cluster update request.)r  r  r  )%desiredMasterAuthorizedNetworksConfigrh  )r   r  r  r  r   r  r  rj  rk  r!  r  r  r  r  r  )r  r'  existing_authorized_networksgoole_cloud_accessr  r>  r4  s          ra   ModifyGoogleCloudAccessz"APIAdapter.ModifyGoogleCloudAccess  s     --FF,44/::$6 G 
 ]]((.A ) F 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	         | j                   j                  |      }| j                   j                         }||_        | j                  j
                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )z<Updates default for Kubelet Readonly Port on new node-pools.r^  rh  )r   r]  r   desiredNodeKubeletConfigr  r  rj  rk  r!  r  r  r  r  r  )r  r'  readonly_port_enablednkcr>  r4  s         ra   (ModifyInsecureKubeletReadonlyPortEnabledz3APIAdapter.ModifyInsecureKubeletReadonlyPortEnabled  s     --
)
)+@ * C ]]((*F&)F#		0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	         | j                   j                  |      }| j                   j                  |      }| j                  j                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )zXUpdates the kubelet readonly port on autoprovsioned node-pools or on autopilot clusters.r  )&desiredNodePoolAutoConfigKubeletConfigrh  )r   r]  r   r  r  rj  rk  r!  r  r  r  r  r  )r  r'  request_roport_enabledr  r>  r4  s         ra   8ModifyAutoprovisioningInsecureKubeletReadonlyPortEnabledzCAPIAdapter.ModifyAutoprovisioningInsecureKubeletReadonlyPortEnabled  s     --
)
)+A * C ]]((/2 ) F 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           
      J   |2| j                   j                  |j                  |j                        }n| j                   j                         }|V|r7t	        | j                   |j                        rt        j                  dd       | j                   j                  |      }n|\t        j                  | j                   d      j                  |      |_        t	        | j                   |j                        sg |_        |sg |_        |D ]g  }|j                  j                  | j                   j                  |d	   d
|v r(| j                   j                  j                  |d
         nd             i | j                   j                  |      }| j                  j                  j!                  | j                   j#                  t%        |j&                  |j(                  |j*                        |            }	| j-                  |	j.                  |j(                        S )z)Updates the binary_authorization message.N)r  r  z_This will cause the current version of Binary Authorization to be downgraded (not recommended).Tr  r  Fr  r  r  r  )desiredBinaryAuthorizationrh  )r   r  r  r  $BinauthzEvaluationModeRequiresPolicyr   r  r	   r  r  r   r  r  r   r  r  rj  rk  r!  r  r  r  r  r  )
r  r'  existing_binauthz_configr   r   r   binary_authorizationr  r>  r4  s
             ra   ModifyBinaryAuthorizationz$APIAdapter.ModifyBinaryAuthorization  s      +!]]>>1@@1@@ ? 
 "]]>>@"	A
---<< 	!!4 	
 "]]>>! ?  
"	-00e78 	+ 4MM/>>
 13

-	!	- /1+/G

-
-
4
4mm))v (72 #'--"="="\"\01#  * 	 0 ]]((#7 ) F 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	         | j                   j                  d| j                   j                  |            }| j                   j                  |      }| j                   j	                  |      }| j
                  j                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )z@Enables Ray cluster log collection when using RayOperator addon.Tr  )r  r  r  rm  rh  )r   r  r  rv  r   r  r  rj  rk  r!  r  r  r  r  r  )r  r'  r  ray_operator_configaddons_configr>  r4  s          ra   ModifyRayClusterLoggingConfigz(APIAdapter.ModifyRayClusterLoggingConfig=  s    
 --99 $ E E. !F !
 :  MM..- / M ]]((](KF		0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	         | j                   j                  d| j                   j                  |            }| j                   j                  |      }| j                   j	                  |      }| j
                  j                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )zDEnables Ray cluster metrics collection when using RayOperator addon.Tr  )r  r  r  rm  rh  )r   r  r  rv  r   r  r  rj  rk  r!  r  r  r  r  r  )r  r'  r  r  r  r>  r4  s          ra    ModifyRayClusterMonitoringConfigz+APIAdapter.ModifyRayClusterMonitoringConfigV  s    
 --99#'==#K#K1 $L $
 :  MM..- / M ]]((](KF		0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	         | j                   j                         }|||_        |||_        | j                   j	                  |      }| j
                  j                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )z%Modify the RBACBindingConfig message.)desiredRbacBindingConfigrh  )r   r  r  r  r   r  r  rj  rk  r!  r  r  r  r  r  )r  r'  r  r  rbac_binding_configr>  r4  s          ra   ModifyRBACBindingConfigz"APIAdapter.ModifyRBACBindingConfigo  s     --99;3?
6 B 6A
8 D ]]((!4 ) F 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	         | j                   j                  j                  j                  | j                   j                  j                  j                  | j                   j                  j                  j
                  d}| j                   j                  ||         }| j                   j                  |      }| j                  j                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                   |j                        S )zOUpdates the cgroup mode on autoprovisioned node-pools or on autopilot clusters.)rR  rd   v2)
cgroupMode)(desiredNodePoolAutoConfigLinuxNodeConfigrh  )r   LinuxNodeConfigCgroupModeValueValuesEnumCGROUP_MODE_UNSPECIFIEDCGROUP_MODE_V1CGROUP_MODE_V2r   r  r  rj  rk  r!  r  r  r  r  r  )r  r'  cgroup_modecgroup_mode_maplinux_configr>  r4  s          ra    ModifyAutoprovisioningCgroupModez+APIAdapter.ModifyAutoprovisioningCgroupMode  s   
 MM))CC[[ MM))CCRR MM))CCRR
O ==00";/ 1 L ]]((1= ) F 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	      J   | j                   j                         }| j                   j                  j                  j                  | j                   j                  j                  j
                  d}|$| j                   j                  ||         |_        | j                  j                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                   |j                        S )z;Updates the anonymous authentication config on the cluster.r  r  rh  )r   r   AnonymousAuthenticationConfigr  r  r  r  r  r  rj  rk  r!  r  r  r  r  r  )r  r'  r  r>  available_modesr4  s         ra   #ModifyAnonymousAuthenticationConfigz.APIAdapter.ModifyAnonymousAuthenticationConfig  s     ]]((*F MM77KKSS MM77KKSSO '2
--
5
5"#BC 6  1
 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	         | j                   j                  d|      }| j                   j                  |      }| j                   j                  |      }| j                  j
                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S )a  Enables legacy lustre port when using the Lustre Csi Driver add on.

    Args:
      cluster_ref: The cluster to update.
      enable_legacy_lustre_port: Whether to enable legacy lustre port.

    Returns:
      Modifies LustreCsiDriverConfig and returns the operation for update.
    T)r  r  )r  rm  rh  )r   r  rv  r   r  r  rj  rk  r!  r  r  r  r  r  )r  r'  r  lustre_csi_driver_configr  r>  r4  s          ra   ModifyLegacyLustrePortEnabledz(APIAdapter.ModifyLegacyLustrePortEnabled  s      $}}BB8  C   MM..6 / M ]]((](KF		0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	      J   | j                   j                         }| j                   j                  j                  j                  | j                   j                  j                  j
                  d}|$| j                   j                  ||         |_        | j                  j                  j                  | j                   j                  t        |j                  |j                  |j                        |            }| j                  |j                   |j                        S )z7Updates the control plane egress config on the cluster.r  r  rh  )r   r   r  r  r?   r  r  r  r  rj  rk  r!  r  r  r  r  r  )r  r'  r  r>  r%  r4  s         ra   ModifyControlPlaneEgressz#APIAdapter.ModifyControlPlaneEgress  s     ]]((*F MM,,@@EE MM,,@@RRO !,
--
*
*"#<= +  &
 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c                    | j                   j                         }|j                  |j                  |j                  | j                   j                         |_        |j                  |j                  |j                  _        |j                  |j                  |j                  _        |j                  |j                  |j                  _	        |j                  =|j                  1|j                  %|j                  |j                  |j                  | j                   j!                         }|j                  |j                  |_        |j                  |j                  |_        |j                  |j                   |_        |j                  |j(                  |j                  t+        j,                  t.              | j                   j1                  |j                        }|j(                  rF|j(                  D ]7  }|j2                  j5                  | j                   j7                  |             9 ||_        |j                  |j8                  | j;                  |      }| j                   j1                  |j<                  j>                  j8                  j"                  |j<                  j>                  j8                  j2                        }||_        |j                  |j8                  _         |j                  |j8                  | j;                  |      }| j                   j1                  |j<                  j>                  j8                  j"                  |j<                  j>                  j8                  j2                        }||_        |j                  |j8                  _!        ||_        |S )z9Gets the DesiredControlPlaneEndpointsConfig from options.r  r  )r  r  )"r   ControlPlaneEndpointsConfigr  r  r  DNSEndpointConfigdnsEndpointConfigallowExternalTrafficenableK8sTokensViaDnsenableK8sCertsViaDnsr  r7  r   r   rb  r  IPEndpointsConfigr  globalAccessenablePublicEndpointr   r	   r;  r  r  r  r   r  r  r*  r  r  r  r  )r  r'  r   rT  ip_endpoints_configr  r   rX   s           ra   r.  z1APIAdapter._GetDesiredControlPlaneEndpointsConfig  sk   --CCE 	!!-,,8++7.2mm.M.M.O+		"	"	.%% 	--B 
	*	*	6-- 	--C 
	)	)	5,, 	--B
 	  ,..:**644@--9AAM MM;;=		!	!	-&-&>&>#		,	,	8+2+N+N(		(	(	4/// 	0
 
3
3
?//;44<

AB
B"mmJJ== K 
 -- ;;g**11'''': < 8K4		+	+	777? OOK0' $ L L99KKddll <<NNggrr !M !
 :M

6 ..  88T 
	?	?	K77? OOK0' $ L L99KKddll <<NNggrr !M !
 :M

6 BB  88Z /B+rb   c                    |j                   6| j                  |       |j                   |j                  j                  _        |j
                  6| j                  |       |j
                  |j                  j                  _        |j                  6| j                  |       |j                  |j                  j                  _        |j                  6| j                  |       |j                  |j                  j                  _        |j                  6| j                  |       |j                  |j                  j                  _        |j                  7| j                  |       |j                   |j                  j                  _        |j"                  6| j                  |       |j"                  |j                  j                  _        | j'                  ||       y)zFParses the options for control plane endpoints config (creation flow).N)r   _InitDNSEndpointConfigIfRequiredr  r/  r0  r  r1  r  r2  r  r  r  r  r7  r4  r   r5  rM  privateEndpointSubnetworkr  )r  r   rX   s      ra   r  z,APIAdapter._ParseControlPlaneEndpointsConfig[  s     ,
++G4

#
# ));;P ((4
++G4

+
+ ));;Q ''3
++G4

*
* ));;P +
++G4

"
" ));;C **6
++G4

-
- ));;H &&2
++G4--
- ));;P **6
++G4

-
- ));;U 	,,Wg>rb   c                     |j                   | j                  j                         |_         |j                   j                  *| j                  j	                         |j                   _        yy)zFInitializes the DNSEndpointConfig on the cluster object if it is none.N)r  r   r-  r/  r.  rl  s     ra   r8  z+APIAdapter._InitDNSEndpointConfigIfRequired  ^    **2
--
3
3
5 ) **<<D
--
)
)
+ )); Erb   c                     |j                   | j                  j                         |_         |j                   j                  *| j                  j	                         |j                   _        yy)zFInitializes the IPEndpointsConfig on the cluster object if it is none.N)r  r   r-  r  r3  rl  s     ra   r  z+APIAdapter._InitIPEndpointsConfigIfRequired  r;  rb   r   )i     re  )NNNNNNNNNNNNNNNNr  )xr  r  r  r  r  r  r  r  r*  r/  r1  r7  r%  rQ  rY  ry  rA  r  r  r  r  r  r  r  r  r!  r-  r.  r/  r0  r  r  r  r  r  r  r  r  r  rT  r  r\  rl  rp  rt  r  r  r   r  r  r  r  r  r
  rh  r  r  r  r  r  r  r  r  r  r  r=  r  r  r   r%  r)  r,  r0  r5  r  r9  rU  rX  r^  rb  rg  rm  rp  rx  r{  rm  r  r  r8  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r
  r  r  r  r"  r&  r)  r+  r.  r  r8  r  rx   rb   ra   r  r    s   >
	
D8D8D:D8-^*	 CDBHl\ l\5*
2IVRh&L\:&'R#'J=A~IV .A``DB0d.7>r"H(T`D!?:B	:	: ! ""&!%  $&*&*##fPF4	@	P
5


 <;*
X&
:	AAAL4:6=rh	
CG	F*(,\>@"HVp'CRCCAQ
4?
?A&M^ )2A))VA@@ LDL<GLRL.GB  (:T:,:&:(N:`:2:2:::<:::<::Wr'?R		rb   r  c                       e Zd ZdZy)rw   zAPIAdapter for v1.N)r  r  r  r  rx   rb   ra   rw   rw     s    rb   rw   c                   F    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zy)rz   zAPIAdapter for v1beta1.c                    | j                  |      }j                  r{t        fdt        D              rΉj                  sUj
                  t        j
                  vsj                  +t        j                  vrt        j                  t              t        j                  vrt        j                  t              t        | j                        }| j                  j                  d|      |j                   _        t$        j                  v rj                  sUj
                  t        j
                  vsj                  +t        j                  vrt        j                  t&              | j                  j)                  d      |j                   _        t,        j                  v r+| j                  j/                  d      |j                   _        t2        j                  v r| j                  j4                  j6                  j8                  }| j                  j4                  j6                  j:                  }j<                  }||j?                  d      }||dk(  r|}| j                  j5                  d|      |j                   _         jB                  jD                  jF                  jH                  ؉jJ                  ̉jL                  jN                  jP                  jR                  jT                  jV                  jX                  xjZ                  lj\                  `j^                  Tj`                  Hjb                  <jd                  0jf                  $jh                  jj                  jl                  | jo                  d d      |_8        jr                  r|jt                  s*t        j                  tv        jy                  d	d
            |jz                  | j                  j}                         |_=        jr                  |jz                  _?        j                  r|jt                  s*t        j                  tv        jy                  d	d            |j                  | j                  j                         |_A        j                  |j                  _C        j                  r+| j                  j                  j                        |_F        j                  r+| j                  j                  j                        |_I        j                  ,| j                  j                  dj                        |_L        t        || j                         | j                  |j                  |j                        }	|	0| j                  j                         |_R        |	|j                  _S        |j                  rd |_O        d |_P        j                  rd|_U        j                  `|j                  | j                  j                         |_W        | j                  j                  j                        |j                  _Z        j                  rRjt                  rj                  |j                  _]        n*t        j                  tv        jy                  d	d            j                  |j                  | j                  j                         |_W        j                  j                         dk(  r:| j                  j                  j                  j                  |j                  _b        nj                  j                         dk(  r:| j                  j                  j                  j                  |j                  _b        n3t        j                  t        jy                  j                              t        | j                        |_f        t        | j                        |_h        j                  H| j                  j                  j                        |_k        j                  rd|j                  _l        j                  r!| j                  j                  d      |_o        j                  wj                  j                         dk(  r| j                  |       nGt        j                  | j                        j                  j                        |j                  _u        j                  Gt        j                  | j                        j                  j                        |j                  _x        | j                  j                  t        |j                  |j                        |      }
| j                  j                  j                  |
      }| j                  |j                  |j                        S )Nc              3   :   K   | ]  }|j                   v   y wr   r  r  s     ra   r  z/V1Beta1Adapter.CreateCluster.<locals>.<genexpr>  r  r  Fr  Tr  authMTLS_STRICTr  rB  r  enable-workload-certificatesr  enable-altsr  identity-providerlegacyadvancedr  enableExperimentalFeaturesr  r  )r  r   r  r  r   rT  r@   rS  r	   r;  r  r  r  r  r   r  r  r  r  4CLOUDBUILD_STACKDRIVER_KUBERNETES_DISABLED_ERROR_MSGr  r  r  r  r  ISTIOIstioConfigAuthValueValuesEnum	AUTH_NONEAUTH_MUTUAL_TLSr   r   istioConfigr$  r*  r)  r,  r+  r/  r.  r-  r&  r'  r^  r_  r0  r1  r`  ra  r2  r3  r(  r6  r  r  r  rK  r  r
  r  rl   workloadCertificatesWorkloadCertificatesrn  r  workloadAltsConfigWorkloadALTSConfig
enableAltsr  GkeOidcConfiggkeOidcConfigr  rx  ry  r   r&  r'  6_AddPSCPrivateClustersOptionsToClusterForCreateClusterrT  r  r  rR  clusterTelemetryr  r   workloadMonitoringEnabledEaprO  r  r  rv  rw  r  r+  identityProviderdatapath_providerr,  r  LEGACY_DATAPATHr
  r	  )DATAPATH_PROVIDER_ILL_SPECIFIED_ERROR_MSG_GetMasterForClusterCreatemaster1_GetKubernetesObjectsExportConfigForClusterCreatekubernetesObjectsExportConfigr  r1  r2  r  r   r  r  rZ  _ParseIPv6Optionsr  r  r  r  r[  r  r  r  r  r  r  r  r  r  r  r  )r  r'  r   rX   r  
istio_authmtlsr   auth_configcluster_telemetry_typer  rx  s     `         ra   r  zV1Beta1Adapter.CreateCluster  s   &&{G<G~~	<O<	<44"".'"4"44+goo0M

MN
N'..(

IJ
J9T]]
 /3mm.J.J-? /K /
+ 
w~~	%44"".'"4"44+goo0M

OP
P040N0N 1O 1
- 
'..	(MM..t.< 	1 
'..	 ]]..BBLL
}}((<<LL++#$((0+$m+j+/==+D+D ,E ,
( 	''3??&??&))..:""."".33?**688D==I55A;;G;;G;;G66B55A--944@&&2//; ??
g ++""jj)00,2P 1 
 	

 
	%	%	-'+}}'I'I'K$

.
. ""5 ""jj)00,- 1 
 	

 
	#	#	+%)]]%E%E%G".5.A.Ag  +"mm99)) : g &&&*mm&I&I11 'J 'g# ) --
1
1'*@*@ 2  '
 ;$-- "::'')B)B )!%!?!?!Ag&<g##g"&g---1g*))5				& $ ; ; =
--
0
088 1  4
   			%% 	&&7 jj)00,2E 1 
 	
   ,				& $ ; ; =		"	"	(	(	*h	6MM''GGWW 	. $$**,
:MM''GGYY 	. jj5<< 22 = 
 	
 0GGN 	:T]]	
 ) ;;G'+}}'K'K%,%Y%Y (L (g$ 
	=	=15&&.%%%)]]%G%G &H &g" %				!	!	#v	-w0/3/L/LMM0


7--
. 	"", +262N2N
--3112   / --
,
,{44k6F6FG - C 77>>sCIy~~{/?/?@@rb   c                 H   | j                  ||      }| j                  j                  |t        |j                  |j
                  |j                              }| j                  j                  j                  |      }| j                  |j                  |j
                        S Nr  r  r  s         ra   r  zV1Beta1Adapter.CreateNodePoolu      $$]G<D
--
-
-%##]%7%79P9P
 . C AAHHMIy~~}/A/ABBrb   c                 `c   d}|j                   sd|_         |j                  r| j                  j                  |j                   |j                  |j
                  |j                  |j                        }|j                  | j                  j                  |j                        |_
        n|j                  r| j                  j                  |j                         }|j                  +| j                  j                  |j                        |_
        |j                  | j                  j                  |j                        |_        n|j                  r*| j                  j                         }d|_        d|_        n|j                  *| j                  j                         }d	|_        d	|_        ns|j$                  s|j&                  rW| j                  j                         }|j$                  r|j$                  |_        |j&                  r|j&                  |_        n|j(                  sm|j*                  sa|j,                  sU|j.                  sI|j0                  s=|j2                  s1|j4                  s%|j6                  s|j8                  s|j:                  rt=        || j                        }|j:                  s|j6                  s|j8                  r||j2                  p|j4                  d| j?                  |      }|rQ|j@                  rE|j@                  jB                  r/|j@                  jB                  jD                  rd
|_        nd
|_        d}|j0                  r| j?                  |      }|tG        jH                  d      |j@                  jJ                   |j@                  jJ                  jL                  s(|j0                  dk(  rtG        jH                  tN              |j@                  jJ                  jL                  rtQ        || j                  d
d
      }n1tQ        || j                  d
d      }ntQ        || j                  dd      }| j                  j                         }|r||_)        |
r||_*        
n|jV                  rx|jV                  jY                  tZ              }| j]                  |jV                  jY                  t^              |jV                  jY                  t`              |jV                  jY                  tb              |jV                  jY                  td              || nd      }|jV                  jY                  tf              ?| j                  ji                  |jV                  jY                  tf                     |_5        |jV                  jY                  tl              ?| j                  jo                  |jV                  jY                  tl                     |_8        |jV                  jY                  tr              ?| j                  ju                  |jV                  jY                  tr                     |_;        |jV                  jY                  tx              ?| j                  j{                  |jV                  jY                  tx                     |_>        |jV                  jY                  t~              ?| j                  j                  |jV                  jY                  t~                     |_A        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_D        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_G        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_J        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_M        |jV                  jY                  t              ?| j                  j                  |jV                  jY                  t                     |_P        | j                  j                  |      }n#|j                  |j                  |j                  | j]                  || j                        }|j                  5| j                  j                  |j                        |j                  _U        |j                  5| j                  j                  |j                        |j                  _W        |j                  |j                  |j                  _X        | j                  j                  |      }n|j                  | j                  j                  |j                        }	|j                  ru|j                  |	_\        |j                  |	_^        |j                  |	_`        |j                  |	_b        |j                  %t        | j                  |j                        |	_e        | j                  j                  |j                  |	      }n@|j                  r(| j                  j                  |j                        }n|j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  |j                  x|j                  l|j                  `|j                  T|j                  H|j                  <|j                  0|j                  $|j                  |j                  |j                  1| j                  ||d
      }	| j                  j                  |	      }n|j                  D| j                  j                  |j                        }
| j                  j                  |
      }n|j                   F| j                  j                  |j                         }| j                  j                  |      }n0|j                  | j                  j                  | j                  j	                  |j                              }|j
                  rd
|_        |j                  -| j                  j                  |j                        |_        | j                  j                  |      }nt|j
                  tG        jH                  t              |j                  tG        jH                  t              |j                  8| j                  j                         }| j                  j                  |      }n|j                  C| j                  j                  |j                        }| j                  j                  |      }n|j                  E| j                  j                  |j                        }| j                  j                  |      }n@|j                  r3t!        || j                        }| j                  j                  |      }|j                  *|j"                  |j"                   |j                  _        |j&                  r'|j(                  stG        jH                  t*              |j,                  ro| j                  j                  | j                  j/                  |j,                  | j                  j.                  j0                  j2                              }no|j4                  rb| j                  j                  | j                  j/                  | j                  j.                  j0                  j6                              }|j8                  B| j                  j                  | j                  j;                  |j8                              }|j<                  1| j                  j                  t?        || j                               }|j@                  1| j                  j                  tC        || j                        !      }|jD                  1| j                  j                  tG        || j                        "      }|jH                  D| j                  jK                  |jH                  #      }| j                  j                  |$      }|jL                  D| j                  jO                  |jL                        }| j                  j                  |%      }|jP                  W| j                  j                  tG        jR                  | j                  d&      jU                  |jP                        '      }| jW                  |d
|(      }|| j                  j                  |)      }| jY                  |      }|| j                  j                  |*      }|jZ                  1| j                  j                  t]        || j                        +      }|j^                  7| j                  j                  | j                  ja                  d      ,      }|jb                  C| j                  j                  | j                  je                  d
|jb                  -      .      }|jf                  B| j                  j                  | j                  ji                  |jf                        /      }|jj                  B| j                  j                  | j                  jm                  |jj                  0      1      }|jn                  ;|jn                  }| jq                  |      }| j                  j                  |2      }|jr                  B| j                  j                  | j                  ji                  |jr                        /      }|jt                  B| j                  j                  | j                  jw                  |jt                  3      4      }|jx                  1| j                  j                  t{        || j                        5      }|j|                  B| j                  j                  | j                  j                  |j|                        6      }|j                  B| j                  j                  | j                  j                  |j                        7      }|j                  |j                  k| j                  j                         }|j                  | j                  j                         |_        |j                  r>| j                  j                  j                  j                  |j                  _        n=| j                  j                  j                  j                  |j                  _        |j                  r|j                  r3| j                  j                  j                  j                  |_        n2| j                  j                  j                  j                  |_        | j                  j                  |8      }|j                  |j                  d9k(  re| j                  j                  | j                  j                  j                  j                  :      }| j                  j                  |;      }nt|j                  d	k(  rd| j                  j                  | j                  j                  j                  j                  :      }| j                  j                  |;      }|j                  y| j                  j                         }| j                  j                  t        | j                  |j                        <      |_        | j                  j                  |=      }|j                  s|j                  r| j                  j                         }|j                  r-| j                  j                  |j                  >      |_        |j                  r-| j                  j                  |j                  >      |_        |j                  U| j                  j                  tG        j                  | j                        jU                  |j                        ?      }|j                  B| j                  j                  | j                  j                  |j                        @      }| j                  j                  j                  j                  | j                  j                  j                  j                  dA}|j                  r^| j                  j                  | j                  j                  |j                  |jY                  |j                  d      B      C      }|j                  r^| j                  j                  | j                  j                  |j                  |jY                  |j                  d      B      C      }|j                  rT|j                  xs |j                  }| j                  j                  | j                  j                  d|D      C      }|j                  I| j                  j                         }|j                  |_        | j                  j                  |E      }|j                  r7| j                  j                  | j                  j                  dFG      C      }|j                  |j                  C|j                  dHk(  r'|j                  rtG        jH                  t              | j                  j                         }| j?                  |      }|j                  r|j                  j                         nd}|+|j                  |j                  j                  |_        n|dHk(  r3| j                  j                  j                  j                  |_        nn|dIk(  r3| j                  j                  j                  j                  |_        n6tG        jH                  t        j                  |j                  J            |j                  +|j                  |j                  j                  |_        n|j                  s6tG        jH                  t        j                  |j                  K            |j                  j                  dL      D cg c]  }| j                  j                  |M      ! c}|_        | j                  j                  |N      }|j                  | j                  j                         }|j                  r3| j                  j                  j                  j                  |_        n2| j                  j                  j                  j                  |_        | j                  j                  |O      }|j                  r| j                  j                         }|j                  j                         dPk(  r3| j                  j                  j                  j                  |_        n|j                  j                         dQk(  r3| j                  j                  j                  j                  |_        n|j                  j                         dHk(  r3| j                  j                  j                  j                  |_        nEtG        jH                  t         j                  |j                  j                         J            | j                  j                  |O      }|j                  u| j                  j                         }|j                  j                         dQk(  r4| j                  j                  j                  j                  |_        n|j                  j                         dHk(  r4| j                  j                  j                  j
                  |_        n|j                  j                         dPk(  r4| j                  j                  j                  j                  |_        nEtG        jH                  t        j                  |j                  j                         J            | j                  j                  |O      }|j                  | j                  j                         } |j                  r3| j                  j                  j                  j                  | _        n2| j                  j                  j                  j                  | _        | j                  j                  | R      }|j                  r.| j                  |      }!| j                  j                  |!S      }|j                  O| j                  j                         }"|j                  dTk(  rd
|"_        | j                  j                  |"U      }|j                   O| j                  j                         }"|j                   dTk(  rd|"_        | j                  j                  |"U      }|j"                  7| j                  j                  t%        || j                  t&              V      }|j(                  U| j                  j                  tG        j*                  | j                        jU                  |j(                        W      }|j,                  '| j                  j                  |j,                  X      }|j.                  m| j                  j                  | j                  j1                         Y      }tG        j2                  |j4                  |j.                  | j                         |j6                  |j8                  |j:                  a| j?                  |      }#|#j<                  }$|j:                  /|$| j                  j?                         }$|j:                  |$_&        |j6                  h|$| j                  j?                         }$|$j@                  !| j                  jC                         |$_         |j6                  |$j@                  _&        |j8                  i|$| j                  j?                         }$|$j@                  !| j                  jC                         |$_         |j8                  |$j@                  _"        | j                  j                  |$Z      }|jF                  |jH                  |jJ                  a| j?                  |      }#|#jL                  }%|jF                  /|%| j                  jO                         }%|jF                  |%_&        |jJ                  h|%| j                  jO                         }%|%j@                  !| j                  jQ                         |%_         |jJ                  |%j@                  _&        |jH                  i|%| j                  jO                         }%|%j@                  !| j                  jC                         |%_         |jH                  |%j@                  _"        | j                  j                  |%[      }|jR                  '| j                  j                  |jR                  \      }|jT                  '| j                  j                  |jT                  ]      }|jV                  |jX                  w| j                  j[                         }&|jV                  |jV                  |&_.        |jX                  |jX                  |&_/        | j                  j                  |&^      }|j`                  |j`                  }'tc        |'td              r@|'j                  dL      D (cg c]%  }(|(jg                         s|(jg                         ' }'}(| j                  j                  | j                  ji                  |'_      `      }|jj                  '| j                  j                  |jj                  a      }|jl                  h|jn                  [|jp                  N|jr                  A|j(                  4|jt                  '|jv                  |jx                  |jz                  /| j}                  ||      })| j                  j                  |)b      }|j~                  |j                  | j?                  |      }i }*|j                  rH|j                  j                  }
|
r.|
D ])  }+t        |+j                        },|,|*|+j                  <   + |j~                  g|j~                  D ]W  }+t        |+dc   |j                  |j                        }-|-|*v r|*|-   n
t               },|,j                  |+dd          |,|*|-<   Y |j                  |j                  D ]  }.t        |.dc   |j                  |j                        }-|-|*vr+tG        jH                  t        j                  |-e            dd|.v r3|.dd   }/	 |*|-   j                  |/       |*|-   s|*j                  |-       |*j                  |-        | j                  j                  | j                  j                  |*j                         D -,cg c]-  \  }-},| j                  j                  |-t        |,      g      / c},}-h      i      }|j                  r| j                  j                  d
j      }|j                  r| j                  j                  dj      }|j                  1| j                  j                  t        || j                        k      }|j                  J| j                  j                         }"|j                  |"_W        | j                  j                  |"U      }|j                  u| j?                  |      }| j                  j                         }0|j                  |j                  }0|j                  |0_[        | j                  j                  |0l      }|j                  u| j?                  |      }| j                  j                         }0|j                  |j                  }0|j                  |0_]        | j                  j                  |0l      }|j                  u| j?                  |      }| j                  j                         }0|j                  |j                  }0|j                  |0__        | j                  j                  |0l      }|j                  r7| j                  j                  | j                  j                  d      m      }|j                  r7| j                  j                  | j                  j                  d
      m      }|j                  | j                  j                  j                  j                  | j                  j                  j                  j                  dn}1| j                  j                         }
|1|j                     |
_        | j                  j                  |
o      }|j                  1| j                  j                  t        || j                        p      }|S c c}w c c}(w # t        $ r, tG        jH                  t        j                  |/f            w xY wc c},}-w )qr^  Nr_  r`  r  rf  rh  r  r  r  Trj  rk  Frl  r  rm  ro  rq  rs  ru  rw  r  r  ry  r{  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rD  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r   r  r  r  r  r  r  r  r  r  r  (h  r  r  r   r   r  r   r   r   r  r  r|  r  r  r  r  r   r  r  r  r  rS  rT  rU  r  rV  r  r  r  r  r  rp  r*  rs  r  r  r	   r;  r  r  r	  rr  r
  r  r  r   r  r  r  rK   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r9  r   r2  r   r3  r   r4  r   r5  r   r:  r;  r  r$  r*  r)  r,  r+  r/  r.  r-  r&  r'  r^  r_  r0  r1  r`  ra  r2  r3  r(  r6  r  r  r  r   r"  r   r1  r   r4  r3  r  r6  r	  r7  r8  r9  r:  r  r   r  rW  rt  r  r  r   r   r  r  r?  r@  rA  r  r  r  r(  r   r   r;  rD  r  r$  r  r  r   r!  r>  r"  r  r  r  r<  r#  r  rF  r   r&  rK  ra  r   rf  rz  rh  rL  r  rm  rX  rj  rO  rv  r  rx  r\  r]  r{  r|  r  r}  r~  r  r  r  r  r  r  r  r  r?   rh  r  r  r  r  r  r  r$  r%  r&  rZ  r'  r   r  r  r(  r  r  re  r  rf  rd  r  rn  r  r  r  ro  rp  r  r  r,  r  r  r  r  r  rl   r  r)  r  r  rj  r  rq  r  r  rr  r  r  r  r  r  r  rs  r  r  rk  r  rt  rP  rQ  r  rv  r  r  rw  r*  ri  rx  rc  re  r  r|  r}  r{  rG  rH  r  r  r  r~  r  r  rI  rJ  r  r  ru  r  r  r  r  r  r  r+  r,  r-  r  r   r  r  r7  r   rb  r  r  r  r.  r  r  r  r  r   r  r   r/  r  r0  r1  r2  r3  r4  r5  r6  r  r7  r8  r  r  r  r9  r  r:  r  r  r  r  r  r  r  r  r  r  r  r  r;  r  r  r  r=  s2                                                     ra   r\  z"V1Beta1Adapter.UpdateClusterCommon  s*   F??go}}**$__#--"--}}%33 + f 
	!	!	-!%!>!>)) "? "
 
		}}***Pf		!	!	-!%!>!>)) "? "

 
	,	,	8,0MM,M,M%,%H%H -N -
) 
	.	.}}**,f%Hf"(Nf%		.	.	:}}**,f%+f"(.f%		#	#w'>'>}}**,f		#	#*1*D*D'		 	 '.'>'>$,,--((..//99::22!'4==9g 55??@@11922://+.((((LL &&JJXX26G/37G0j		&	&//+.?

J 
 $$<<D++CCKK++u4

F  ##;;CC+GT]]D$O*+GT]]D%P*)'4==%N
}}**,f	&-#	)3&			&5599,G!!!0044W=,,005#2266yA!(!7!7!;!;N!K#/ %; : " f 
			#	#O	4	@'+}}'J'J //33ODD (K (
$ 
			#	#N	3	?MM::#2266~FF ;  	/
 
			#	#$9	:	FMM55#22667LMM 6  	*
 
			#	#$4	5	A(,(L(L..223CDD )M )
% 
			#	#J	/	;"&--"@"@..22:>> #A #
 
			#	#$:	;	GMM66#22667MNN 7  	+
 
			#	#$:	;	GMM66#22667MNN 7  	+
 
			#	#O	4	@'+}}'J'J..22?CC (K (
$ 
			#	#M	2	>&*mm&H&H..22=AA 'I '
# 
			#	#K	0	<#'==#B#B..22;?? $C $
  }}**v*Ff**600<,,8!!'4==9f		+	+	7MM11:: 2  	  8 
	.	.	:MM44== 5  	  ; 
	*	*	6-- 	$$; }}**v*Ff		#	#	/MM55,, 6 k 
	#	##*#4#4 #*#4#4 (/(?(?%(/(?(?%"".'CmmW44(+
$ }}**#--%0 + f 
		}}**G<M<M*Nf''3??&??&))..:""."".33?**688D==I55A;;G;;G;;G66B55A--944@&&2//;77
wk }}**$/ + f 
	+	+	7}}4444 5 f }}**)/ + f 
	0	0	<!%!E!E99 "F " }}**(@ + f 
	0	0	<mm=="mm???? @  > m
 
	/	/481		5	5	AMM33DD 4  	/
 }}**+8 + f 
	/	/	;JJ?@@		5	5	AJJEFF		6	6	Bmm==?m}}**+8 + f 
	!	!	-66'' 7  }}**;K*Lf		-	-	9%)]]%L%L66 &M &" }}**+G + f 
	#	#:
4== }}**,? + Af 	  ,22> 44
4 0 	**99 JJ=>>&&}}**$(MM$D$D55MM44IISS %E % + f 
	,	,}}**$(MM$D$DMM44IISS %E % + f $$0}}**#}}::33  ;   + f
 %}}**8$--P + f *}}** 27DMM J + f '}}**7O + f ##/!]]<<// =  }}**#7 + f ''3#}}@@22  A   }}**'= + f ..:}}**)-)[)[mmE*55 + f ,,4[ - J }}**J*Gf--g6N!}}**"0 + f "".}}**$Jt}}% + f   ,}}**==2252A + f )}}**+/==+R+R'*@*@ ,S , + f &}}** MM44)) 5  + f ,,8}}**/3}}/H/H88 0I 0 + f 55A;;d))$/g}}**7> + f %%1}}** MM4444 5  + f ''3}}**"&--"@"@!(!A!A #A # + f ##/}}**#8$--#P + f ))5}}***.--*P*P88 +Q + + f &&2}}**'+}}'J'J55 (K ( + f 	,,899E}}224n		-	-	9(,(D(D(F%//mm**CCII 
'
'
1
 mm**CCLL 
'
'
1 
	7	7	C99mm))RRXX 
2
 mm))RR[[ 
2 }}***Of&				-!%!=!=}}33MMYY "> "
 ,,"8 - 
 &(!%!=!=}}33MMRR "> "
 ,,"8 - 
 *}}::<n%)]]%G%G-mmW44 &H &n"
 }}**'5 + f
 	**55}}**,f		+	+MM33%@@ 4  	(
 
	3	3MM33%HH 4  	/ %}}**88mmW//0 + f %%1}}**&*mm&H&H44 'I ' + f MM==II MM==YY }}**}}**!++-11))4 +  + f }}**}}**++-11))4 +  + f $$++D{/D/Dm}}**}}**!= +  + f ##/==113j&;;j}}**j*If""}}**}}**2*6 + f
 	&''3 
		z	)g.J.Jjj:;; --??A,g )0(:(:'


"
"
$  
!**6#*#B#B#G#G

 j(MM11EENN 	 i'MM11EEMM 	 jj)00g6H6H0I
 	
 
	%	%	-**6--AA 
/ ++jj6==!66 > 
 	
 $88>>sC1
C MM,,h,?C1
-
 }}**): + f &&2 $ C C E		(	(MM//CCII 	 $
 MM//CCLL 	 $ }}**'> + f + $ C C E		!	!	'	'	)\	9MM//CCNN 	 $ ##))+z9MM//CCII 	 $ ##))+z9MM//CCLL 	 $ jj/66--335 7 
 	

 }}**'> + f ..: $ C C E		0	0	6	6	8J	FMM//PPdd 	 1 2288:jHMM//PPgg 	 1 2288:lJMM//PPii 	 1 jj>EE<<BBD F 
 	

 }}**'> + f 33?
--
9
9
; + 
	5	5MM;;OOjj 	-1
 MM;;OOXX 	-1 }}**2 + f ))55g>d}}**4*Pf  ,--<<>		"	"&7	7*.'}}**/@ + f ''3--<<>		)	)->	>*/'}}**/@ + f ((4}}**'@t}}g( + f $$0}}**+/+X+Xmm,++ + f &&2}}**'.'F'F + f **6}}**"&--"@"@"B + f ''

(
(

-
-
-- 	..:33?((4OOK0k)==		&	&	2 ("&--"C"C"E
(/(E(E%		/	/	; ("&--"C"C"E
 //7151M1M1O

.22 	,,4 
	1	1	= ("&--"C"C"E
 //7151M1M1O

.44 	,,= }}**%: + f
 	"".00<..:OOK0k&77		#	#	/%#}}==?
%,%?%?"		,	,	8%#}}==?
,,4.2mm.N.N.P

+// 	))1 
	.	.	:%#}}==?
,,4.2mm.J.J.L

+11 	)): }}**"4 + f 77C}}**>> + f ))5}}**)0)K)K + f
 	<<HAAMmm--/e		=	=	I@@ 	6 
	?	?	KBB 	8 }}**E*Jf--9>>o	OS	).44S9
9!QWWYAGGI9 	 
 }}**+/==+R+R, ,S , + f ##/}}**+2+G+G + f
 	!!-##/..:**644@--9AAM,,8++7 GG
w }}**-@ + f
 	$$0..:,g		#	#++EE h"8#=#=>5Eh112 ! 
	%	%	144H+|$k&;&;[=M=M*
 00  
+5 
 

x(89
:*:
J
' 5 
	,	,	8 <<I+%{'<'<k>N>N* 00**077:7N  *%&67M	
+22=A&z2!%%j1 !!*-+ =. }}***.--*W*W 7H6M6M6O)
 7P2j"2	 --88!+(,-=(> 9  7P) +X + + 
f 44}}**37 + f 33}}**38 + f ||}}**"=t}}# + f 66B--<<>

9
9 = }}**/@ + f 00<,g)-)L)L)N&		&	&	2+2+H+H(

3
3 'E }}**'G + f ++7,g)-)L)L)N&		&	&	2+2+H+H(

.
. '@ }}**'G + f 00<,g)-)L)L)N&		&	&	2+2+H+H(

3
3 'D }}**'G + f   }}** $ < <U < K + f }}** $ < <T < J + f ..: mm@@TT\\ mm@@TT\\e }}AACf'AABfk}}**/5 + f '}}**#8$--#P + f M{1
P
T  JJ<CC) D  )s0   {$CE'hCE,h&CE,r>,CE1t>2CF*E16CF'c           	      "   | j                  |      }j                  rA| j                  j                  | j                  j	                  j                              }nj
                  rA| j                  j                  | j                  j	                  j
                              }nBj                  r6| j                  j                  | j                  j	                  d            }j                  @| j                  j                  | j                  j                  j                              }j                  @| j                  j                  | j                  j                  j                              }j                  @| j                  j                  | j                  j                  j                  	      
      }j                  @| j                  j                  | j                  j                  j                  	            }j                  r_| j                  j                  | j                  j!                  | j                  j                   j"                  j$                              }nՉj&                  r_| j                  j                  | j                  j!                  | j                  j                   j"                  j(                              }njj                  ^| j                  j                  | j                  j!                  | j                  j                   j"                  j*                              }j,                  @| j                  j                  | j                  j/                  j,                  	            }j0                  ]| j                  j                  | j                  j3                  j0                              }j0                  rd|j4                  _        j8                  A| j                  j                  | j                  j;                  dj8                              }t=        | j                        }|| j                  j                  |      }t?        | j                        }|| j                  j                  |      }j@                  @| j                  j                  | j                  jC                  j@                  	            }jD                  rD| j                  j                  | j                  j                  jF                  jH                        }jJ                  @| j                  j                  | j                  jM                  jJ                  	            }jN                  6| j                  j                  | j                  jQ                  d	            }jR                  6| j                  j                  | j                  jQ                  d	            }|stU        jV                  tX              jZ                  $jZ                  j]                  t^              | j                  j`                  jb                  jd                  }| j                  j`                  jb                  jf                  }jh                  }||j]                  d      }	|	|	dk(  r|}| j                  ja                  jZ                  j]                  t^              |      |jj                  _6        to        fdtp        D              rXts        | j                        }
| j                  ju                  to        fdtp        D              |
       |jj                  _;        jZ                  j]                  tx              I| j                  j{                  jZ                  j]                  tx               	      |jj                  _>        jZ                  j]                  t~              I| j                  j                  jZ                  j]                  t~               	      |jj                  _A        | j                  j                  j                  | j                  j                  t        |j                  |j                  |j                        |!            }| j                  |j                  |j                        S )"Nr  r^  r^  rD  r  desiredWorkloadCertificatesrX  desiredWorkloadAltsConfigr  desiredGkeOidcConfigr  r  desiredClusterTelemetry"desiredWorkloadMonitoringEapConfigrK  rw  Tr  r  desiredMaster$desiredKubernetesObjectsExportConfigr  desiredDatapathProviderr  r  FrB  rC  rD  c              3   X   K   | ]!  }j                   j                  |      d u # y wr   ra  r  s     ra   r  z/V1Beta1Adapter.UpdateCluster.<locals>.<genexpr>E$  rb  rc  c              3   \   K   | ]#  }j                   j                  |      xs d  % ywre  ra  r  s     ra   r  z/V1Beta1Adapter.UpdateCluster.<locals>.<genexpr>M$  rf  rg  r  rh  )Lr\  r
  r   r   r*  r  r  r  rU  r  rW  r  rY  r  rx  r   rR  r  r  r   rS  r  r   WorkloadMonitoringEapConfigr  r1  rx  r  r   r&  _GetMasterForClusterUpdate1_GetKubernetesObjectsExportConfigForClusterUpdaterO  rv  r  &DesiredDatapathProviderValueValuesEnumr	  r   r  r  rF  r  r	   r;  ri  r  r   rN  rO  rP  rQ  rR  r   rn  rS  r  r  r  r  r  r  r~  r  r  r  r  r  r  rj  rk  r!  r  r  r  r  r  )r  r'  r   r>  rc   kubernetes_objects_export_configrg  rh  r   ri  r  r4  s     `         ra   rl  zV1Beta1Adapter.UpdateCluster#  s   %%k7;F}}**(,(L(L"00 )M ) + f
 
	"	"}}**(,(L(L&88 )M ) + f
 
	*	*}}**(,(L(L )M ) + f ++7}}**&*mm&H&H!(!E!E 'I ' + f &}}**$(MM$D$D ,, %E % + f *}}**#}}::--  ;   + f &&2}}**'+}}'J'J55 (K ( + f ,,}}**"&--"@"@==11EEMM #A # + f
 
	6	6}}**"&--"@"@==11EEQQ #A # + f
 
	.	.	:}}**"&--"@"@==11EENN #A # + f --9}}**-1]]-V-V<< .W . + f ;;G}}**(,(L(L)0)])] )M ) + f
 
	=	=7;,,4)}}**+/==+R+R'*@*@ ,S , + f (?F}}***@f 	:T]]	
 %
 (3}}**/O + f ))5}}***.--*P*P88 +Q + + f }}**mm))PPbb + f %%1}}**&*mm&H&H44 'I ' + f ##/}}**==2242@ + f "".}}**==2252A + f  JJ233)				#	#E	*	6]]..BBLL
}}((<<LL++#$((0+$m+j151J1J++//6Z 2K 2
"". 
 ?N 
 :T]]
 MM(( ,  "4 )  	""1 
			#	#$6	7	C040H0H //334FGG 1I 1
""- 
			#	#J	/	;MM**$3377
CC +  	""3 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c           	      @   	 | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    }| j                  |j                  |j                        S # t        j                  $ r@}t        j                  |t        j                         }| j#                  ||       Y d}~yd}~wt        j$                  $ r)}t        j                  |t        j                         d}~ww xY w)a  Commmit the Autopilot conversion operation.

    Args:
      cluster_ref: cluster resource to commit conversion.

    Returns:
      The operation to be executed.

    Raises:
      exceptions.HttpException: if cluster cannot be found or caller is missing
        permissions. Will attempt to find similar clusters in other zones for a
        more useful error if the user has list permissions.
    r  N)r  r  CompleteConvertToAutopilotr   CContainerProjectsLocationsClustersCompleteConvertToAutopilotRequestr!  r  r  r  r  r  r\   r"  r   r#  r	   r$  r%  r]   r3  s        ra   r  z)V1Beta1Adapter.CompleteConvertToAutopiloti$  s    D;;22MM
--
[
[)'')9)9;;P;P \ b   +*:*:;;00 :**5$2H2HIi
!!+y99(( D$$UD,B,BCCDr5  c                    | j                   j                         }|r| j                  |      nd}|rB|j                  r6|j                  j                  |_        |j                  j
                  |_        |j                  +| j                   j                  |j                        |_        g }|j                  t        j                  |j                        }|j                  t              }|j                  t              }|j                  t              }	d}
d}|j                  t              }|r*|j                  t               }
|j                  t"              }|j                  t$              }d}d}|r*|j                  t&              }|j                  t(              }|j                  t*              }|j                  t,              }|j                  t.              }|j                  t0              }|j                  t2              }|j                  t4              }|j                  t6              }d}d}|r|j                  t8              }|j                  t:              }n| j=                  |      }|j>                  }|j@                  }	|jB                  }|jD                  }
|jF                  }|jH                  }|jJ                  }|jL                  }d}d}d}|jN                  }d}d}|jP                  |_        |xs g |_)        |	g }	d}d}|
2|0|jT                  s$|jV                  s|jX                  |jZ                  | j]                  ||
|      }||| j                   j_                  ||      }d}||(| j                   ja                         }||_1        ||_2        |r+| j                   jg                  ||	||||||||
      |_4        n*| j                   jg                  ||	||||||||
      |_4        |rtk        |      |_6        |jn                  | jq                  |      |_9        | ju                  ||       |S r  );r   rL  r*  rK  r  r  r  r  r%  r   r  r   r  r  r   r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r&  r'  r(  r0  r1  r2  r3  r6  r/  r$  r+   r_  r^  r`  ra  r  r	  r
  r;   r<   rN  rM  r   r5   r  r  r  r  )r  r'  r   r  rK  rX   r  rC  r   r4   r"  r#  r  r  r   r   r(  r   r   r   r  r/  r  r  r  r1   s                             ra   r  z-V1Beta1Adapter.CreateClusterAutoscalingCommon$  s]    --224K.9dook*tG7&&



8
8 , 


7
7 + ++7
--
1
1:: 2  + O++7yy==>f

?3o

?3ozz&!f $$45	,001BC"2"6"67N"O"JJ7	0445HI/334FG#)::.H#I $45 **%67**Y'iZZ-l$*JJz$:!!',D!E$(!	!599:LM&>&B&B''
# 44W=o@@o..f#*#E#E !DD ' P P"FF!DD BBil$+$G$G!$(!-4-L-LK*!0!6BK~fJ%".==88;;G;;G99
$&= $(:(F==//(5F 0 j  $&&2!%!E!E!G2D/
% 8 
--
8
8, .#-.% 3%= 9  2  --
8
8, .#-.% 3%= 9  2 ".45O.Pk+"".'+'J'J
(k$ 	##K<rb   c                     |j                   rc|r|j                  rUt        d |j                  D              }t        d |j                  D              }|r|st        j                  t
              |j                  }|r|j                  rN|j                  j                  du}|j                  j                  du}||k7  rt        j                  t              |j                  rN|j                  j                  du}|j                  j                  du}	|	|k7  rt        j                  t              |j                  rO|j                  j                   du}
|j                  j"                  du}|
|k7  rt        j                  t$              yyy)r6  c              3   Z   K   | ]#  }|j                   d k(  xr |j                  du % ywr8  r;  rW  r<  s     ra   r  z<V1Beta1Adapter.ValidateClusterAutoscaling.<locals>.<genexpr>+%  s4      
3 %'EEMM,EE3   )+c              3   Z   K   | ]#  }|j                   d k(  xr |j                  du % ywr@  r  r<  s     ra   r  z<V1Beta1Adapter.ValidateClusterAutoscaling.<locals>.<genexpr>/%  s4      
3 (*Hu}}D/HH3r  N)r  r+   r  r	   r;  rB  rM  r.   r?  r@  rC  r1   r2   r3   rD  r:   r;   r<   rE  )r  rK  r  cpu_max_setmem_max_setrJ  rK  rL  rM  rN  rO  rP  s               ra   r  z)V1Beta1Adapter.ValidateClusterAutoscaling%  s    --;55 
$33
 
  
$33
 
 +

?@
@;;H		!	!"22;;4G$$334? 	 !O3

KL
L			%00<<DH$//::$F 22

NO
O		(	(++<<DH 	 ++EE 	#  ::

H  ; 
) rb   c           	         |j                         r| j                  ||      }| j                  j                  |j                  |      }| j
                  j                  j                  | j                  j                  t        |j                  |j                  |j                        |            }| j                  |j                  |j                        S |j                         r| j!                  ||      }| j                  j#                  t%        |j                  |j                  |j                  |j                        |      }| j
                  j&                  j)                  |      }n]|j+                         r8| j-                  ||      }| j
                  j&                  j                  |      }nt/        j0                  d      | j                  |j                  |j                        S )Nro  rh  rO  rP  rQ  rT  s           ra   rU  zV1Beta1Adapter.UpdateNodePoolQ%  s   ""$22='Jk}}**)44%0 + f ++99@@
--
,
,)))$$))
  - 	i   1C1CDD		+	+	-44]GLjMM66-%%  %%&&	   7 c ++
;
;
I
I#
N  
	(	(	*&&}g>c++CCJJ3OiJJ899y~~}/A/ABBrb   c                    |j                   %|j                   st        j                  t              |j                  r%|j
                  t        j                  t              d}d}|j
                  v|j
                  D ]/  }|dvst        j                  t        j                  |             |j
                  j                  dd      }|j
                  j                  dd      }| j                  j                  |j
                  du||| j                  j                  j                  j                  |j                  |j                        }|j                   +| j                  j#                  |j                         |_        |j&                  =t        j(                  | j                        j+                  |j&                        |_        ||_        |S )z(Converts options for IPv6-only clusters.Nrx  ry  r  r   )r{  r|  r~  r  r  r  r  )r   r	   r;  7ROUTE_BASED_CLUSTERS_NOT_SUPPORTED_WITH_STACK_TYPE_IPV6r   r   r  r  rl   r   r   r  StackTypeValueValuesEnumIPV6r   r   rY  r  r  r[  r  r  r  r  )r  r   rX   r  r  r~  r  s          ra   rf  z V1Beta1Adapter._ParseIPv6Optionsy%  s   *73J3JJJNOOg77CJJBCCON  ,**#''

5<<<E  +
  1155fdCo0044WdCn]]-- 22$>&(MM,,EEJJ")"F"F#*#H#H . 	F --9
--
2
2<< 3  '
 +"::
--112  "(GNrb   N)r  r  r  r  r  r  r\  rl  r  r  r  rU  rf  rx   rb   ra   rz   rz     s@    QAf	CdL!A:FD<Vp0d&CP*rb   rz   c                   :    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
y	)
r|   zAPIAdapter for v1alpha1.c                    | j                  |      }j                  j                  j                  j                  ؉j
                  ̉j                  j                  j                  j                  j                  j                  j                  xj                  lj                  `j                  Tj                   Hj"                  <j$                  0j&                  $j(                  j*                  j,                  | j/                  d d      |_        j2                  rt5        fdt6        D              rj8                  sUj:                  t<        j:                  vsj>                  +t<        j>                  vrtA        jB                  tD              tF        j2                  vrtA        jB                  tH              jJ                  jJ                  nd}tM        | jN                        }| jN                  jQ                  d||      |jR                  _*        tV        j2                  v rj8                  sUj:                  t<        j:                  vsj>                  +t<        j>                  vrtA        jB                  tX              | jN                  j[                  d      |jR                  _.        t^        j2                  v r+| jN                  ja                  d      |jR                  _1        td        j2                  v r| jN                  jf                  jh                  jj                  }| jN                  jf                  jh                  jl                  }jn                  }||jq                  d      }	|	|	dk(  r|}| jN                  jg                  d|      |jR                  _9        jt                  r|jv                  s*tA        jB                  tx        j{                  d	d
            |j|                  | jN                  j                         |_>        jt                  |j|                  _@        j                  r|jv                  s*tA        jB                  tx        j{                  d	d            |j                  | jN                  j                         |_B        j                  |j                  _D        j                  r+| jN                  j                  j                        |_G        j                  r+| jN                  j                  j                        |_J        j                  S| jN                  j                  j                        |_M        j                  j                   |j                  _O        j                  S|j                  ,| jN                  j                  j                        |_Q        nj                  |j                  _S        j                  `|j                  | jN                  j                         |_Q        | jN                  j                  j                        |j                  _V        j                  ,| jN                  j                  dj                        |_Y        t        || jN                         t        | jN                        |_\        j                  r!| jN                  j                  d      |__        | j                  |j                  |j                        }
|
0| jN                  j                         |_d        |
|j                  _e        |j                  rd |_a        d |_b        j                  rd|_g        j                  |j                  | jN                  j                         |_Q        j                  j                         dk(  r:| jN                  j                  j                  j                  |j                  _l        nj                  j                         dk(  r:| jN                  j                  j                  j                  |j                  _l        n3tA        jB                  t        j{                  j                              j                  H| jN                  j                  j                        |_q        j                  rd|j                  _r        j                  rRjv                  rj                  |j                  _u        n*tA        jB                  tx        j{                  d	d            j                  wj                  j                         dk(  r| j                  |       nGtA        j                  | jN                        j                  j                        |j                  _{        j                  GtA        j                  | jN                        j                  j                        |j                  _~        t        | jN                        |_        t        | jN                        |_        j                  t	        | jN                        |_        j                  t        | jN                        |_        | jN                  j                  t        |j                  |j                        |      }| j                  j                  j                  |      }| j!                  |j"                  |j                        S )NFc              3   :   K   | ]  }|j                   v   y wr   r  r  s     ra   r  z0V1Alpha1Adapter.CreateCluster.<locals>.<genexpr>%  r  r  )r  enableAlphaFeaturesr  Tr  rB  rC  rD  r  rE  r  rF  r  )enablePrivateIpv6Accessr  rH  rI  rJ  rK  rG  r  r  )r  r$  r*  r)  r,  r+  r/  r.  r-  r&  r'  r^  r_  r0  r1  r`  ra  r2  r3  r(  r6  r  r  r  rK  r   r  r  r   rT  r@   rS  r	   r;  r  r  r  r   r  r   r  r  r  r  rM  r  r  r  r  r  rN  rO  rP  rQ  rR  r   r   rS  r  r
  r  rl   rT  rU  rn  r  rV  rW  rX  r  rY  rZ  r  rx  ry  r  r  r|  r  r  r   r  r  r  rO  rv  rw  r   r&  r'  r[  rD  rE  r   r  r  rT  r  r  rR  r\  r  r   r]  r_  r,  r  r`  r
  r	  ra  r  r1  r2  r  r  r+  r^  rZ  rf  r  r  r  r  r[  r  r  rb  rc  rd  re  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  )r  r'  r   rX   enable_alpha_featuresr  rg  rh  r   ri  rj  r  rx  s     `          ra   r  zV1Alpha1Adapter.CreateCluster%  s	   &&{G<G''3??&??&))..:""."".33?**688D==I55A;;G;;G;;G66B55A--944@&&2//; ??
g ~~	<O<	<44"".'"4"44+goo0M

MN
N'..(

IJ
J --9 ** 	
 :T]]
 /3mm.J.J 5/ /K /
+ 
w~~	%44"".'"4"44+goo0M

OP
P040N0N 1O 1
- 
'..	(MM..t.< 	1 
'..	 ]]..BBLL
}}((<<LL++#$((0+$m+j+/==+D+D ,E ,
( ++""jj)00,2P 1 
 	

 
	%	%	-'+}}'I'I'K$

.
. ""5 ""jj)00,- 1 
 	

 
	#	#	+%)]]%E%E%G".5.A.Ag  +"mm99)) : g &&&*mm&I&I11 'J 'g# + $ = ='' !> !g 
	/	/	;666 	3 ))5				& $ ; ;$+$F$F !< !

 .. 	5 ))5				& $ ; ; =
--
0
088 1  4
 ) --
1
1'*@*@ 2  '
 ;$-- 0GG%%%)]]%G%G &H &g" "::'')B)B )!%!?!?!Ag&<g##g"&g---1g*  ,				& $ ; ; =		"	"	(	(	*h	6MM''GGWW 	. $$**,
:MM''GGYY 	. jj5<< 22 = 
 	
 ;;G'+}}'K'K%,%Y%Y (L (g$ 
	=	=15&&.  			%% 	&&7 jj)00,2E 1 
 	
 %				!	!	#v	-w0/3/L/LMM0


7--
. 	"", +262N2N
--3112   / 0GGN 	:T]]	
 ) ||!5gt}}!Mg..:.O
4==/g+ --
,
,{44k6F6FG - C 77>>sCIy~~{/?/?@@rb   c           	         | j                  |      }j                  rA| j                  j                  | j                  j	                  j                              }nj
                  rA| j                  j                  | j                  j	                  j
                              }nBj                  r6| j                  j                  | j                  j	                  d            }j                  @| j                  j                  | j                  j                  j                              }j                  @| j                  j                  | j                  j                  j                              }j                  @| j                  j                  | j                  j                  j                  	      
      }j                  @| j                  j                  | j                  j                  j                  	            }j                  @| j                  j                  | j                  j!                  j                  	            }j"                  0| j                  j                  t%        | j                              }j&                  r_| j                  j                  | j                  j)                  | j                  j(                  j*                  j,                              }nՉj.                  r_| j                  j                  | j                  j)                  | j                  j(                  j*                  j0                              }njj&                  ^| j                  j                  | j                  j)                  | j                  j(                  j*                  j2                              }j4                  @| j                  j                  | j                  j7                  j4                  	            }j8                  ]| j                  j                  | j                  j;                  j8                              }j8                  rd|j<                  _        j@                  A| j                  j                  | j                  jC                  dj@                              }tE        | j                        }|| j                  j                  |      }tG        | j                        }|| j                  j                  |      }jH                  @| j                  j                  | j                  jK                  jH                  	            }jL                  rD| j                  j                  | j                  j                  jN                  jP                        }jR                  6| j                  j                  | j                  jU                  d	            }jV                  6| j                  j                  | j                  jU                  d	            }jX                  0| j                  j                  t[        | j                              }j\                  | j                  j^                  j`                  jb                  | j                  j^                  j`                  j,                  d}j\                  |vr3te        jf                  th        jk                  j\                              | j                  j_                         }|j\                     |_6        | j                  j                  |      }|ste        jf                  tn              jp                  $jp                  js                  tt              | j                  jv                  jx                  jz                  }| j                  jv                  jx                  j|                  }	j~                  }
|
|
js                  d       }||d!k(  r|	}| j                  jw                  jp                  js                  tt              |"      |j                  _A        t        fd#t        D              rXt        | j                        }| j                  j                  t        fd$t        D              |%      |j                  _F        jp                  js                  t              I| j                  j                  jp                  js                  t               	      |j                  _I        jp                  js                  t              I| j                  j                  jp                  js                  t               	      |j                  _L        | j                  j                  j                  | j                  j                  t        |j                  |j                  |j                        |&            }| j                  |j                  |j                        S )'Nr  r^  rp  rD  r  rq  rs  rt  r  rv  r  r  r  r  rx  rz  rK  rw  Tr  r  r|  r~  r  r  r  Fr  r  r  r  rB  rC  rD  c              3   X   K   | ]!  }j                   j                  |      d u # y wr   ra  r  s     ra   r  z0V1Alpha1Adapter.UpdateCluster.<locals>.<genexpr>]'  rb  rc  c              3   \   K   | ]#  }j                   j                  |      xs d  % ywre  ra  r  s     ra   r  z0V1Alpha1Adapter.UpdateCluster.<locals>.<genexpr>e'  rf  rg  r  rh  )Wr\  r
  r   r   r*  r  r  r  rU  r  rW  r  rY  r  rx  r   r  r;  rD  r   rR  r  r  r   rS  r  r   r  r  r1  rx  r  r   r&  r  r  rO  rv  r  r  r	  r  rF  r  r  r9  r  r$  r  r  r	   r;  +ANONYMOUS_AUTHENTICATION_MODE_NOT_SUPPORTEDrl   r  ri  r  r   rN  rO  rP  rQ  rR  r   rn  rS  r  r  r  r  r  r  r~  r  r  r  r  r  r  rj  rk  r!  r  r  r  r  r  )r  r'  r   r>  rc  r  r[  anon_auth_configrg  rh  r   ri  r  r4  s     `           ra   rl  zV1Alpha1Adapter.UpdateCluster&  sC	   %%k7;F}}**(,(L(L"00 )M ) + f
 
	"	"}}**(,(L(L&88 )M ) + f
 
	*	*}}**(,(L(L )M ) + f ++7}}**&*mm&H&H!(!E!E 'I ' + f &}}**$(MM$D$D ,, %E % + f *}}**#}}::--  ;   + f &&2}}**'+}}'J'J55 (K ( + f %%1}}**&*mm&H&H44 'I ' + f *}}** 27DMM J + f ,,}}**"&--"@"@==11EEMM #A # + f
 
	6	6}}**"&--"@"@==11EEQQ #A # + f
 
	.	.	:}}**"&--"@"@==11EENN #A # + f --9}}**-1]]-V-V<< .W . + f ;;G}}**(,(L(L)0)])] )M ) + f
 
	=	=7;,,4)}}**+/==+R+R'*@*@ ,S , + f (?F}}***@f 	:T]]	
 %
 (3}}**/O + f ))5}}***.--*P*P88 +Q + + f }}**mm))PPbb + f ##/}}**==2242@ + f "".}}**==2252A + f ||}}**"=t}}# + f ..: mm99MMUU mm99MMUUe 
	0	0	=jj7>><< ? 
 	

 DDF#G$K$KL}}**/? + f  JJ233)				#	#E	*	6]]..BBLL
}}((<<LL++#$((0+$m+j151J1J++//6Z 2K 2
"". 
 ?N 
 :T]]
 MM(( ,  "4 )  	""1 
			#	#$6	7	C040H0H //334FGG 1I 1
""- 
			#	#J	/	;MM**$3377
CC +  	""3 
	0	0	7	7**'%%{'7'79N9N 	 	+ 	

B rww(8(899rb   c                 H   | j                  ||      }| j                  j                  |t        |j                  |j
                  |j                              }| j                  j                  j                  |      }| j                  |j                  |j
                        S rl  r  r  s         ra   r  zV1Alpha1Adapter.CreateNodePool'  rm  rb   c                 V   d}| j                   j                         }|r| j                  |      }|r'|j                  r|j                  j                  |_        g }|j
                  t        j                  |j
                        }|j                  t              }|j                  t              }|j                  t              }	d}
d}|j                  t              }|r*|j                  t              }
|j                  t              }|j                  t              }d}d}|*|j                  t               }|j                  t"              }|j                  t$              }|j                  t&              }|j                  t(              }|j                  t*              }|j                  t,              }|j                  t.              }|j                  t0              }d}d}|r|j                  t2              }|j                  t4              }n| j7                  |      }|j8                  }|j:                  }	|j<                  }|j>                  }
|j@                  }|jB                  }|jD                  }|jF                  }d}d}d}|jH                  }d}d}|jJ                  |_        |g }||_&        |	g }	d}d}|
2|0|jN                  s$|jP                  s|jR                  |jT                  | jW                  ||
|      }||| j                   jY                  ||      }d}||(| j                   j[                         }||_.        ||_/        |r+| j                   ja                  ||	||||||||
      |_1        n*| j                   ja                  ||	||||||||
      |_1        |rte        |      |_3        |jh                  | jk                  |      |_6        |jn                  +| j                   jq                  |jn                        |_9        | ju                  ||       |S )r  Nr  r  r  );r   rL  r*  rK  r  r%  r   r  r   r  r  r   r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r&  r'  r(  r0  r1  r2  r3  r6  r/  r$  r+   r_  r^  r`  ra  r  r	  r
  r;   r<   rN  rM  r   r5   r  r  r  r  r  r  r  )r  r'  r   r  rX   rK  r  rC  r   r4   r"  r#  r  r  r   r   r(  r   r   r   r  r/  r  r  r  r1   s                             ra   r  z.V1Alpha1Adapter.CreateClusterAutoscalingCommon'  sQ    G--224K,g7&&



8
8 , O++7yy==>f

?3o

?3ozz&!f $$45	,001BC"2"6"67N"O"JJ7		(0445HI/334FG#)::.H#I $45 **%67**Y'iZZ-l$*JJz$:!!',D!E$(!	!599:LM&>&B&B''
# 44W=o@@o..f#*#E#E !DD ' P P"FF!DD BBil$+$G$G!$(!-4-L-LK*o!0K~fJ%".==88;;G;;G99
$&= $(9(E==//(5F 0 j  $&&2!%!E!E!G2D/
% 8 
--
8
8, .#-.% 3%= 9  2  --
8
8, .#-.% 3%= 9  2 ".45O.Pk+"".'+'J'J
(k$ ++7
--
1
1:: 2  + 	##K<rb   c           
         |j                   xs t        }|j                  |z   dz
  |z  }|j                  xs d}|dk(  r|g}n)t	        d|      D cg c]  }dj                  ||       }}g }|j                  |z   dz
  t        |      z  }	|j                  }
|D ]  }|
|	kD  r|	n|
}| j                  j                  ||||j                  | j                  |            }|j                  r| j                  j                  |j                  |j                  |j                  |j                  |j                         |_        |j$                  /t'        | j                  |j$                        |j"                  _        |j*                  rP|j,                  st/        j0                  t2              | j                  j5                  |j*                        |_        |j8                  |j:                  U| j                  j=                         |_        |j8                  |j>                  _         |j:                  |j>                  _!        |jD                  dk(  s|jF                  | j                  jI                         |_%        |jD                  dk(  r9| j                  jH                  jL                  jN                  |jJ                  _(        |jF                  |jF                  |jJ                  _)        |jT                  :| j                  jW                         |_,        |jT                  |jX                  _-        |j]                  |       |
|z  }
 |S c c}w )	r-  rF  r.  r   z{0}-{1}r/  r1  r  rU   )/r   r6  r   r   r   rl   rK  r   r7  r   r8  r   r9  r   r   r   r   rK  r   r:  r;  r   r   r	   r;  r<  r  r=  r"  r#  r>  r.   r?  r@  r   r   rA  rB  r  rU   r  rC  r   rD  rE  r  r   )r  r   r   r   	num_poolsr   rF  rG  r  nodes_per_poolrI  r  rJ  r  s                 ra   r  zV1Alpha1Adapter.ParseNodePools&(  s    	""@&@  	..2	I ++=~NA~"#j
 8=Q	7J7J!)

>1
-7J   E'')3a7C
OKNF!'.!8nve]]## &&,,W5 $ d 
	#	#==<<.. ** **%55%55 = 
 "".,HmmW44-$


) 
	"	"&&

GH
H!%!@!@"44 "A "
 
#
#
/,,8#}}<<>(/(A(A%.5.M.M+

 
 I
-%%1#}}<<>			9	,MM))==EE 	! 
	!	!	-*1*B*B'		+	+	7"&--"B"B"D*1*L*L'll4ofc d Lss   Mc           	          | j                   j                  j                  | j                  j	                  t        |j                  |j                  |j                                    S )N)resource)	r  projectsr  r   $ContainerProjectsGetIamPolicyRequestr!  r  r  r  r{  s     ra   r  zV1Alpha1Adapter.GetIamPolicyy(  sW    ;;,,::+%%{'7'79N9N 	; 	
 rb   c           
         | j                   j                  j                  | j                  j	                  | j                  j                  |      t        |j                  |j                  |j                                    S )N)r  )googleIamV1SetIamPolicyRequestr  )
r  r  r  r   $ContainerProjectsSetIamPolicyRequestGoogleIamV1SetIamPolicyRequestr!  r  r  r  )r  r'  r  s      ra   r  zV1Alpha1Adapter.SetIamPolicy(  st    ;;,,::+/==+W+W ,X , ,%%{'7'79N9N	 	; 	
	 	rb   N)r  r  r  r  r  rl  r  r  r  r  r  rx   rb   ra   r|   r|   %  s2     rAhb:H	CXtQf
rb   r|   c                     | j                   b| j                   j                  d      }|E|dk(  r |j                  j                  j                  S |j                  j                  j
                  S y)z&Gets the Cloud Run load balancer type.Nzload-balancer-typeINTERNAL)r   r   r  LoadBalancerTypeValueValuesEnumLOAD_BALANCER_TYPE_INTERNALLOAD_BALANCER_TYPE_EXTERNAL)r   r   input_load_balancer_types      ra   r  r  (  ss    )&77;;   +	!Z	/##CC__	
 
!
!
A
A
]
] 
rb   c                     |j                   sy | j                         }g }t        j                  |j                         D ]'  \  }}|j	                  |j                  ||             ) ||_        || _         y Nr}  )r  MetadataValuerr  rs  r   r  r  )r   r   r  ru  r~  r  s         ra   r	  r	  (  sj    			
&&((
%MM'"2"23jc5	LL,,E,BC 4"'(!+rb   c                 N    t        j                  || j                        | _        y r   )r   ParseCreateArgsrq  rt  )r   r   s     ra   r  r  (  s     *::{.. +rb   c                     |j                   y | j                         }g }t        j                  |j                         D ]'  \  }}|j	                  |j                  ||             ) ||_        || _        y r  )r   r<  rr  rs  r   r  r  r   )r   r   r   ru  r~  r  s         ra   r  r  (  sm     
""$&
%MM'"5"56jc5	LL**s%*@A 7 %&+rb   c                 Z   |j                   r| j                  s|j                         | _        | j                  j                         }g }t	        j
                  |j                         D ]'  \  }}|j                  |j                  ||             ) ||_        || j                  _	        yy)z#Adds LinuxNodeConfig to NodeConfig.r}  N)
r  r:  r  SysctlsValuerr  rs  r   r  r  sysctls)r   r   r   r  ru  r~  r  s          ra   r  r  (  s     &&$,$<$<$>k!//<<>MEmmG$9$9:
Ull=3353IJ ;).M&*7K' rb   c                 <   |j                   | j                  |j                         | _        |j                   dk(  r0|j                  j                  j                  | j                  _        y|j                  j                  j                  | j                  _        yy)z%Adds WindowsNodeConfig to NodeConfig.Nr8  )r  rF  rA  rB  rC  rD  rE  )r   r   r   s      ra   r  r  (  s     +$$,&.&@&@&Bk#!!Z/

$
$
=
=
Q
Q ##-
 
$
$
=
=
Q
Q ##- ,rb   c                 r   |j                   |j                  |j                   du}|j                  du}||k7  rt        j                  t              |j                         | _        |j                   |j                   | j                  _        |j                  |j                  | j                  _        yyy)z*Adds ShieldedInstanceConfig to NodeConfig.N)	r  r  r	   r;  )BOTH_SHIELDED_INSTANCE_SETTINGS_ERROR_MSGr
  r:   r;   r<   )r   r   r   secure_boot_setintegrity_monitoring_sets        ra   r  r  (  s     "".		.	.	: 22$>O&DDDP22JJ@AA)1)H)H)JK&##/

&
& ((9 ,,8

/
/ ((B 9% 
;rb   c                 `   |j                   }|j                  r.|dk7  r)t        j                  t        j                  |            |j                  s|dk(  rt        j                  t              |dk(  r6|j                  |j                  j                  j                        | _
        y|dk(  r6|j                  |j                  j                  j                        | _
        y|dk(  rC|j                  |j                  j                  j                  d|j                  g      | _
        yy)	z'Adds ReservationAffinity to NodeConfig.specific)affinityr  )consumeReservationTyper  z'compute.googleapis.com/reservation-name)r  r~  valuesN)r4  r5  r	   r;  ARESERVATION_AFFINITY_NON_SPECIFIC_WITH_RESERVATION_NAME_ERROR_MSGrl   @RESERVATION_AFFINITY_SPECIFIC_WITHOUT_RESERVATION_NAME_ERROR_MSGReservationAffinity%ConsumeReservationTypeValueValuesEnumNO_RESERVATIONreservationAffinityANY_RESERVATIONSPECIFIC_RESERVATION)r   r   r   r  s       ra   r  r  (  s'   ))(X3
**IPP 	Q 	
  
		Z!7
**H  &.&B&B';;aapp 'C 'K# 5&.&B&B';;aaqq 'C 'K# :&.&B&B';;aavv5##$ 'C 'K# rb   c                    |j                   d|j                   vrt        j                  t              |j                  j
                  j                  |j                  j
                  j                  d}|j                   d   |vr6t        j                  t        j                  |j                   d               |j	                  ||j                   d            | _
        yy)z!Adds SandboxConfig to NodeConfig.Nr  )unspecifiedgvisorr  )r  r	   r;  SANDBOX_TYPE_NOT_PROVIDEDSandboxConfigr  rT   GVISORSANDBOX_TYPE_NOT_SUPPORTEDrl   sandboxConfig)r   r   r   sandbox_typess       ra   r  r  )  s    __ W__$JJ011--AAMM((<<CCM vm3JJ
$
+
+1H
+
I  !) 6 67??623 !7 !K !rb   c                    | j                   |j                  j                  j                  |j                  j                  j                  |j                  j                  j
                  d}| j                   |vr3t        j                  t        j                  | j                               |j                  || j                            S y)z#Get StableFleetConfig from options.NrT   PERIODIC	AS_NEEDEDr  )maintenanceInterval)
rX  StableFleetConfig"MaintenanceIntervalValueValuesEnum MAINTENANCE_INTERVAL_UNSPECIFIEDr  r  r	   r;  'MAINTENANCE_INTERVAL_TYPE_NOT_SUPPORTEDrl   )r   r   maintenance_interval_typess      ra   rj  rj  ))  s    !!- &&IIjj &&IIRR &&IISS
" ##+EEJJ
1
8
8// 9  
 %%6((
 &  % .rb   c                     |j                   }|_|j                         }d|v r|d   dk(  |_        d|v r
|d   |_        d|v rt	        |d   |      |_        |j                  |      | _        yy)z$Adds notification config to Cluster.Npubsubr  pubsub-topicr  r  )r<  PubSubr  topic_GetFilterFromArgr  NotificationConfignotificationConfig)rX   r   r   ncr  s        ra   ro  ro  D)  s}    """^__F2~(|y0fn'fl2~'8h?fm!)!<!<F!<!KG rb   c                    | sy|j                   j                  j                  |j                   j                  j                  |j                   j                  j                  |j                   j                  j
                  d}|j                         }| j                  d      D ]6  }|j                         }||   s|j                  j                  ||          8 |S )z2Gets a Filter message object from a filter phrase.N)upgradeeventupgradeinfoeventupgradeavailableeventsecuritybulletinevent|)
Filter!EventTypeValueListEntryValuesEnumUPGRADE_EVENTUPGRADE_INFO_EVENTUPGRADE_AVAILABLE_EVENTSECURITY_BULLETIN_EVENTr  r,  	eventTyper   )r  r   flag_event_types_to_enum	to_return
event_types        ra   r  r  S)  s    	 //
;
;
I
I //
;
;
N
N //
;
;
S
S //
;
;
S
S oo)$$S)j!!#J
+  !9*!EF * 
rb   c                    | j                   |j                  j                  j                  |j                  j                  j                  |j                  j                  j
                  |j                  j                  j                  |j                  j                  j                  d}|j                  || j                            S y)z%Gets the ReleaseChannel from options.N)rapidregularstableextendedr  )r  )r;  ReleaseChannelr  RAPIDREGULARSTABLEEXTENDEDrT   )r   r   channelss      ra   rD  rD  m)  s    (((??EE**AAII))@@GG++BBKK''>>JJH ""8G4K4K+L"MM )rb   c                     | j                   c|j                  j                  j                  |j                  j                  j                  d}|j                  || j                   d            S y)z Gets the PatchMode from options.N)acceleratedrR  r   )	patchMode)r  GkeAutoUpgradeConfigPatchModeValueValuesEnumACCELERATEDPATCH_MODE_UNSPECIFIED)r   r   patch_modess      ra   r$  r$  z)  su    % ))BBNN ))BBYYK ((g22156 )   &rb   c                     | j                   }|Y|j                         }d|v r|d   dk(  |_        d|v r
|d   |_        d|v rt	        |d   |      |_        |j                  |      S y)z0Gets the NotificationConfig from update options.Nr  r  r  r  r  )r<  r  r  r  r  r  r  )r   r   r  r  s       ra   r#  r#  )  s{    """^__F2~(|y0fn'fl2~'8h?fm&&f&55 rb   c                     | j                   c| j                  r%| j                  rt        j                  t
              |j                  | j                   | j                  | j                        S y)z'Gets the TpuConfig from update options.Nr  )r   r   r   r	   r;  TPU_SERVING_MODE_ERRORr  )r   r   s     ra   r   r   )  sg    #!F!FJJ-..""++$BB    $rb   c                 &   | j                   | j                  x|j                         }| j                   ,t        | j                   v r9|j                  j                  |j                  j                  j                         t        | j                   v r9|j                  j                  |j                  j                  j                         t        | j                   v r9|j                  j                  |j                  j                  j                         t        | j                   v r9|j                  j                  |j                  j                  j                         | j                  | j                  |_
        |j                  |      S y)z$Gets the Master from create options.NsignalsConfig)r:  r9  MasterSignalsConfigrB   logEnabledComponentsr   ,LogEnabledComponentsValueListEntryValuesEnumrD   rE   rF   r  Masterr   r   rC  s      ra   rb  rb  )  sJ    %		&	&	2))+F&	g))	)##**((UU__	
 
g))	)##**((UU__	
 
w22	2##**((UUhh	
 
'--	-##**((UUcc	
 $$0$::f???00/ 
3rb   c                    | j                   rg | _        | j                  N|j                         }t        | j                  v r9|j                  j                  |j                  j                  j                         t        | j                  v r9|j                  j                  |j                  j                  j                         t        | j                  v r9|j                  j                  |j                  j                  j                         t        | j                  v r9|j                  j                  |j                  j                  j                         |j                  |      S | j                  N|j                  | j                  |j                  j                  j                  g      }|j                  |      S y)z$Gets the Master from update options.Nr	  )r  r	  )r  r:  r	  rB   r	  r   r	  rD   rE   rF   r	  r9  COMPONENT_UNSPECIFIEDr	  s      ra   r  r  )  s~   G$))+FG'''!!((

&
&
S
S
]
] G'''!!((

&
&
S
S
]
] W000!!((

&
&
S
S
f
f +++!!((

&
&
S
S
a
a ???00"".))33((UUkk
 * F ???00 /rb   c                    | j                   yt        d | j                   D              r4t        j                  ddj	                  | j                         z   dz         |j                         }t        | j                   v r?t        | j                         dkD  rt        j                  d      |j                  |      S t        | j                   vrt        j                  d	      |j                  j                  |j
                  j                  j                         t        | j                   v r9|j                  j                  |j
                  j                  j                         t         | j                   v r9|j                  j                  |j
                  j                  j"                         t$        | j                   v r9|j                  j                  |j
                  j                  j$                         t&        | j                   v r9|j                  j                  |j
                  j                  j&                         t(        | j                   v r9|j                  j                  |j
                  j                  j(                         t*        | j                   v r9|j                  j                  |j
                  j                  j*                         t,        | j                   v r9|j                  j                  |j
                  j                  j,                         t.        | j                   v r9|j                  j                  |j
                  j                  j.                         |j                  |      S )
z6Gets the LoggingConfig from create and update options.Nc              3   ,   K   | ]  }|t         v  y wr   )LOGGING_OPTIONSr  cs     ra   r  z$_GetLoggingConfig.<locals>.<genexpr>)  s     ;?a/	!?   [r  z8] contains option(s) that are not supported for logging.rF  3Cannot include other values when None is specified.)componentConfigz6Must include system logging if any logging is enabled.)rS  r  r	   r;  rM  LoggingComponentConfigr?   rK  LoggingConfigr@   enableComponentsr   (EnableComponentsValueListEntryValuesEnumSYSTEM_COMPONENTSrA   	WORKLOADSrC   rB   rD   rE   rF   rG   rH   rI   r	  s      ra   rp  rp  )  s   __ 	;7??;;
**
))GOO
$	%
D	E  **,&	W__
7??aJJLMM!!&!997??"
**M
NN  %%NN``  
""''PPZZ 7??"
""''PPZZ '//!
""''PPZZ 7??*
""''PPcc goo%
""''PP^^  
""''PPYY w&
""''PP__ 
""''PPXX 
				77rb   c                    d}d}| j                   |j                  j                  j                  |j                  j                  j                  |j                  j                  j
                  d}| j                   |vr3t        j                  t        j                  | j                               || j                      }|t        k(  r| j                  t        j                  d| j                  d         s7t        j                  t        j                  d| j                  d               t        j                  d| j                  d         s7t        j                  t        j                  d| j                  d               |j                  | j                  d   | j                  d   | j                  d   	      }|j                  ||
      S )z'Get HostMaintenancePolicy from options.Nr  r  zs$znode-idle-time)fieldr  r  z	min-nodes)nodeIdleTimeWindowmaintenanceAvailabilityWindowminNodesPerPool)r   opportunisticMaintenanceStrategy)rv  HostMaintenancePolicyr  r  r  r  r	   r;  ,HOST_MAINTENANCE_INTERVAL_TYPE_NOT_SUPPORTEDrl   r  r  research-OPPORTUNISTIC_MAINTENANCE_FIELD_NOT_SUPPORTED OpportunisticMaintenanceStrategy)r   r   op_typeparsed_maintenance_interval parsed_opportunistic_maintenancer  s         ra   r  r   *  s    $%)"&&2 **MMnn **MMVV **MMWW
" ((0JJJJ
6
=
=44 >  
 #=))# W>>J99w001AB JJ
7
>
>$556FG ?   99UG==hGHJJ
7
>
>55h? ?   	11&@@   +2*K*K+ $==kJ 	2 	
 % 
	'	'5'G 
( 
 rb   c                     d}| j                   }|j                  j                  }|dk(  r|j                  }n|dk(  r|j                  }|j                  |      S )zCGets the ManagedOpenTelemetryConfig from create and update options.Nr?   )COLLECTION_AND_INSTRUMENTATION_COMPONENTSr  )rW  ManagedOpenTelemetryConfigr  r?   r>	  )r   r   r   
otel_scopescope_value_enums        ra   rt  rt  ]*  sc    
%))*))>>  6!!E@@FFE		,	,5	,	99rb   c                    d}d}d}|j                         }| j                  |j                  | j                        }| j                  xd}| j                  dk(  r!|j                  j
                  j                  }n/| j                  dk(  r |j                  j
                  j                  }|j	                  |      |_        ||_	        | j                  | j                  |s@| j                  4| j                  dk7  r%| j                  st        j                  t              |rd}| j                  dk(  r!|j                  j
                  j                  }n/| j                  dk(  r |j                  j
                  j                  }|j                  |      }|j	                  |      |_        n| j                  r|j                  d      }d}| j                  dk(  r!|j                  j
                  j                  }n/| j                  dk(  r |j                  j
                  j                  }|j	                  |      |_        nG|j                  d      }|j	                  |j                  j
                  j                        |_        ||_	        t        | d      r7| j                  +|j                  | j                         }d|_        ||_	        | j                   )t#        d	 | j                   D              r4t        j                  d
dj%                  | j                         z   dz         |j'                         }t        | j                   v r6t)        | j                         dkD  rt        j                  d      ||_        |S t,        | j                   vrt        j                  d      |j.                  j1                  |j&                  j2                  j4                         t6        | j                   v r9|j.                  j1                  |j&                  j2                  j8                         t:        | j                   v r9|j.                  j1                  |j&                  j2                  j<                         t>        | j                   v r9|j.                  j1                  |j&                  j2                  j>                         t@        | j                   v r9|j.                  j1                  |j&                  j2                  j@                         tB        | j                   v r9|j.                  j1                  |j&                  j2                  jB                         tD        | j                   v r9|j.                  j1                  |j&                  j2                  jF                         tH        | j                   v r9|j.                  j1                  |j&                  j2                  jH                         tJ        | j                   v r9|j.                  j1                  |j&                  j2                  jJ                         tL        | j                   v r9|j.                  j1                  |j&                  j2                  jL                         tN        | j                   v r9|j.                  j1                  |j&                  j2                  jN                         tP        | j                   v r9|j.                  j1                  |j&                  j2                  jP                         tR        | j                   v r9|j.                  j1                  |j&                  j2                  jR                         tT        | j                   v r9|j.                  j1                  |j&                  j2                  jT                         tV        | j                   v r9|j.                  j1                  |j&                  j2                  jV                         ||_        | jX                  r|j[                  d      }| j\                  r|j[                  d      }| j^                  rd}	| j^                  ja                         }
|
dk(  r!|jZ                  jb                  jd                  }	n|
dk(  r!|jZ                  jb                  jf                  }	n|
dk(  r!|jZ                  jb                  jh                  }	nY|
dk(  r!|jZ                  jb                  jj                  }	n3t        j                  tl        jo                  | j^                              |r|j[                  |jp                  |	      }n|j[                  |	      }| jr                  r2|r|j[                  |jp                  d      }n|j[                  d      }| jt                  r2|r|j[                  |jp                  d      }n|j[                  d      }|||yt        |d      r||_;        |S )z9Gets the MonitoringConfig from create and update options.Nr  rk  r?   r  TFr  c              3   ,   K   | ]  }|t         v  y wr   )MONITORING_OPTIONSr"	  s     ra   r  z'_GetMonitoringConfig.<locals>.<genexpr>*  s     
C0B11&&0Br$	  r%	  r  z;] contains option(s) that are not supported for monitoring.rF  r&	  z<Must include system monitoring if any monitoring is enabled.)r  r  INTERNAL_CLUSTER_SERVICEINTERNAL_VPC_LBEXTERNAL_LBr  )r  	relayMode)rH	  )r  enableRelay)rI	  r  )<MonitoringConfigrU  ManagedPrometheusConfigrV  AutoMonitoringConfigr  rk  r?   autoMonitoringConfigr  r=  r	   r;  r	  r  r  rT  r  rM  MonitoringComponentConfigrK  r'	  r@   r*	  r   r+	  r,	  rA   r-	  rC   rB   rD   rE   rJ   HPA_COMPONENTrK   rL   rM   rN   rO   rP   rQ   rR   rS   r  #AdvancedDatapathObservabilityConfigr  r  r  RelayModeValueValuesEnumr  rE	  rF	  rG	  DPV2_OBS_ERROR_MSGrl   r  r  r  r  )r   r   r  is_prometheus_enabledcomppromadv_obsrC  r   
relay_mode	opts_names              ra   rr  rr  k*  s    
$	$'$$&&&&2++11 , D $$0e		&	&%	/--BBFF((F2--BBGG"*"?"?e"?"Ld%)F" ''/

'
'
3 --5))V3!!JJOPP	e		&	&%	/--BBFF((F2--BBGG--6K-Ld"*"?"?e"?"Ld			--d-;de		&	&%	/--BBFF((F2--BBGG"*"?"?e"?"Ld --e-<d"*"?"?--BBGG #@ #d &*F" W23))5--999 . d #'d'+f$# 
C0B0B
CCJJ
IIg(()*IJ  --/Dw!!!	W	 1	$jjNOO!%W'''JJ
H  	  **SSee 7%%%
""

,
,
U
U
_
_ W'''
""

,
,
U
U
_
_ G&&&
""

,
,
U
U
_
_ W///
""

,
,
U
U
h
h '$$$
""

,
,
U
U
]
] ***
""

,
,
U
U
Y
Y g   
""

,
,
U
U
Y
Y G&&&
""

,
,
U
U
_
_ W'''
""

,
,
U
U
`
` g(((
""

,
,
U
U
a
a 7%%%
""

,
,
U
U
^
^ '$$$
""

,
,
U
U
]
] w!!!
""

,
,
U
U
Z
Z ###
""

,
,
U
U
\
\ "F((:::NG)):::OG,,J77==?IJ

6
6
O
O
X
X  
0	0

6
6
O
O
h
h  
'	'

6
6
O
O
_
_  
m	#

6
6
O
O
[
[  JJ

#
#:: $  
 <<-- = g << = g 33<<--4 = g <<<Ng44<<--5 = g <<<Og	\dlwV:;18F.	-rb   c                     | j                   | j                  L|j                         }| j                   | j                   |_        | j                  | j                  |_        |S y)z;Gets the KubernetesObjectsExportConfig from create options.N)rI  rJ  KubernetesObjectsExportConfigkubernetesObjectsChangesTarget kubernetesObjectsSnapshotsTargetr	  s      ra   rd  rd  C+  ss     //;		4	4	@335F00<

3
3 + 22>

5
5 - M 
Arb   c                     | j                   | j                  Ud}d}| j                   | j                   }|dk(  rd}| j                  | j                  }|dk(  rd}|j                  ||      S y)z;Gets the KubernetesObjectsExportConfig from update options.Nr?   rD  )r\	  r[	  )rI  rJ  rZ	  )r   r   changes_targetsnapshots_targets       ra   r  r  U+  s     //;		4	4	@N00<@@n	6	!22> DD	V	#11)9'5 2   
Arb   c                    |j                   g }|j                  |j                        | _        t	        |j                         D ]#  }|j                  |j                  |             % |j                  |      | j                  _        yy)zFAdds all PSC private cluster options to cluster during create cluster.N)r  r  )r  )	rN  r  r   r  r   r   r  r  r  )rX   r   r   r  r   s        ra   r[  r[  k+  s     &&2E#+#@#@"77 $A $G  W>>?
ll8,,
,CD @ 	##%#0   3 3rb   c                     | j                   j                  j                  }|dk(  r"| j                   j                  j                  }|S |dk(  r | j                   j                  j                  }|S )z3Converts a location policy string to an enum value.rV   rW   )r9  r.  r/  rV   rW   )r   r   location_policy_enums      ra   r:  r:  {+  sv     ""@@\\  
"$$BBKK  
	 %$$BBFF  
rb   c                     d| z   dz   |z   S )N	projects/z/locations/rx   )r  r  s     ra   r  r  +  s    	w		.	99rb   c                 &    t        | |      dz   |z   S )Nz
/clusters/r  )r  r  rX   s      ra   r!  r!  +  s    	(	+l	:W	DDrb   c                 (    t        | ||      dz   |z   S )Nz/nodePools/)r!  )r  r  rX   rY   s       ra   r#  r#  +  s#    Wh8rb   c                 &    t        | |      dz   |z   S )Nz/operations/rf	  )r  r  rx  s      ra   rV  rV  +  s    	(	+n	<y	HHrb   c                 $    d| z   dz   |z   dz   |z   S )Nrd	  z	/regions/z/subnetworks/rx   )r  regionr   s      ra   ProjectLocationSubnetworkrk	  +  s8     	 		
 	rb   c                 2   t        j                  t        dz   |       }|r|d   } | j                  d      }t	        |      dk(  r|d   dk(  r|d   dk(  r
|d	   d
k(  r| S t        j                  t
        |      r|d|j                  d       }t        |||       S )z0Converts a subnetwork name to a subnetwork path.$rF  /   r   r  r]  regions   subnetworksNr_  )r6	  matchSUBNETWORK_URL_PATTERNr  rK  ZONE_PATTERNrfindrk	  )r   r  r  rs	  partss        ra   r/  r/  +  s    
(()C/
<%
qJ


3
%	%jAo
(j
 
(i

(m
#XXlH%-(..-.H	"7Hj	AArb   c           	         t        j                  t        |       }|s)t        j                  t
        j                  |             t        j                  t        j                  t        t        | j                  d                  }t        j                  d|      }|s)t        j                  t        j                  |            t        |j!                  d            }||z  S )zPCalculates the number of nodes needed for a given TPU topology and machine type.)topologyr  z(\d+)t$)r  rF  )r6	  	fullmatchTPU_TOPOLOGY_PATTERNr	   r;  'TPU_TOPOLOGY_INCORRECT_FORMAT_ERROR_MSGrl   	functoolsreduceoperatormulmaprU  r  r7	  'MACHINE_TYPE_INCORRECT_FORMAT_ERROR_MSGgroup)r  r  rs	  resultchips_matchnum_chips_per_vms         ra   r  r  +  s    
,,+\
:%	
**/666M  HLL#c<3E3Ec3J*KL&		*l3+	
**/66% 	7 	
 
 **1-.	#	##rb   c                 B    | j                  dd      j                         S )a   Converts an evaluation or enforcement mode to lowercase format.

  e.g. Converts 'PROJECT_SINGLETON_POLICY_ENFORCE' to
  'project-singleton-policy-enforce'

  Args:
    mode: An evaluation or enforcement mode.

  Returns:
    The mode in lowercase form.
  _r_  )replacer,  r  s    ra   NormalizeBinauthzModer	  +  s     
c3		%	%	''rb   c                     |t         j                  j                  k(  rddgS t        | j                  j
                  j                               }|j                  d       t        |      S )z9Returns all valid options for --binauthz-evaluation-mode.r   PROJECT_SINGLETON_POLICY_ENFORCEEVALUATION_MODE_UNSPECIFIED)	r   rg   rh   r8  r  EvaluationModeValueValuesEnumto_dictr2  r   )r   rm   r   s      ra    GetBinauthzEvaluationModeOptionsr	  +  s_     d''***:;;""@@HHJ' 
.../	rb   c                 |    | j                   j                  }||j                  |j                  |j                  fv ryy)NFT)r  r	  r	  r  r	  )r   evaluation_modeevaluation_mode_enums      ra   r  r  +  sH    ""@@  66##;; 
 	rb   c                     t        | j                  j                  j                               }|j	                  d       t        |      S )z<Returns all valid options for the enforcement-mode dict key.ENFORCEMENT_MODE_UNSPECIFIED)r8  r  r  r	  r2  r   )r   r   s     ra   !GetBinauthzEnforcementModeOptionsr	  +  s=    ;;CCE' 
../0	rb   c                     | j                   j                  j                  }|dk(  r"| j                   j                  j                  }|S |dk(  r | j                   j                  j                  }|S )zConverts a logging variant string to an enum value.

  Args:
    messages: The API messages module.
    variant: The logging variant string.

  Returns:
    The logging variant enum value.
  ra  MAX_THROUGHPUT)r  VariantValueValuesEnumVARIANT_UNSPECIFIEDra  r	  )r   r  variant_config_enums      ra   r  r  ,  sw     ##::NN  	%%<<DD  
	 ""%%<<KK  
rb   c                 j   |j                         }| j                  |j                   j                  j                  |j                   j                  j                  d}| j                  |vr3t        j                  t        j                  | j                              || j                     |_	        |S )z:Configures the AnonymousAuthenticationConfig from options.r  r  )
r$  r  r  r  r  r	   r;  r  rl   r  )r   r   rC  r[  s       ra   r  r  ,  s    113&,,8 22FFNN 22FFNNE ..e;JJ
5
<
<:: =  
 ??@FK	-rb   c                 J   | j                   |j                  j                  j                  |j                  j                  j                  d}| j                   |vr3t        j                  t        j                  | j                               || j                      |_	        |S )z;Configures the Fleet MembershipType from options and fleet.r  r  )
rf  r  r(  r  r  r	   r;  MEMBERSHIP_TYPE_NOT_SUPPORTEDrl   r  )r   r   r  typess       ra   r  r  2,  s    ( NN88DD NN88TTE e+JJ
'
.
.** /  
 !!8!89E	,rb   c                 j   |j                         }| j                  |j                   j                  j                  |j                   j                  j                  d}| j                  |vr3t        j                  t        j                  | j                              || j                     |_	        |S )z'Gets the EnterpriseConfig from options.r  r  r  )
EnterpriseConfigr  DesiredTierValueValuesEnumSTANDARDr  r	   r;  CLUSTER_TIER_NOT_SUPPORTEDrl   desiredTier)r   r   enterprise_configtierss       ra   r  r  G,  s    //1\\ %%@@II %%@@KKE ||5 JJ188gll8KLL$)',,$7!	rb   c                 j   |j                         }| j                  |j                   j                  j                  |j                   j                  j                  d}| j                  |vr3t        j                  t        j                  | j                              || j                     |_	        |S )z.Gets the DesiredEnterpriseConfig from options.r	  r	  )
DesiredEnterpriseConfigr  r	  r	  r  r	   r;  r	  rl   r	  )r   r   desired_enterprise_configr	  s       ra   r9  r9  Y,  s    &>>@\\ ,,GGPP ,,GGRRE ||5 JJ188gll8KLL,1',,,?)	""rb   c                    | j                   j                         dk(  r |j                  j                  j                  S | j                   j                         dk(  r |j                  j                  j
                  S | j                   j                         dk(  r |j                  j                  j                  S | j                   j                         dk(  r |j                  j                  j                  S g d}|r|j                  d       t        j                  t        j                  | j                   j                         |            )z:Converts a confidential node type string to an enum value.sevsev_snptdxr  )r	  r	  r	  )r  choices)r@  r,  rR  'ConfidentialInstanceTypeValueValuesEnumSEVSEV_SNPTDX&CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIEDr   r	   r;  $CONFIDENTIAL_NODE_TYPE_NOT_SUPPORTEDrl   )r   r   r  r	  s       ra   rT  rT  k,  s   ##))+u4""JJNN %%++-:""JJRR %%++-6""JJNN %%++-;""JJqq (GnnZ 
**,33//557 	4 	
 rb   c                    |j                         }| j                  |j                   j                  j                  |j                   j                  j                  |j                   j                  j
                  d}| j                  |vr3t        j                  t        j                  | j                              || j                     |_
        |S )z(Gets the NetworkTierConfig from options.)r  premiumznetwork-default)r  )NetworkTierConfigr  NetworkTierValueValuesEnumNETWORK_TIER_STANDARDNETWORK_TIER_PREMIUMNETWORK_TIER_DEFAULTr	   r;  NETWORK_TIER_NOT_SUPPORTEDrl   networkTier)r   r   network_tier_confignetwork_tierss       ra   r  r  ,  s     224% &&AAWW &&AAVV &&AAVV
M =0JJ
$
+
+9M9M
+
N  '4G4H4H&I#	rb   c                 j   |j                         }| j                  |j                   j                  j                  |j                   j                  j                  d}| j                  |vr3t        j                  t        j                  | j                              || j                     |_	        |S )z)Gets the ControlPlaneEgress from options.r  )r  )
r  r  r  r?   r  r	   r;  "CONTROL_PLANE_EGRESS_NOT_SUPPORTEDrl   r  )r   r   control_plane_egresscontrol_plane_egress_modess       ra   r  r  ,  s    !446&&2 '';;@@ '';;MM" ((0JJJJ
,
3
3(/(I(I 4  
 !;))! 
rb   )F(  r  
__future__r   r   r   r}	  r	  rI  r6	  r_  apitools.base.pyr   r\   r   googlecloudsdk.api_lib.computer    googlecloudsdk.api_lib.containerrt  r	   googlecloudsdk.api_lib.utilr
   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.util.apisr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   r   r   r   r   googlecloudsdk.core.consoler   r   googlecloudsdk.core.utilr   rr  	six.movesr   six.moves.http_clientr@  r<  rH  rL  r  NO_AUTOPROVISIONING_MSGrB  rF  rG  rC  rD  rE  r  (LIMITS_WITHOUT_AUTOPROVISIONING_FLAG_MSGrY  r  r  r  r  r  r  r  r  r  r  r  r  r  .CLOUD_LOGGING_OR_MONITORING_DISABLED_ERROR_MSGr  r  r  r  rM  r   r<  r  ri  r  r9  r:  r  r  r  r  ra  rR	  r  r  r	  r]  rd  r  r  r  r  r	  r)  r  r  r5	  r8	  rW  r1  r5  r	  r	  r|	  r	  r	  r  r	  r  r	  r6  %MAX_AUTHORIZED_NETWORKS_CIDRS_PRIVATE$MAX_AUTHORIZED_NETWORKS_CIDRS_PUBLICr  rK   r  r  r  r  r  r  r  r  r  r  r  r  rN  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r   r  r  r  DEFAULT_ADDONSr  VISIBLE_CLOUDRUN_ADDONSADDONS_OPTIONSBETA_ADDONS_OPTIONSALPHA_ADDONS_OPTIONSr?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rO	  rL   rM   rN   rO   rP   rQ   rR   rS   r!	  rD	  PRIMARY_LOGS_OPTIONSPLACEMENT_OPTIONSLOCATION_POLICY_OPTIONSrt	  ru	  r{	  r  r  r_   rn   rt   rr   rq   rp   rv   r   r   r   objectr   r  r  r  r  r  r  rw   rz   r|   r  r	  r  r  r  r  r  r  r  rj  ro  r  rD  r$  r#  r   rb  r  rp  r  rt  rr  rd  r  r[  r:  r  r!  r#  rV  rk	  r/  r  r	  r	  r  r	  r  r  r  r  r9  rT  r  r  rx   rb   ra   <module>r	     s   . &  '   	 	  > ) 4 G 1 9 ( . : < # * < $ 2 8 * 
  & 
+ - # * &
 ( $' #) %4 07 3
> :- )
, (. *9 "0 + '/ +* &) %) %( $' #5 16 27 3! 2 .6 22 .= 98 48 48 40 ,I E 7 3, (2 .3 /8 4D @E A- )   H "   + '$  ! % !< 8. *' #6 20 ,1 -2 .$  . *  + '+ '( $/ +! ; 7& " " (+ %') $
 !	
#-/ % 
1 1 # ) ""# $ % 1 # ! 	8 $ 	
3 ' 9 3y)%, #  %	(   +j\9 		
	) !

	

	
 	

! & 	  #I. %u-  H  %6 
.L)351,  8F*nI6 nIbdI6 dIN
6 
f KCF KC\dF dNX[ X[vv
 DY DN8fn fR""8  8>$6L4
N 6	1<1D98x:z:Up$,  :EIB$$,(

0,*$#$:.rb   