:doc:`EC2 <../../ec2>` / Client / cancel_import_task

******************
cancel_import_task
******************



.. py:method:: EC2.Client.cancel_import_task(**kwargs)

  

  Cancels an in-process import virtual machine or import snapshot task.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTask>`_  


  **Request Syntax**
  ::

    response = client.cancel_import_task(
        CancelReason='string',
        DryRun=True|False,
        ImportTaskId='string'
    )
    
  :type CancelReason: string
  :param CancelReason: 

    The reason for canceling the task.

    

  
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

  
  :type ImportTaskId: string
  :param ImportTaskId: 

    The ID of the import image or import snapshot task to be canceled.

    

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

    
    ::

      {
          'ImportTaskId': 'string',
          'PreviousState': 'string',
          'State': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ImportTaskId** *(string) --* 

        The ID of the task being canceled.

        
      

      - **PreviousState** *(string) --* 

        The current state of the task being canceled.

        
      

      - **State** *(string) --* 

        The current state of the task being canceled.

        
  