
    
                        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 d
 Zd Z ej                  ej                   j"                  ej                   j$                         G d dej&                               Zy)z:Command to read Tensorboard time series data in Vertex AI.    )absolute_import)division)unicode_literals)client)base)	constants)endpoint_util)flagsc                     t        j                  | d       t        j                         j                  |        t        j                  d      j                  |        y )Nzto read dataztensorboard-time-series)r
   #AddTensorboardTimeSeriesResourceArg(AddTensorboardTimeSeriesMaxDataPointsArgAddToParserAddFilterArgparsers    .lib/surface/ai/tensorboard_time_series/read.py_AddArgsr      sC    ++FNC002>>vF./;;FC    c                 F   | j                   j                  j                         }|j                         d   }t	        j
                  ||      5  t        j                  |      j                  || j                  | j                        }|cd d d        S # 1 sw Y   y xY w)NlocationsId)versionregion)r   )tensorboard_time_series_refmax_data_pointsdata_filter)CONCEPTStensorboard_time_seriesParseAsDictr	   AiplatformEndpointOverridesr   TensorboardTimeSeriesClientReadr   filter)argsr   r   r   responses        r   _Runr&   "   s     $ E E K K M&--/>&00f&11'BGG$?,,KK H !H & & &s   >BB c                   .    e Zd ZdZddiZed        Zd Zy)ReadBetazPRead the Tensorboard time series data from the given Tensorboard time series id.EXAMPLESa3            To read Tensorboard Time Series `123` data in Tensorboard `12345`, Tensorboard Experiment `my-tensorboard-experiment, Tensorboard Run `my-tensorboard-run`, region `us-central1`, and project `my-project`:

              $ {command} projects/my-project/locations/us-central1/tensorboards/12345/experiments/my-tensorboard-experiment/runs/my-tensorboard-run/timeSeries/123

          Or with flags:

              $ {command} 123 --tensorboard-id=12345 --tensorboard-experiment-id=my-tensorboard-experiment --tensorboard-run-id=my-tensorboard-run
          c                     t        |        y N)r   r   s    r   ArgszReadBeta.Args?   s
    Vr   c                 6    t        |t        j                        S r+   )r&   r   BETA_VERSION)selfr$   s     r   RunzReadBeta.RunC   s    i,,--r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr,   r0    r   r   r(   r(   .   s/    X -  .r   r(   N)r4   
__future__r   r   r   1googlecloudsdk.api_lib.ai.tensorboard_time_seriesr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   r	   r
   r   r&   ReleaseTracksReleaseTrackBETAALPHACommandr(   r7   r   r   <module>rA      su    A &  ' D ( 3 7 /D	 D%%**D,=,=,C,CD.t|| . E.r   