:doc:`CodeDeploy <../../codedeploy>` / Client / stop_deployment

***************
stop_deployment
***************



.. py:method:: CodeDeploy.Client.stop_deployment(**kwargs)

  

  Attempts to stop an ongoing deployment.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/StopDeployment>`_  


  **Request Syntax**
  ::

    response = client.stop_deployment(
        deploymentId='string',
        autoRollbackEnabled=True|False
    )
    
  :type deploymentId: string
  :param deploymentId: **[REQUIRED]** 

    The unique ID of a deployment.

    

  
  :type autoRollbackEnabled: boolean
  :param autoRollbackEnabled: 

    Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'status': 'Pending'|'Succeeded',
          'statusMessage': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Represents the output of a ``StopDeployment`` operation.

      
      

      - **status** *(string) --* 

        The status of the stop deployment operation:

         

        
        * Pending: The stop operation is pending.
         
        * Succeeded: The stop operation was successful.
        

        
      

      - **statusMessage** *(string) --* 

        An accompanying status message.

        
  
  **Exceptions**
  
  *   :py:class:`CodeDeploy.Client.exceptions.DeploymentIdRequiredException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.DeploymentDoesNotExistException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.DeploymentGroupDoesNotExistException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.DeploymentAlreadyCompletedException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.InvalidDeploymentIdException`

  
  *   :py:class:`CodeDeploy.Client.exceptions.UnsupportedActionForDeploymentTypeException`

  