
                         2   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  SSKJr  SSKJr  \R*                  \R,                  " \R.                  R0                  5       " S S\R2                  5      5       5       rg)z!Update a Flink job's parallelism.    )absolute_import)division)unicode_literals)util)waiter)base)flags)flink_backend)common_args)log)
properties)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)Update!   a  Update the parallelism of a Flink job.

Update the parallelism of a Flink job.

## EXAMPLES

The following command updates a Flink Job with the ID `example-job-id`
to change max parallesim to 4:

  $ {command} example-job-id \
      --project=example-project \
      --location=us-central1 \
      --autotuning-mode elastic \
      --min-parallelism=1 \
      --max-parallelism=4 \

c                    [         R                  " SS9R                  U 5        [        R                  " U 5        [        R
                  " U 5        [        R                  " U SS9  [        R                  " U 5        [        R                  " U SS9  [        R                  " U 5        [        R                  " U 5        [        R                  " U SS9  g )NzProject to update the job in.)help_text_to_overwritez Deployment to update the job in.Frequired)default)r   ProjectArgumentAddToParserr	   AddJobIdArgumentAddLocationArgumentAddDeploymentArgumentAddShowOutputArgumentAddAutotuningModeArgumentAddFixedParallelismArgsAddElasticParallelismArgsAddAsyncArgument)parsers    (lib/surface/managed_flink/jobs/update.pyArgsUpdate.Args6   s    >k&	6"	f%	'I 
'	##FU;	!!&)	##F+	651    c                 ~   [         R                  " UR                  UR                  UR                  UR
                  5        [        R                  " U R                  5       5      nUR                  5       nUR                  S:X  a  UR                  UR
                  S9Ul        O4UR                  UR                  UR                  UR                  S9Ul        UR                  US9nUR                  UR                   US9nUR"                  (       a  UR"                  Ul        UR'                  SR)                  [*        R,                  R.                  R0                  R3                  SS9UR4                  UR                   5      US	S
9n[        R6                  " U R                  5       5      nUR8                  R:                  R=                  U5      nUR>                  (       a  U$ [@        RB                  RE                  SR)                  URF                  RH                  5      5        [J        RL                  RO                  URH                  SS9n	[P        RR                  " [P        RT                  " UR8                  R:                  UR8                  RV                  5      U	SR)                  URH                  5      5        U$ )Nfixed)parallelism)r(   minParallelismmaxParallelism)autotuningConfig)namejobSpecz#projects/{0}/locations/{1}/jobs/{2}Tr   r+   )r,   job
updateMaskzUpdate request issued for [{0}]z*managedflink.projects.locations.operations)
collectionz2Waiting for update operations [{0}] to complete...),r
   ValidateAutotuningautotuning_modemin_parallelismmax_parallelismr(   
flink_utilGetMessagesModuleReleaseTrackAutotuningConfigFixedr'   ElasticthroughputBasedJobSpecJobjob_id
deploymentdeploymentId-ManagedflinkProjectsLocationsJobsPatchRequestformatr   VALUEScoreprojectGetlocationFlinkClientclientprojects_locations_jobsPatchasync_submitr   statusPrintr.   r,   r   REGISTRYParser   WaitForCloudOperationPollerprojects_locations_operations)
selfargsmsgautotuning_configjobspecr.   updateflink_clientpatch_oppatch_op_refs
             r"   Run
Update.RunF   sM   $$	 
&
&t'8'8':
;C ,,.w& #		d6F6F	 G*-++**---- +6 +' kk*  G ''[[  C
 c>>299""**...=MMKK

 % ? F ))$*;*;*=>L""::@@HHoJJ6==fjjooNO%%++"N , L NN##77==	
 	<CCMM	
	 Or%    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr#   r]   __static_attributes__r_   r%   r"   r   r   !   s     $ 2 2?r%   r   N)rd   
__future__r   r   r   $googlecloudsdk.api_lib.managed_flinkr   r5   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   (googlecloudsdk.command_lib.managed_flinkr	   r
   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   r   r   DefaultUniverseOnlyReleaseTracksr7   ALPHAUpdateCommandr   r_   r%   r"   <module>rr      sw     ( &  ' C . ( : B < # * ) D%%++,bT b - br%   