
                             S r SSKJr  SSKJr  SSKJr  SSK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 rS r\R(                   " S S\R*                  5      5       rg)z!bigtable operations list command.    )absolute_import)division)unicode_literalsN)
list_pager)util)actions)base)	arguments)
properties)	resourcesc                 n    [         R                  R                  U R                  SS9R	                  5       $ )Nzbigtableadmin.operations
collection)r   REGISTRYParseRelativeNamenameSelfLink)resources    'lib/surface/bigtable/operations/list.py_GetUriFunctionr       s1    				-	-mm+ 
. 
--5XZ8    c                 r    U R                  S5      nUR                  S5      nSR                  USS 5      nU$ )z*Get operation name without project prefix.r   /   N)getsplitjoin)r   operation_nameresults
short_names       r   _TransformOperationNamer!   &   s<     <<'.  %'xx$*	r   c                   x    \ rS rSrSr\R                  " S5      \R                  " S5      S.r\S 5       r	S r
Srg	)
ListOperations0   zList Cloud Bigtable operations.z4          List Cloud Bigtable operations.
          aS            To list all operations for the default project, run:

            $ {command}

          To list all operations for instance INSTANCE_NAME, run:

            $ {command} --instance=INSTANCE_NAME

          To fail the command if any location is unreachable, run:

            $ {command} --return-partial-success=false
          )DESCRIPTIONEXAMPLESc                 X   [         R                  " U SSS9  [        R                  " SS[        R
                  " S5      S9R                  U 5        U R                  R                  S5        U R                  R                  [        5        U R                  R                  S	[        05        g
)z Register flags for this command.zto list operations forFrequiredz--return-partial-successTz          If true, operations that are reachable are returned as normal, and
          those that are unreachable are returned in the `unreachable` field of
          the response. If false, the command will fail if any location is unreachable.
          )defaulthelpa)  
          table(
             name():label=NAME,
             done,
             metadata.firstof(startTime, requestTime, progress.start_time).date():label=START_TIME:sort=1:reverse,
             metadata.firstof(endTime, finishTime, progress.end_time).date():label=END_TIME
           )
        r   N)r
   AddInstanceResourceArgr	   ArgumenttextwrapdedentAddToParserdisplay_info	AddFormat
AddUriFuncr   AddTransformsr!   )parsers    r   ArgsListOperations.ArgsG   s     $$V%=.35 	MM"__   k&
!! #  ""?3
%%v/F&GHr   c                    [         R                  " 5       nS[        R                  R	                  [
        R                  R                  R                  R                  SS9SS9R                  5       -   nUR                  S5      (       a  US-   UR                  -   n[         R                  " 5       R                  UUR                  S9n[         R"                  " UR$                  US	S
S9$ )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:
  Some value that we want to have printed later.
zoperations/Tr(   zbigtableadmin.projectsr   instancez/instances/)r   returnPartialSuccess
operationsN)fieldbatch_size_attribute)r   GetAdminClientr   r   Parser   VALUEScoreprojectGetRelativeNameIsSpecifiedr9   GetAdminMessages4BigtableadminOperationsProjectsOperationsListRequestreturn_partial_successr   YieldFromListoperations_projects_operations)selfargscliref_namemsgs        r   RunListOperations.Runa   s     


Cy1177&&**D*9+  8  --9\^<H 
##M)DMM9h 		=	=!%!<!< 
> 
>  ##**!	# #r    N)__name__
__module____qualname____firstlineno____doc__r.   r/   detailed_helpstaticmethodr6   rP   __static_attributes__rR   r   r   r#   r#   0   sM    ' __ &  // # 	-& I I2#r   r#   )rW   
__future__r   r   r   r.   apitools.base.pyr   googlecloudsdk.api_lib.bigtabler   googlecloudsdk.callioper   r	   #googlecloudsdk.command_lib.bigtabler
   googlecloudsdk.corer   r   r   r!   DefaultUniverseOnlyListCommandr#   rR   r   r   <module>rc      s_    ( &  '  ' 0 + ( 9 * )8 L#T%% L# L#r   