:doc:`FSx <../../fsx>` / Client / cancel_data_repository_task

***************************
cancel_data_repository_task
***************************



.. py:method:: FSx.Client.cancel_data_repository_task(**kwargs)

  

  Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the ``PENDING`` or ``EXECUTING`` state. When you cancel an export task, Amazon FSx does the following.

   

  
  * Any files that FSx has already exported are not reverted.
   
  * FSx continues to export any files that are in-flight when the cancel operation is received.
   
  * FSx does not export any files that have not yet been exported.
  

   

  For a release task, Amazon FSx will stop releasing files upon cancellation. Any files that have already been released will remain in the released state.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/CancelDataRepositoryTask>`_  


  **Request Syntax**
  ::

    response = client.cancel_data_repository_task(
        TaskId='string'
    )
    
  :type TaskId: string
  :param TaskId: **[REQUIRED]** 

    Specifies the data repository task to cancel.

    

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

    
    ::

      {
          'Lifecycle': 'PENDING'|'EXECUTING'|'FAILED'|'SUCCEEDED'|'CANCELED'|'CANCELING',
          'TaskId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Lifecycle** *(string) --* 

        The lifecycle status of the data repository task, as follows:

         

        
        * ``PENDING`` - Amazon FSx has not started the task.
         
        * ``EXECUTING`` - Amazon FSx is processing the task.
         
        * ``FAILED`` - Amazon FSx was not able to complete the task. For example, there may be files the task failed to process. The  DataRepositoryTaskFailureDetails property provides more information about task failures.
         
        * ``SUCCEEDED`` - FSx completed the task successfully.
         
        * ``CANCELED`` - Amazon FSx canceled the task and it did not complete.
         
        * ``CANCELING`` - FSx is in process of canceling the task.
        

        
      

      - **TaskId** *(string) --* 

        The ID of the task being canceled.

        
  
  **Exceptions**
  
  *   :py:class:`FSx.Client.exceptions.BadRequest`

  
  *   :py:class:`FSx.Client.exceptions.UnsupportedOperation`

  
  *   :py:class:`FSx.Client.exceptions.DataRepositoryTaskNotFound`

  
  *   :py:class:`FSx.Client.exceptions.DataRepositoryTaskEnded`

  
  *   :py:class:`FSx.Client.exceptions.InternalServerError`

  