
    X                         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	r\R                  " \R                  R                   5       " S
 S\R"                  \R$                  5      5       rg)zdeployments stop command.    )
exceptions)dm_api_util)dm_base)base)dm_util)dm_write)flagsi  c                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	Stop!   zStop a pending or running deployment update or creation.

This command will stop a currently running or pending operation on
a deployment.
EXAMPLESaO  
To stop a running operation on a deployment, run:

  $ {command} my-deployment

To issue a stop command without waiting for the operation to complete, run:

  $ {command} my-deployment --async

To stop a running operation on a deployment providing a fingerprint, run:

  $ {command} my-deployment --fingerprint=deployment-fingerprint
c                     [         R                  " U 5        [         R                  " U 5        [         R                  " U 5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go
      on the command line after this command. Positional arguments are
      allowed.
N)r	   AddAsyncFlagAddDeploymentNameFlagAddFingerprintFlag)parsers    2lib/surface/deployment_manager/deployments/stop.pyArgs	Stop.Args9   s.     
v	'	V$    c           
      b   UR                   (       a!  [        R                  " UR                   5      nOS[        R                  " U R
                  U R                  [        R                  " 5       UR                  5      =(       d    Sn U R
                  R                  R                  U R                  R                  [        R                  " 5       UR                  U R                  R                  US9S95      nUR&                  (       a  U$ UR(                  n [*        R,                  " U R
                  U R                  US[        R                  " 5       [.        S9n[        R0                  " US5         U R
                  R2                  R5                  U R                  R7                  [        R                  " 5       UR                  S95      nUR2                  (       a  UR2                  $ / $ ! [        R                   a*  n[         R"                  " U[        R$                  5      eSnAff = f! [        R                   a*  n[         R"                  " U[        R$                  5      eSnAff = f! [        R                   a*  n[         R"                  " U[        R$                  5      eSnAff = f)	aQ  Run 'deployments stop'.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
      with.

Returns:
  If --async=true, returns Operation to poll.
  Else, returns boolean indicating whether stop operation succeeded.

Raises:
  HttpException: An http error response was received while executing api
      request.
r   )fingerprint)project
deploymentdeploymentsStopRequestNstop)timeoutr   )r   r   )r   r   DecodeFingerprintr   FetchDeploymentFingerprintclientmessagesr   
GetProjectdeployment_namedeploymentsr   'DeploymentmanagerDeploymentsStopRequestDeploymentsStopRequestapitools_exceptions	HttpErrorr   HttpExceptionHTTP_ERROR_FORMATasync_namer   WaitForOperationOPERATION_TIMEOUTLogOperationStatus	resourcesList%DeploymentmanagerResourcesListRequest)selfargsr   	operationerrorop_nameresponses          r   RunStop.RunF   s.    --d.>.>?k
  ::
++
--






	  ' $'	 
K++))..
--
?
?((*----66"- 7 /	 @ 	i {{g
M--KKMM %'	 	""9f5M;;((--MM??**,// @ 
 &.%7%7x!!?R?5 (( K$$UK,I,IJJK !** M&&uk.K.KLLM !** M&&uk.K.KLLMsQ   A2G. AH/ 5A6I0 ,I0 .H,%H''H,/I-%I((I-0J.%J))J. N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r9   __static_attributes__r;   r   r   r   r   !   s3      -  
% 
%AMr   r   N)r@   apitools.base.pyr   r'   )googlecloudsdk.api_lib.deployment_managerr   r   googlecloudsdk.callioper   -googlecloudsdk.command_lib.deployment_managerr   r   r	   r.   UseDmApiDmApiVersionV2Command	DmCommandr   r;   r   r   <module>rM      sp       ? A = ( . A B ?   	'&&))*eM4<<** eM +eMr   