
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r
  SSKJr  SSKJr  SS	KJr  SSKJr  SS
KJr  \R(                  " \R*                  R,                  5       " S S\R.                  5      5       rg)z Import session template command.    )absolute_import)division)unicode_literals)
exceptions)dataproc)util)base)flags)
console_ioc                   .    \ rS rSrSr\S 5       rS rSrg)Import   a  Import a session template.

If the specified session template already exists, it will be overwritten.
Otherwise, a new session template will be created.
To edit an existing session template, you can export the session template
to a file, edit its configuration, and then import the new configuration.

This command does not allow output only fields, such as template id and
resource name. It populates the id field based on the resource name specified
as the first command line argument.

## EXAMPLES

The following command creates or updates the contents of session template
`example-session-template` based on a yaml file:

  $ {command} example-session-template --source=saved-template.yaml
c                     [         R                  " 5       n[        R                  " USUR                  5        [
        R                  " U5        g )Nimport)dpDataprocr
   AddSessionTemplateResourceArgapi_versionexport_utilAddImportFlags)clsparserr   s      0lib/surface/dataproc/session_templates/import.pyArgsImport.Args3   s6    {{}H	''(0(<(<>v&    c                 
   [         R                  " 5       nUR                  R                  R	                  5       n[
        R                  " UUR                  S9n [
        R                  " X#R                  5       U5      $ ! [        R                   ao  nUR                  S:w  a  Ue[        R                  " SR                  UR                   5      SS9  [
        R"                  " X#R                  5       U5      s S nA$ S nAff = f)N)r   template_file_namei  z+Session template [{0}] will be overwritten.T)messagecancel_on_no)r   r   CONCEPTSsession_templateParser   ReadSessionTemplatesourceCreateSessionTemplateRelativeNameapitools_exceptions	HttpErrorstatus_coder   PromptContinueformatnameUpdateSessionTemplate)selfargsr   template_reftemplateerrors         r   Run
Import.Run;   s    {{}H==11779L'';;(H2''2K2K2M(02 2(( 
2			c	!@HHmm ''2K2K2M(02 2
2s   $A? ?DA$C=7D=D N)	__name__
__module____qualname____firstlineno____doc__classmethodr   r4   __static_attributes__r6   r   r   r   r      s     & ' '2r   r   N)r;   
__future__r   r   r   apitools.base.pyr   r(   googlecloudsdk.api_lib.dataprocr   r   r   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataprocr
   !googlecloudsdk.command_lib.exportr   googlecloudsdk.core.consoler   ReleaseTracksReleaseTrackBETACommandr   r6   r   r   <module>rI      s^    ' &  ' > : 0 ( 5 A 2 D%%**+02T\\ 02 ,02r   