
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr  \
R                   " S
 S\
R                  5      5       rg)z'logging logs list' command.    )absolute_import)division)unicode_literals)
list_pager)util)base)
properties)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)List   zList your project's logs.

Only logs that contain log entries are listed.

## EXAMPLES

To list all logs in current project:

  $ {command}

To list all logs for a view:

  $ {command} --bucket=[BUCKET_ID] --location=[LOCATION] --view=[VIEW_ID]
c                 <   [         R                  R                  U 5        [         R                  R                  U 5        U R                  R                  S5        U R                  SS9nUR                  SSSSS9  UR                  S	SS
S9  UR                  SSSS9  g )Nztable(.:label=NAME)zUThese arguments are used in conjunction with the parent to construct a view resource.)helpz
--locationTLOCATIONzLocation of the log bucket.)requiredmetavarr   z--bucketzId of the log bucket.)r   r   z--viewzId of the view.)r   PAGE_SIZE_FLAGRemoveFromParserURI_FLAGdisplay_info	AddFormatadd_argument_groupadd_argument)parser
view_groups      lib/surface/logging/logs/list.pyArgs	List.Args/   s    ((0MM""6*
!!"78**% + &J *	  ,
 $  &        c           	      x   [         R                  R                  R                  R	                  SS9n[
        R                  R                  USS9nUR                  5       nUR                  S5      (       ab  [        R                  " [        R                  " [        R                  " USUR                  5      SUR                  5      SUR                  5      n[        R                  " 5       R!                  US	9n["        R$                  " [        R&                  " 5       R(                  US
UR*                  SSS9nU$ )zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  The list of logs.
T)r   zcloudresourcemanager.projects)
collectionview	locationsbucketsviews)parentlogNamesNpageSize)fieldlimit
batch_sizebatch_size_attribute)r	   VALUEScoreprojectGetr
   REGISTRYParseRelativeNameIsSpecifiedr   CreateResourceNamelocationbucketr"   GetMessagesLoggingProjectsLogsListRequestr   YieldFromList	GetClientprojects_logsr*   )selfargsr/   project_refr&   requestresults          r   RunList.RunE   s	    $$,,00$0?G$$**; + =K%%'F &&

!
!%%fk4==I&'.		;f
  ??v?NG%%&&jj')F Mr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rB   __static_attributes__rD   r   r   r   r      s         *#r   r   N)rI   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   googlecloudsdk.corer	   r
   UniverseCompatibleListCommandr   rD   r   r   <module>rS      sL     # &  ' ' / ( * ) I4 I Ir   