
                         F   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 e	j                   e	j                  e	j                  j                   e	j                  j"                         G d
 de	j$                                      Zd Zddde_        y)zCommand for listing spokes.    )absolute_import)division)unicode_literals)networkconnectivity_api)networkconnectivity_util)base)flags)utilc                   &    e Zd ZdZed        Zd Zy)
ListSpokeszWList hub spokes.

  Retrieve and display a list of all spokes associated with a hub.
  c                    t         j                  j                  |        t        j                  |        t        j
                  |        t        j                  | d       | j                  j                  t        j                         y )NzGassociated with the returned list of
                            spokes)r   URI_FLAGRemoveFromParserr	   AddSpokeLocationsFlagAddViewFlagAddHubResourceArgdisplay_info	AddFormatr
   LIST_SPOKES_FORMAT)parsers    4lib/surface/network_connectivity/hubs/list_spokes.pyArgszListSpokes.Args%   se     	MM""6* 
'	f	F %& ' !!$"9"9:    c                    | j                         }t        |j                  |      }t        j                  |      }|j
                  j                  j                         }|j                  ||j                  |j                  d d |      S )N)spoke_locationslimitorder_byfilter_expressionview)ReleaseTrack
ViewToEnumr   r   
HubsClientCONCEPTShubParseListHubSpokesr   r   )selfargsrelease_trackr   clienthub_refs         r   RunzListSpokes.Run3   s|    %%'Mdii/D$//>Fmm%%'G,,jj    r   N)__name__
__module____qualname____doc__staticmethodr   r,    r   r   r   r      s     
 ; ;r   r   c                     t        j                  |      j                  }| dk(  r|j                  j                  S |j                  j
                  S )z,Converts the typed view into its Enum value.detailed)r   GetMessagesModule?NetworkconnectivityProjectsLocationsGlobalHubsListSpokesRequestViewValueValuesEnumDETAILEDBASIC)r   r)   list_hub_spokes_reqs      r   r!   r!   A   sK    0BB=Q  R  R	Z22;;;		0	0	6	66r   z   To list all spokes in the ``us-central1'' region and the global location, run:

        $ {command} HUB --spoke-locations=us-central1,global
  z   This command uses the networkconnectivity/v1 API. The full documentation
  for this API can be found at:
  https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest
  )EXAMPLESzAPI REFERENCEN)r0   
__future__r   r   r   +googlecloudsdk.api_lib.network_connectivityr   r   googlecloudsdk.callioper   /googlecloudsdk.command_lib.network_connectivityr	   r
   DefaultUniverseOnlyReleaseTracksr    BETAGAListCommandr   r!   detailed_helpr2   r   r   <module>rF      s     " &  ' O P ( A @ D%%**D,=,=,@,@A!!  B D7

 r   