
                             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ZddiZ G d de	j"                        Zy
)z-Set DAG timeout on workflow template command.    )absolute_import)division)unicode_literals)dataproc)base)flags)workflow_templates)logNEXAMPLESz      To add a DAG timeout of 2h (or update an existing one to 2h) on a workflow
      template named ``my-workflow-template'' in region ``us-central1'', run:

        $ {command} my-workflow-template --region=us-central1 --dag-timeout=2h"
      c                   *    e Zd ZdZeZed        Zd Zy)SetDagTimeoutz'Set DAG timeout on a workflow template.c                     t        j                  | j                               }t        j                  |d       t        j                  |d|j                         y )NTzset the DAG timeout on)dpDataprocReleaseTrackr	   AddDagTimeoutFlagr   AddTemplateResourceArgapi_version)clsparserr   s      :lib/surface/dataproc/workflow_templates/set_dag_timeout.pyArgszSetDagTimeout.Args,   sE    {{3++-.H((6	  )A!)!5!57    c                    t        j                  | j                               }|j                  j                  j                         }|j                  ||j                        }t        j                  |j                        dz   |_        |j                  j                  j                  |      }t        j                   j#                  dj%                  |j                  |j'                                      |S )Nsz Set a DAG timeout of {0} on {1}.)r   r   r   CONCEPTStemplateParseGetRegionsWorkflowTemplateversionsix	text_typedag_timeout
dagTimeoutclient"projects_regions_workflowTemplatesUpdater
   statusPrintformatName)selfargsr   template_refworkflow_templateresponses         r   RunzSetDagTimeout.Run3   s    {{4,,./H==))//1L ;;dll$ $'==1A1A#BS#H AAHHH JJ7>>$$l&7&7&9; <Or   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpclassmethodr   r1    r   r   r   r   '   s!    /-7 7r   r   )r5   
__future__r   r   r   googlecloudsdk.api_lib.dataprocr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataprocr   r	   googlecloudsdk.corer
   r!   r6   CreateCommandr   r9   r   r   <module>r@      sH    4 &  ' : ( 5 B # 
 	
D&& r   