
    P                        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lmZ dd	lmZ  e	j                   e	j"                  j$                         G d
 de	j&                               Z e	j                   e	j"                  j*                  e	j"                  j,                         G d de	j&                               Zy)z3Command for listing named ports in instance groups.    )absolute_import)division)unicode_literals)base_classes)instance_groups_utils)base)flags)
propertiesc                   >    e Zd ZdZed        Zd Zej                  Z	y)GetNamedPortsz/Implements get-named-ports command, GA version.c                     t        j                         t        _        t        j                  j	                  |        | j
                  j                  d       y Nztable(name, port))instance_groups_flagsMakeZonalInstanceGroupArgr   ZonalInstanceGroupArgAddArgumentdisplay_info	AddFormatparsers    @lib/surface/compute/instance_groups/unmanaged/get_named_ports.pyArgszGetNamedPorts.Args!   sA     	779 '''33F;
!!"56    c                    t        j                  | j                               }t        j                  j
                  j                  j                  d      }t        j                  j                  ||j                  t        j                  |j                  |            }t        j                   ||j                        S )$Retrieves response with named ports.Trequired)scope_lister)r   ComputeApiHolderReleaseTrackr
   VALUEScoreprojectGetr   r   ResolveAsResource	resourcesr	   GetDefaultScopeListerclientr   OutputNamedPortsForGroupselfargsholderr#   	group_refs        r   RunzGetNamedPorts.Run(   s    **4+<+<+>?F$$,,00$0?G++==&""44w( 	> 	) 
 !996==" "r   N
__name__
__module____qualname____doc__staticmethodr   r/   r   +INSTANCE_GROUP_GET_NAMED_PORT_DETAILED_HELPdetailed_help r   r   r   r      s,    77 7
" GG r   r   c                   >    e Zd ZdZed        Zd Zej                  Z	y)GetNamedPortsBetaz=Implements get-named-ports command, alpha, and beta versions.c                 x    t         j                  j                  |        | j                  j	                  d       y r   )r   MULTISCOPE_INSTANCE_GROUP_ARGr   r   r   r   s    r   r   zGetNamedPortsBeta.Args<   s+    77CCFK
!!"56r   c           	         t        j                  | j                               }t        j                  j
                  j                  j                  d      }t        j                  j                  ||j                  t        j                  j                  t        j                  |j                   |            }t#        j$                  ||j                         S )r   Tr   )default_scoper   )r   r   r    r
   r!   r"   r#   r$   r   r<   r%   r&   r	   	ScopeEnumZONEr'   r(   r   r)   r*   s        r   r/   zGetNamedPortsBeta.RunA   s    **4+<+<+>?F$$,,00$0?G;;MM&""//..44w( 	N 	)  !996==" "r   Nr0   r8   r   r   r:   r:   8   s,    E7 7" GG r   r:   N)r4   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   2googlecloudsdk.command_lib.compute.instance_groupsr   googlecloudsdk.corer
   ReleaseTracksr    GAListCommandr   BETAALPHAr:   r8   r   r   <module>rL      s    : &  ' 7 @ ( 4 ] * D%%(()ID$$ I *I4 D%%**D,=,=,C,CDI(( I EIr   