
    %                     J   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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.                  j0                  e
j.                  j2                         G d de
j4                               Zy)z)Vertex AI Tensorboard run create command.    )absolute_import)division)unicode_literals)encoding)client)base)	constants)endpoint_util)flags)
validation)labels_util)logc                 8   t        j                  | d       t        j                  dd      j                  |        t        j                  d      j                  |        t        j                  |        t        j                  d      j                  |        y )Nzto create a Tensorboard runztensorboard-runT)required)r   #AddTensorboardExperimentResourceArgGetDisplayNameArgAddToParserGetDescriptionArgr   AddCreateLabelsFlagsGetTensorboardRunIdArgparsers    )lib/surface/ai/tensorboard_runs/create.py_AddArgsr       ss    ++F,IK+d;GGO+,88@""6*-99&A    c                    | j                   j                  j                         }|j                         d   }t	        j
                  ||      5  t        j                  |      }|j                  ||       }t        j                  |      }d|v r1t        j                  j                  dj                  |d                |cddd       S # 1 sw Y   yxY w)'Create a new Vertex AI Tensorboard run.locationsId)region)versionnamez&Created Vertex AI Tensorboard run: {}.N)CONCEPTStensorboard_experimentParseAsDictr
   AiplatformEndpointOverridesr   TensorboardRunsClientCreater   MessageToPyValuer   statusPrintformat)argsr    tensorboard_exp_refr   tensorboard_runs_clientresponseresponse_msgs          r   _Runr2   )   s    <<BBD%%'6&00H$::7K&--.A4HH,,X6L	jj@HH
v
  ! IHHs   A4CCc                   .    e Zd ZdZddiZed        Zd Zy)
CreateBetar   EXAMPLESa            To create a Tensorboard Run `my-tensorboard-run` in Tensorboard `12345` and Tensorboard Experiment `my-tensorboard-experiment, with the display name `my tensorboard run`:

              $ {command} my-tensorboard-experiment --tensorboard-run-id=my-tensorboard-run --tensorboard-id=12345 --display-name="my tensorboard run"

          You may also provide a description and/or labels:

              $ {command} my-tensorboard-experiment --tensorboard-run-id=my-tensorboard-run --tensorboard-id=12345 --description="my description" --labels="label1=value1" --labels="label2=value2"

          To create a Tensorboard Run `my-tensorboard-run` in Tensorboard `12345`, Tensorboard Experiment `my-tensorboard-experiment, region `us-central1`, and project `my-project`:

              $ {command} projects/my-project/locations/us-central1/tensorboards/12345/experiments/my-tensorboard-experiment --tensorboard-run-id=my-tensorboard-run
          c                     t        |        y N)r   r   s    r   ArgszCreateBeta.ArgsL   s
    Vr   c                 t    t        j                  |j                         t        |t        j
                        S r7   )r   ValidateDisplayNamedisplay_namer2   r	   BETA_VERSION)selfr-   s     r   RunzCreateBeta.RunP   s)    ""4#4#45i,,--r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr8   r>    r   r   r4   r4   7   s/    / -"  .r   r4   N)rB   
__future__r   r   r   apitools.base.pyr   *googlecloudsdk.api_lib.ai.tensorboard_runsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.air	   r
   r   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   r   r2   ReleaseTracksReleaseTrackBETAALPHACreateCommandr4   rE   r   r   <module>rR      s    0 &  ' % = ( 3 7 / 4 < #B D%%**D,=,=,C,CD.## . E.r   