
                             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dlmZ d	d
dZ G d dej                        Zee_        y)z#services vpc-peerings list command.    )absolute_import)division)unicode_literals)peering)base)util)
propertieszp        This command lists connections of a network to a service via VPC peering
        for a project.
        a+          To list connections of a network called `my-network` to a service called
        `your-service`, run:

          $ {command} --network=my-network --service=your-service

        To list connections of a network against all services, run:

          $ {command} --network=my-network

        )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)ListzDList connections to a service via VPC peering for a project network.c                 X    | j                  dddd       | j                  dddd	
       y)zArgs is called by calliope to gather arguments for this command.

    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	--networkNETWORKTzGThe network in the current project to list connections with the service)metavarrequiredhelpz	--serviceSERVICE zThe service to list connections)r   defaultr   N)add_argument)parsers    )lib/surface/services/vpc_peerings/list.pyArgsz	List.Args3   sD     V	   .	  0    c                 *   t         j                  j                  j                  j	                  d      }t        j                  |      }|j                  d      r|j                  nd}t        j                  |||j                        }t        |      S )zRun 'services vpc-peerings list'.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
          with.

    Returns:
      The list of connections.
    T)r   service-)r	   VALUEScoreprojectGetprojects_utilGetProjectNumberIsSpecifiedr   r   ListConnectionsnetworkiter)selfargsr    project_numberr   connss         r   RunzList.RunH   ss     $$,,00$0?G"33G<N"..y9dllsG##NGT\\JE;r   N)__name__
__module____qualname____doc__staticmethodr   r,    r   r   r   r   0   s    L0 0(r   r   N)r0   
__future__r   r   r   googlecloudsdk.api_lib.servicesr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.projectsr   r"   googlecloudsdk.corer	   _DETAILED_HELPDescribeCommandr   detailed_helpr2   r   r   <module>r;      sM    * &  ' 3 ( E *	

	,&4 &R $ r   