
    -                         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  \
R                    " S S\
R"                  5      5       rg)z2Set managed cluster for workflow template command.    )absolute_import)division)unicode_literals)compute_helpers)dataproc)base)clusters)flags)labels_utilc                   f    \ rS rSrSrSS0r\S 5       r\S 5       r\S 5       r	\S 5       r
S	 rS
rg)SetManagedCluster   z0Set a managed cluster for the workflow template.EXAMPLESz
To update managed cluster in a workflow template, run:

  $ {command} my_template --region=us-central1 --no-address --num-workers=10 --worker-machine-type=custom-6-23040

c           	         [         R                  " U R                  5       5      nUR                  SSS9  [        R
                  " UUU R                  5       U R                  5       U R                  5       SS9  [        R                  " USUR                  5        U R                  5       (       a  [        R                  " U5        g g )Nz--cluster-namezt          The name of the managed dataproc cluster.
          If unspecified, the workflow template ID will be used.)helpF)include_deprecatedinclude_gke_platform_argszset managed cluster)dpDataprocReleaseTrackadd_argumentr	   ArgsForClusterRefBetaAlphar
   AddTemplateResourceArgapi_versionBetaArgsForClusterRef)clsparserr   s      >lib/surface/dataproc/workflow_templates/set_managed_cluster.pyArgsSetManagedCluster.Args+   s    {{3++-.H
D  E
 
		88:"') 
  )>!)!5!57
xxzz$$V,     c                 X    U R                  5       [        R                   R                  :g  $ N)r   r   GAr   s    r    r   SetManagedCluster.Beta?   s"    !2!2!5!555r#   c                 X    U R                  5       [        R                   R                  :H  $ r%   )r   r   ALPHAr'   s    r    r   SetManagedCluster.AlphaC   s"    !2!2!8!888r#   c                     U R                  5       (       a  [        R                  R                  $ [        R                  R                  $ r%   )r   r   r   BETAr&   r'   s    r    GetComputeReleaseTrack(SetManagedCluster.GetComputeReleaseTrackG   s1    
xxzz###r#   c           
      <   [         R                  " U R                  5       5      nUR                  R                  R                  5       nUR                  X1R                  5      nUR                  (       a  UR                  nOUR                  n[        R                  " U R                  5       XSR                  5      n[        R                  " UUUR                   UU R#                  5       U R%                  5       U R#                  5       S9n[&        R(                  " XR*                  R,                  R.                  5      nUR*                  R-                  XWUS9n	UR*                  R1                  U	S9Ul        UR4                  R6                  R9                  U5      n
U
$ )N)r   )clusterNameconfiglabels)managedCluster)r   r   r   CONCEPTStemplateParseGetRegionsWorkflowTemplateversioncluster_nameworkflowTemplatesIdr   GetComputeResourcesr.   	regionsIdr	   GetClusterConfig
projectsIdr   r   r   ParseCreateArgsmessagesManagedClusterLabelsValueWorkflowTemplatePlacement	placementclient"projects_regions_workflowTemplatesUpdate)selfargsr   template_refworkflow_templater:   compute_resourcescluster_configr3   managed_clusterresponses              r    RunSetManagedCluster.RunM   sb   {{4,,./H==))//1L ;;ll$ &&l!55l';;##%|5K5KM ..		

99;(N ((..::<F ''66  7 HO #+"3"3"M"M& #N #( AAHHHOr#    N)__name__
__module____qualname____firstlineno____doc__detailed_helpclassmethodr!   r   r   r.   rQ   __static_attributes__rS   r#   r    r   r      sk    8  - - -& 6 6 9 9    
$r#   r   N)rX   
__future__r   r   r   googlecloudsdk.api_lib.dataprocr   r   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataprocr	   r
   $googlecloudsdk.command_lib.util.argsr   DefaultUniverseOnlyUpdateCommandr   rS   r#   r    <module>rc      sO    9 &  ' ; : ( 8 5 < S** S Sr#   