
                             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 e	j                   G d	 d
e	j                               Zy)z,Command for spanner instances get-locations.    )absolute_import)division)unicode_literalsN)	instances)base)flagsc                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)GetLocationsz>Get the location of every replica in a Cloud Spanner instance.EXAMPLESz        To get the location of every replica in a Cloud Spanner instance in this project, run:

          $ {command} my-instance-id
        c                     t        j                         j                  |        | j                  dddd       | j                  j                  d       y)a<  Args is called by calliope to gather arguments for this command.

    For `get-locations` command, we have one positional argument, `instanceId`
    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    z	--verboseF
store_truez>Indicates that both regions and types of replicas be returned.)requiredactionhelpz'table(location:sort=1,type.if(verbose))N)r   InstanceAddToParseradd_argumentdisplay_info	AddFormat)parsers    .lib/surface/spanner/instances/get_locations.pyArgszGetLocations.Args)   sP     
NN  (
M	  O
 !!"OP    c                 V    t        j                  |j                  |j                        S )zThis is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. From `Args`, we extract command line
        arguments

    Returns:
      List of dict values for locations of instance
    )r   r
   instanceverbose)selfargss     r   RunzGetLocations.Run:   s     !!$-->>r   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r    r   r   r
   r
      s?    F 
(//  - Q Q 
?r   r
   )r#   
__future__r   r   r   r$   googlecloudsdk.api_lib.spannerr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.spannerr   UniverseCompatibleCommandr
   r(   r   r   <module>r/      sD    3 &  '  4 ( 4 '?4<< '? '?r   