
    M                        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
SS.rSrSrSrSrSrSrSrS\-   rS rS rS r\R2                  " \R4                  R6                  5       " S S\R8                  5      5       rg)zCommand to list GDCE clusters.    )
list_pager)util)base)resource_args)log)
properties)	resourcesz*        List Edge Container clusters.
    zc    To list the clusters in region us-central1, run:

      $ {command} --location=us-central1
    z    This command uses the edgecontainer/v1alpha API. The full documentation for    this API can be found at: https://cloud.google.com/edge-cloud
    )DESCRIPTIONEXAMPLESzAPI REFERENCEa  
      table(
        name.basename():label=NAME,
        endpoint:label=ENDPOINT,
        labels:label=LABELS,
        controlPlaneVersion:label=CONTROL_PLANE_VERSION,
        nodeVersion:label=NODE_VERSION,
        createTime.date():label=CREATED
      )
      )edgecontainer.projects.locations.clustersv1v1alphaz
--locationzMParent Edge Container location to list all contained Edge Container clusters.zWhttps://cloud.google.com/distributed-cloud/edge/latest/docs/release-notes#March_14_2024zDEPRECATION: Cluster {} is hosting a control plane in the cloud, which is now deprecated. Please migrate all clusters to host the control plane locally on edge-cloud machines: c                    ^  U 4S jnU$ )Nc                    > TUS'   SUS'   [         R                  R                  " U R                  40 UD6R	                  5       $ )Napi_versionr   
collection)r	   REGISTRYParsenameSelfLink)clusterkwargsr   s     1lib/surface/edge_cloud/container/clusters/list.pyUriFunc'GetUriFromResourceFunc.<locals>.UriFuncI   s@    'F=FF<##GLL;F;DDFF     )r   r   s   ` r   GetUriFromResourceFuncr   H   s    G 
.r   c                 \    U R                   S L =(       d    U R                   R                  S L $ )N)controlPlanelocalr   s    r   IsRCPClusterr#   P   s)    				%	K)=)=)C)Ct)KKr   c                     [        U 5      (       aC  U R                  S:w  a3  [        R                  " [        R                  U R                  5      5        g)NPROVISIONINGT)r#   statusr   warningDEPRECATION_WARNING_TEMPLATEformatr   r"   s    r   PrintWarningsAndReturnTruer*   T   s7    'w~~?KK,33GLLAB	r   c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)	ListAlpha\   zList Edge Container clusters.c                     [         R                  " U 5        U R                  R                  [        5        U R                  R                  [        [        5      5        g)zRegister flags for this command.

Args:
  parser: An argparse.ArgumentParser-like object. It is mocked out in order
    to capture some information, but behaves like an ArgumentParser.
N)r   (AddLocationOptionalResourceArgForListingdisplay_info	AddFormatDISPLAY_TABLE
AddUriFuncr   V1_ALPHA_API_VERSION)parsers    r   ArgsListAlpha.Argsb   sA     ::6B
!!-0
""#9:N#OPr   c           
      T   [         R                  " U R                  5       5      n[         R                  " U R                  5       5      n[        R
                  nUR                  =(       d#    UR                  R                  R                  SS9nUR                  =(       d#    UR                  R                  R                  SS9n[        R                  " UR                  UR                  SU SU 3UR                  UR                   S9UR                  SUR"                  S[$        S9$ )	zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Some value that we want to have printed later.
T)requiredz	projects/z/locations/)parentpageSizefilterclustersr;   )
batch_sizefieldlimitbatch_size_attribute	predicate)r   GetClientInstanceReleaseTrackGetMessagesModuler   VALUESprojectcoreGetlocationedge_containerr   YieldFromListprojects_locations_clusters1EdgecontainerProjectsLocationsClustersListRequest	page_sizer<   r@   r*   )selfargscluster_clientmessagesvals
project_idrJ   s          r   RunListAlpha.Runn   s     ++D,=,=,?@N%%d&7&7&9:HDE!2!2!6!6!6!EJ}}O 3 3 < < @ @$ @ OH##22BBzl+hZ@^^;; 	C 	

 >>jj',. .r   r   N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr6   rV   __static_attributes__r   r   r   r,   r,   \   s#    %-	Q 	Q.r   r,   N)r\   apitools.base.pyr   +googlecloudsdk.api_lib.edge_cloud.containerr   googlecloudsdk.callioper   /googlecloudsdk.command_lib.edge_cloud.containerr   googlecloudsdk.corer   r   r	   r]   r2   CLUSTERS_COLLECTION_NAMEV1_API_VERSIONr4   LOC_FLAGLOC_FLAG_HELP"RCP_DEPRECATION_RELEASE_NOTES_LINKr(   r   r#   r*   ReleaseTracksrD   ALPHAListCommandr,   r   r   r   <module>rn      s    % ' < ( I # * )			$	
 G   (" #')KL L D%%++,-.   -. --.r   