
                         ,   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	d
Ze	j                   e	j                   e	j"                  j$                  e	j"                  j&                         G d de	j(                                      Zee_        y)z/Create command for Colab Enterprise Executions.    )
operations)util)
executions)base)endpoint_util)flagszS
        Create a notebook execution to be used on a Colab Enterprise runtime.
    a  
        To create an execution of a notebook file with Cloud Storage URI `gs://my-bucket/my-notebook.ipynb`, with an execution job display name `my-execution`, compute configured from runtime template `my-runtime-template-id`, running with service account `my-service-account@my-project.iam.gserviceaccount.com`, with results uploaded to Cloud Storage bucket `gs://my-bucket/results`, and in region `us-central1` run:

         $ {command} --display-name=my-execution --runtime-template=my-runtime-template-id --gcs-notebook-uri=gs://my-bucket/my-notebook.ipynb --service-account=my-service-account@my-project.iam.gserviceaccount.com --gcs-output-uri=gs://my-bucket/results --region=us-central1
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)CreatezCreate an execution.c                 .    t        j                  |        y)z Register flags for this command.N)r   AddCreateExecutionFlags)parsers    &lib/surface/colab/executions/create.pyArgszCreate.Args+   s     
!!&)    c           
      |   | j                         }t        j                  | j                               }|j                  j                  j                         }|j                         d   }t        j                  d|      5  t        j                  |      }|j                  }|j                  t        j                  ||            }t        j                  t        j                   |      |t        j"                  |j$                        t        j&                  |      ddd      cd	d	d	       S # 1 sw Y   y	xY w)
z9This is what gets called when the user runs this command.locationsIdBETA)versionregion)clientznotebook executioncreatez&Waiting for execution to be created...)operations_clientopop_refasynchronouskind
log_methodmessageN)ReleaseTrackr   GetMessagesCONCEPTSr   ParseAsDictr   AiplatformEndpointOverrides	GetClient(projects_locations_notebookExecutionJobsr   executions_utilCreateExecutionCreateRequestWaitForOpMayber   OperationsClientParseExecutionOperationnameGetAsyncConfig)	selfargsrelease_trackmessages
region_refr   
api_clientexecutions_service	operations	            r   Runz
Create.Run0   s	   %%'M 1 1 34H%%++-J /F		2	2v
 >>-0j

=
=  %++

6
6Hi
   &77zJ 88nn **40#:

 
 
s   B&D22D;N)__name__
__module____qualname____doc__staticmethodr   r8    r   r   r   r   &   s     * *r   r   N)r<   googlecloudsdk.api_lib.air   'googlecloudsdk.api_lib.colab_enterpriser   (googlecloudsdk.api_lib.notebook_executorr   r)   googlecloudsdk.callioper   googlecloudsdk.command_lib.air   ,googlecloudsdk.command_lib.notebook_executorr   _DETAILED_HELPDefaultUniverseOnlyReleaseTracksr!   GAr   CreateCommandr   detailed_helpr>   r   r   <module>rK      s     6 0 8 R ( 7 >		 D%%(($*;*;*@*@A$T $ B $N & r   