
                         D   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
dZ e
j                  e
j                  j                   e
j                  j"                  e
j                  j$                         G d de
j&                               Zee_        y)z%'notebooks instances create' command.    )absolute_import)division)unicode_literals)	instances)util)base)flagsz6
        Request for creating notebook instances.
    a  
    To create an instance from an environment, run:

      $ {command} example-instance --environment=example-env --environment-location=us-central1-a --machine-type=n1-standard-4 --location=us-central1-b

    To create an instance from a VmImage family, run:

      $ {command} example-instance --vm-image-project=deeplearning-platform-release --vm-image-family=caffe1-latest-cpu-experimental --machine-type=n1-standard-4 --location=us-central1-b

    To create an instance from a VmImage name, run:

      $ {command} example-instance --vm-image-project=deeplearning-platform-release --vm-image-name=tf2-2-1-cu101-notebooks-20200110 --machine-type=n1-standard-4 --location=us-central1-b

    To create an instance from a Container Repository, run:

      $ {command} example-instance --container-repository=gcr.io/deeplearning-platform-release/base-cpu --container-tag=test-tag --machine-type=n1-standard-4 --location=us-central1-b
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Createz!Request for creating an instance.c                 v    t        j                  | j                               }t        j                  ||       y)z Register flags for this command.N)r   ApiVersionSelectorReleaseTrackr	   AddCreateInstanceFlags)clsparserapi_versions      )lib/surface/notebooks/instances/create.pyArgszCreate.Args9   s-     ))#*:*:*<=K	  f5    c                 >   | j                         }t        j                  |      }t        j                  |      }|j                  }|j                  t        j                  |||            }t        j                  ||||t        j                  j                        S )z9This is what gets called when the user runs this command.)operation_type)r   r   	GetClientGetMessagesprojects_locations_instancesr   instance_utilCreateInstanceCreateRequest	HandleLROOperationTypeCREATE)selfargsrelease_trackclientmessagesinstance_service	operations          r   Runz
Create.Run?   s    %%'M^^M*F.H:: ''11$IKI""$2299; ;r   N)__name__
__module____qualname____doc__classmethodr   r)    r   r   r   r   4   s     *6 6
;r   r   N)r-   
__future__r   r   r    googlecloudsdk.api_lib.notebooksr   r   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.notebooksr	   DETAILED_HELPReleaseTracksr   ALPHABETAGACreateCommandr   detailed_helpr/   r   r   <module>r;      s    , &  ' G 1 ( 6		4 D%%++T->->-C-C%%((*;T ;*;2 % r   