
                             d 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m	Z	 ddl
mZ dd	lmZ dd
lmZ d Z G d dej"                        Zy)zbigtable clusters list command.    )absolute_import)division)unicode_literalsN)
list_pager)util)base)	arguments)	resourcesc                 t    t         j                  j                  | j                  d      j	                         S )Nz)bigtableadmin.projects.instances.clusters)
collection)r
   REGISTRYParseRelativeNamenameSelfLink)resources    %lib/surface/bigtable/clusters/list.py_GetUriFunctionr      s2    				-	-mm< 
. 
>>FhjI    c                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)ListClustersz List existing Bigtable clusters.EXAMPLESz          To list all clusters in an instance, run:

            $ {command} --instances=my-instance-id

          To list all clusters in multiple instances, run:

            $ {command} --instances=my-instance-id,my-other-instance-id

          c                     t        j                  | d       | j                  j                  d       | j                  j	                  t
               | j                  j                  t         j                         y)z Register flags for this command.zto list clusters fora  
          table(
            name.segment(3):sort=1:label=INSTANCE,
            name.basename():sort=2:label=NAME,
            location.basename():label=ZONE,
            serveNodes:label=NODES,
            defaultStorageType:label=STORAGE,
            state
          )
        N)r	   AddInstancesResourceArgdisplay_info	AddFormat
AddUriFuncr   AddCacheUpdaterInstanceCompleter)parsers    r   ArgszListClusters.Args5   s^     %%f.DE
!! 	# 	 ""?3
''	(C(CDr   c              #     K   t        j                         }|j                  j                  j	                         }|j                  d      st        j                  d      g}|D ]`  }t        j                         j                  |j                               }t        j                  |j                  |dd      D ]  }|  b yw)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.

    Yields:
      Some value that we want to have printed later.
    	instances-)parentclustersN)fieldbatch_size_attribute)r   GetAdminClientCONCEPTSr"   ParseIsSpecifiedGetInstanceRefGetAdminMessages1BigtableadminProjectsInstancesClustersListRequestRelativeNamer   YieldFromListprojects_instances_clusters)selfargscliinstance_refsinstance_refmsgclusters          r   RunzListClusters.RunF   s      


CMM++113MK(**3/0m%



!<<!..0 = 2 
  --

)
)
#	%'
 % &s   CCN)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr    r9    r   r   r   r   $   s?    ( 
(// 	 	- E E r   r   )r=   
__future__r   r   r   r>   apitools.base.pyr   googlecloudsdk.api_lib.bigtabler   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler	   googlecloudsdk.corer
   r   ListCommandr   rB   r   r   <module>rJ      s=    & &  '  ' 0 ( 9 )I:4## :r   