
                         @   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  \R                   " \R"                  R$                  \R"                  R&                  \R"                  R(                  5       " S S\R*                  5      5       rg)zbigtable hottablets command.    )absolute_import)division)unicode_literalsN)
list_pager)util)base)	arguments)timesc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	ListHotTablets   z-List hot tablets in a Cloud Bigtable cluster.EXAMPLESa              Search for hot tablets in the past 24 hours:

              $ {command} my-cluster-id --instance=my-instance-id

            Search for hot tablets with start and end times by minute:

              $ {command} my-cluster-id --instance=my-instance-id --start-time="2018-08-12 03:30:00" --end-time="2018-08-13 17:00:00"

            Search for hot tablets with start and end times by day:

              $ {command} my-cluster-id --instance=my-instance-id --start-time=2018-01-01 --end-time=2018-01-05
          c                     [         R                  " U S5        [         R                  " U S5        [         R                  " U S5        U R                  R                  S5        g)z Register flags for this command.zto list hot tablets forzto search for hot tabletsa[  
      table(
        tableName.basename():label=TABLE,
        nodeCpuUsagePercent:label=CPU_USAGE:sort=1:reverse,
        startTime.date('%Y-%m-%dT%H:%M:%S%Oz', undefined='-'):label=START_TIME,
        endTime.date('%Y-%m-%dT%H:%M:%S%Oz', undefined='-'):label=END_TIME,
        startKey:label=START_KEY,
        endKey:label=END_KEY
      )
    N)r	   AddClusterResourceArgAddStartTimeArgsAddEndTimeArgsdisplay_info	AddFormat)parsers    (lib/surface/bigtable/hot_tablets/list.pyArgsListHotTablets.Args5   sR     ##F,EFv'BCV%@A
 !! 	# 		    c              #     #    [         R                  " 5       nUR                  R                  R	                  5       n[         R
                  " 5       R                  UR                  5       UR                  =(       a     [        R                  " UR                  5      UR                  =(       a     [        R                  " UR                  5      S9n[        R                  " UR                  USSS9 H  nUv   M	     g7f)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.

Yields:
  Some value that we want to have printed later.
)parent	startTimeendTime
hotTabletsN)fieldbatch_size_attribute)r   GetAdminClientCONCEPTSclusterParseGetAdminMessages;BigtableadminProjectsInstancesClustersHotTabletsListRequestRelativeName
start_timer
   FormatDateTimeend_timer   YieldFromList&projects_instances_clusters_hotTablets)selfargsclicluster_refmsg
hot_tablets         r   RunListHotTablets.RunJ   s      


C--''--/K 		D	D++-ooO%*>*>t*OMMIe&:&:4==&I 
E 
K  !..22!	#

 #s   C;C= N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r3   __static_attributes__r5   r   r   r   r      s=     6 
//  -" 	 	(r   r   )r:   
__future__r   r   r   r;   apitools.base.pyr   googlecloudsdk.api_lib.bigtabler   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler	   googlecloudsdk.core.utilr
   ReleaseTracksReleaseTrackGABETAALPHAListCommandr   r5   r   r   <module>rL      s    # &  '  ' 0 ( 9 * D%%(($*;*;*@*@%%++-ET%% E-Er   