
    -
                         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                          G d de
j"                               Zee_        y)z%'notebooks runtimes migrate' command.    )absolute_import)division)unicode_literals)runtimes)util)base)flagsz6
        Request for migrating notebook runtimes.
    a*  
    To migrate a runtime, run:

        $ {command} example-runtime --location=us-central1

    To migrate a runtime with a new custom network, run:

        $ {command} example-runtime --location=us-central1 --network=projects/example-project/global/networks/example-network --subnet=projects/example-project/regions/us-central1/subnetworks/example-subnetwork

    To migrate a runtime and reuse the post-startup script, run:

        $ {command} example-runtime --location=us-central1 --post-startup-script-option=POST_STARTUP_SCRIPT_OPTION_RERUN
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)MigratezRequest for migrating runtimes.c                 v    t        j                  | j                               }t        j                  ||       y)z Register flags for this command.N)r   ApiVersionSelectorReleaseTrackr	   AddMigrateRuntimeFlags)clsparserapi_versions      )lib/surface/notebooks/runtimes/migrate.pyArgszMigrate.Args4   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_runtimesr   runtime_utilCreateRuntimeMigrateRequest	HandleLROOperationTypeMIGRATE)selfargsrelease_trackclientmessagesruntime_service	operations          r   RunzMigrate.Run:   s    %%'M^^M*F.H88O''00x@BI!!#1199; ;r   N)__name__
__module____qualname____doc__classmethodr   r)    r   r   r   r   0   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   GACommandr   detailed_helpr/   r   r   <module>r9      sr    , &  ' E 1 ( 6		, D%%(();dll ; *;2 & r   