
    
                         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<Command to list jobs for a specified Batch project/location.    )absolute_import)division)unicode_literals)
list_pager)jobs)base)resource_args)
propertiesc                   .    \ rS rSrSr\S 5       rS rSrg)List   a  List jobs for a specified Batch project/location.

This command can fail for the following reasons:
* The project/location specified do not exist.
* The active account does not have permission to access the given
project/location.

## EXAMPLES
To print all the jobs under all available locations for the default project,
run:

  $ {command}

To print all the jobs under projects/location
`projects/foo/locations/us-central1`, run:

  $ {command} --project=foo --location=us-central1
c                     [         R                  " U 5        [        R                  R	                  U 5        U R
                  R                  S5        g )Nz9table(name, name.segment(3):label=LOCATION, status.state))r	   AddLocationResourceArgsr   URI_FLAGRemoveFromParserdisplay_info	AddFormat)parsers    lib/surface/batch/jobs/list.pyArgs	List.Args2   s9    ))&1MM""6*
!!C    c           	      j   U R                  5       n[        R                  " U5      nUR                  =(       d2    [        R
                  R                  R                  R                  5       nUR                  =(       d2    [        R
                  R                  R                  R                  5       nU(       a  SR                  XT5      nOSR                  US5      n[        R                  " UR                  UR                  R!                  UUR"                  S9UR"                  SUR$                  SS9$ )Nzprojects/{}/locations/{}-)parentpageSizer   r   )
batch_sizefieldlimitbatch_size_attribute)ReleaseTrackr   
JobsClientlocationr
   VALUESbatchGetprojectcore	GetOrFailformatr   YieldFromListservicemessages%BatchProjectsLocationsJobsListRequest	page_sizer   )selfargsrelease_trackclientr#   r'   r   s          r   RunList.Run:   s    %%'M__]+F}}F
 1 1 7 7 @ @ D D FHllHj//44<<FFHG)00Cf)00#>f##==^^ 	> 	
 >>jj'
 
r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r4   __static_attributes__r6   r   r   r   r      s     &  r   r   N)r;   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.batchr   googlecloudsdk.callioper    googlecloudsdk.command_lib.batchr	   googlecloudsdk.corer
   UniverseCompatibleListCommandr   r6   r   r   <module>rF      sJ     C &  ' ' - ( : * 14 1 1r   