
                         >   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJr  SSK
Jr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  \R&                  " \R(                  R*                  \R(                  R,                  5       " S S\R.                  5      5       rg)z,Command to get credentials of a GEC cluster.    )absolute_import)division)unicode_literals)util)cluster)base)flags)
kubeconfig)resource_args)log)	resourcesc                   z    \ rS rSrSr\R                  \R                  R                  SS9S.r	\
S 5       rS rSrg	)
GetCredentials    z-Get credentials of an edge-container cluster.zEdge Container)kind)EXAMPLESDESCRIPTIONc                     [         R                  " US5        [        R                  " U5        [        R                  " U5        g )Nzto get credentials)r   AddClusterResourceArgr	   AddAuthProviderCmdPathAddOfflineCredential)clsparsers     <lib/surface/edge_cloud/container/clusters/get_credentials.pyArgsGetCredentials.Args+   s/    ''0DE	  (	v&    c                 <   [         R                  " 5         [        R                  R	                  UR
                  R                  R                  5       R                  5       SS9n[        R                  " U R                  5       5      n[        R                  " U R                  5       5      nUR                  UR                  5       S9nUR                  R                  U5      n[         R"                  " UR$                  UR&                  UR(                  5      n[        R*                  " U5      (       a  UR,                  b  UR,                  R.                  c  [0        R2                  " S5        gUR5                  5       nUR                  5       Ul        UR                  R7                  U5      n	USU	R8                  -   S-   -  n[         R:                  " XgU	5        [0        R<                  " SU	R>                  -   5        g[         R@                  " U R                  5       UR(                  UR$                  UR&                  5      n
[         RB                  " UR(                  UR$                  UR&                  5      n[         RD                  " XgURF                  X5        g)	z!Runs the get-credentials command.z)edgecontainer.projects.locations.clusters)
collection)nameNzMOffline credential is currently supported only in local control plane cluster__offlinez'This offline credential will expire at )$container_utilCheckKubectlInstalledr   REGISTRYParseRelativeNameCONCEPTSr   ParseRelativeNamer   GetMessagesModuleReleaseTrackGetClientInstance0EdgecontainerProjectsLocationsClustersGetRequestprojects_locations_clustersGetr
   GenerateContext
projectsIdlocationsId
clustersIdIsOfflineCredentialcontrolPlanelocalr   errorFEdgecontainerProjectsLocationsClustersGenerateOfflineCredentialRequestGenerateOfflineCredentialuserId&GenerateKubeconfigForOfflineCredentialwarning
expireTimeGenerateAuthProviderCmdArgsGenerateExecAuthCmdArgsGenerateKubeconfigauth_provider_cmd_path)selfargscluster_refmessagescluster_clientreqrespcontextoffline_credential_reqoffline_credential_respcmd_argsexec_auth_argss               r   RunGetCredentials.Run1   s<   ((*$$66##%224> 7 K
 %%d&7&7&9:H++D,=,=,?@N

C
C%%' D C 5599#>D(( 7 79O9OG ""4((				"d&7&7&=&=&E		$	
 

Y
Y
[  (3'?'?'A$

4
4
N
N$ 
 .555
BBg77
0 
kk
3#../
 77





 
 

 
 

!
!	h "99

 
 

 
 

!
!n ##
44hr    N)__name__
__module____qualname____firstlineno____doc__r
   COMMAND_EXAMPLECOMMAND_DESCRIPTIONformatdetailed_helpclassmethodr   rN   __static_attributes__rP   r   r   r   r       sL    5 ,,33:: ; - ' '
:r   r   N)rU   
__future__r   r   r    googlecloudsdk.api_lib.containerr   r#   +googlecloudsdk.api_lib.edge_cloud.containerr   googlecloudsdk.callioper   /googlecloudsdk.command_lib.edge_cloud.containerr	   r
   r   googlecloudsdk.corer   r   ReleaseTracksr+   ALPHAGACommandr   rP   r   r   <module>rf      sv    3 &  ' C ? < ( A F I # ) D%%++T->->-A-ABJT\\ J CJr   