
    +	                         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 instances list command.    )absolute_import)division)unicode_literalsN)
list_pager)util)base)
properties)	resourcesc                 \    t        j                  | j                        j                         S )N)r   GetInstanceRefnameSelfLink)resources    &lib/surface/bigtable/instances/list.py_GetUriFunctionr      s     			X]]	+	4	4	66    c                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)ListInstancesz!List existing Bigtable instances.EXAMPLESzI          To list all instances, run:

            $ {command}
          c                 x    | j                   j                  d       | j                   j                  t               y)z Register flags for this command.zu
          table(
            name.basename():sort=1,
            displayName,
            state
          )
        N)display_info	AddFormat
AddUriFuncr   )parsers    r   ArgszListInstances.Args.   s3     !! #  ""?3r   c                 z   t        j                         }t        j                  j	                  t
        j                  j                  j                  j                  d      d      }t        j                         j                  |j                               }t        j                  |j                  |dd      S )	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bigtableadmin.projects)
collection)parent	instancesN)fieldbatch_size_attribute)r   GetAdminClientr
   REGISTRYParser	   VALUEScoreprojectGetGetAdminMessages)BigtableadminProjectsInstancesListRequestRelativeNamer   YieldFromListprojects_instances)selfargscliproject_refmsgs        r   RunzListInstances.Run:   s     


C$$**&&**D*9+ + -K 


!
K
K'') L +C##!	# #r   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r4    r   r   r   r   "   s=    ) 
(//  - 	4 	4#r   r   )r8   
__future__r   r   r   r9   apitools.base.pyr   googlecloudsdk.api_lib.bigtabler   googlecloudsdk.callioper   googlecloudsdk.corer	   r
   r   ListCommandr   r=   r   r   <module>rD      s<    ' &  '  ' 0 ( * )7,#D$$ ,#r   