
                         l   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S.r\R"                  " \R$                  R&                  \R$                  R(                  \R$                  R*                  5      \R,                   " S S\R.                  5      5       5       rg)z>Retries a Cloud Deploy rollout job specified by job and phase.    )rollout)
exceptions)base)delivery_pipeline_util)deploy_policy_util)flags)resource_args)logz{description}aD       To retry a job 'test-job' in phase 'test-phase' on a rollout 'test-rollout' for delivery pipeline 'test-pipeline', release 'test-release' in region 'us-central1', run:

      $ {command} test-rollout --job-id=test-job --phase-id=test-phase --delivery-pipeline=test-pipeline --release=test-release --region=us-central1

)DESCRIPTIONEXAMPLESc                   p    \ rS rSrSr\r\S 5       r\	R                  " \R                  5      S 5       rSrg)RetryJob)   z8Retries a specified job, phase combination on a rollout.c                     [         R                  " U SS9  [        R                  " U 5        [        R                  " U 5        [        R
                  " U 5        g )NT)
positional)r	   AddRolloutResourceArgr   AddJobId
AddPhaseIdAddOverrideDeployPolicies)parsers    (lib/surface/deploy/rollouts/retry_job.pyArgsRetryJob.Args0   s:    ''4@	NN6	V	##F+    c                    UR                   R                  R                  5       nUR                  5       R                  5       n[        R
                  " UR                  5       5      nSR                  UR                  5       5      n[        R                  " UU5        [        R                  R                  SR                  UR                  UR                  UR                  5       5      5        [        R                  " X1R                   5      n[        R"                  " 5       R%                  UR                  5       UR                  UR                  US9$ )NzCannot retry job on rollout {}.z+Retrying job {} in phase {} of rollout {}.
)override_deploy_policies)CONCEPTSr   ParseParentr   GetPipelineRelativeNameformatThrowIfPipelineSuspendedr
   statusPrintjob_idphase_idr   CreateDeployPolicyNamesFromIDsr   RolloutClientr   )selfargsrollout_refpipeline_refpipeline_objfailed_activity_msgpoliciess          r   RunRetryJob.Run7   s    --''--/K%%'..0L)55!!#%L;BB  "$33L4GI JJCJJT]]K$<$<$>@ A "@@33H   "++  "!)	 ,  r    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptiondeploy_exceptionsHTTP_ERROR_FORMATr1   __static_attributes__r3   r   r   r   r   )   sG     A -, , 44))r   r   N)r8   "googlecloudsdk.api_lib.clouddeployr   googlecloudsdk.api_lib.utilr   r<   googlecloudsdk.callioper   !googlecloudsdk.command_lib.deployr   r   r>   r   r	   googlecloudsdk.corer
   r9   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyCreateCommandr   r3   r   r   <module>rM      s    E 7 F ( D @ M 3 ; # 			
 D%%++T->->-C-C%%((*$t!! $ *$r   