
                         $   d 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dl	m
Z
 dZ ej                  ej                  j                  ej                  j                  ej                  j                          G d	 d
ej"                               Zy)zLists AlloyDB clusters.    )absolute_import)division)unicode_literals)api_util)base)
propertieszL
    table(
        name,
        network,
        state:label=STATUS
    )
c                   0    e Zd ZdZdddZed        Zd Zy)ListzList AlloyDB clusters in a given project and region.

  List AlloyDB clusters in a given project in alphabetical
  order based on the cluster name.
  z{description}zS        To list clusters, run:

          $ {command} --region=us-central1
        )DESCRIPTIONEXAMPLESc                 j    | j                  ddd       | j                  j                  t               y)zsConstructs and sends request.

    Args:
      parser: argparse.Parser: Parser object for command line inputs.
    z--region-zRegional location (e.g. asia-east1, us-east1). See the full list of regions at https://cloud.google.com/sql/docs/instance-locations. Default: list clusters in all regions.)defaulthelpN)add_argumentdisplay_info	AddFormatCLUSTER_FORMAT)parsers    $lib/surface/alloydb/clusters/list.pyArgsz	List.Args6   s8     7  9 !!.1    c                    t        j                  | j                               }|j                  }|j                  }|j
                  j                  dt        j                  j                  j                  j                  |j                        }t        j                  |j                  |j                  |j!                               d|j"                  |j$                  d      }|S )zConstructs and sends request.

    Args:
      args: argparse.Namespace, An object that contains the values for the
          arguments specified in the .Args() method.

    Returns:
      ProcessHttpResponse of the request made.
    zalloydb.projects.locations)
projectsIdlocationsId)parentclusterspageSize)fieldlimit
batch_sizebatch_size_attribute)r   AlloyDBClientReleaseTrackalloydb_clientalloydb_messagesresource_parserCreater   VALUEScoreproject	GetOrFailregion YieldFromListHandlingUnreachableprojects_locations_clusters+AlloydbProjectsLocationsClustersListRequestRelativeNamer    	page_size)selfargsclientr%   r&   location_refresults          r   RunzList.RunF   s     ##D$5$5$78F**N..))00$$$))11;;KK 1 !L
 6622DD,,. 	E 	
 jj>>'	F Mr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r8    r   r   r
   r
   "   s1     		- 2 2r   r
   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.alloydbr   googlecloudsdk.callioper   googlecloudsdk.corer   r   ReleaseTracksr$   ALPHABETAGAListCommandr
   r?   r   r   <module>rI      s|     &  ' 3 ( * D%%++T->->-C-C%%((*?4 ?*?r   