:doc:`SSM <../../ssm>` / Client / cancel_command

**************
cancel_command
**************



.. py:method:: SSM.Client.cancel_command(**kwargs)

  

  Attempts to cancel the command specified by the Command ID. There is no guarantee that the command will be terminated and the underlying process stopped.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelCommand>`_  


  **Request Syntax**
  ::

    response = client.cancel_command(
        CommandId='string',
        InstanceIds=[
            'string',
        ]
    )
    
  :type CommandId: string
  :param CommandId: **[REQUIRED]** 

    The ID of the command you want to cancel.

    

  
  :type InstanceIds: list
  :param InstanceIds: 

    (Optional) A list of managed node IDs on which you want to cancel the command. If not provided, the command is canceled on every node on which it was requested.

    

  
    - *(string) --* 

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 

      Whether or not the command was successfully canceled. There is no guarantee that a request can be canceled.

      
  
  **Exceptions**
  
  *   :py:class:`SSM.Client.exceptions.InternalServerError`

  
  *   :py:class:`SSM.Client.exceptions.InvalidCommandId`

  
  *   :py:class:`SSM.Client.exceptions.InvalidInstanceId`

  
  *   :py:class:`SSM.Client.exceptions.DuplicateInstanceId`

  