:doc:`LakeFormation <../../lakeformation>` / Client / delete_objects_on_cancel

************************
delete_objects_on_cancel
************************



.. py:method:: LakeFormation.Client.delete_objects_on_cancel(**kwargs)

  

  For a specific governed table, provides a list of Amazon S3 objects that will be written during the current transaction and that can be automatically deleted if the transaction is canceled. Without this call, no Amazon S3 objects are automatically deleted when a transaction cancels.

   

  The Glue ETL library function ``write_dynamic_frame.from_catalog()`` includes an option to automatically call ``DeleteObjectsOnCancel`` before writes. For more information, see `Rolling Back Amazon S3 Writes <https://docs.aws.amazon.com/lake-formation/latest/dg/transactions-data-operations.html#rolling-back-writes>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/DeleteObjectsOnCancel>`_  


  **Request Syntax**
  ::

    response = client.delete_objects_on_cancel(
        CatalogId='string',
        DatabaseName='string',
        TableName='string',
        TransactionId='string',
        Objects=[
            {
                'Uri': 'string',
                'ETag': 'string'
            },
        ]
    )
    
  :type CatalogId: string
  :param CatalogId: 

    The Glue data catalog that contains the governed table. Defaults to the current account ID.

    

  
  :type DatabaseName: string
  :param DatabaseName: **[REQUIRED]** 

    The database that contains the governed table.

    

  
  :type TableName: string
  :param TableName: **[REQUIRED]** 

    The name of the governed table.

    

  
  :type TransactionId: string
  :param TransactionId: **[REQUIRED]** 

    ID of the transaction that the writes occur in.

    

  
  :type Objects: list
  :param Objects: **[REQUIRED]** 

    A list of VirtualObject structures, which indicates the Amazon S3 objects to be deleted if the transaction cancels.

    

  
    - *(dict) --* 

      An object that defines an Amazon S3 object to be deleted if a transaction cancels, provided that ``VirtualPut`` was called before writing the object.

      

    
      - **Uri** *(string) --* **[REQUIRED]** 

        The path to the Amazon S3 object. Must start with s3://

        

      
      - **ETag** *(string) --* 

        The ETag of the Amazon S3 object.

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`LakeFormation.Client.exceptions.InternalServiceException`

  
  *   :py:class:`LakeFormation.Client.exceptions.InvalidInputException`

  
  *   :py:class:`LakeFormation.Client.exceptions.OperationTimeoutException`

  
  *   :py:class:`LakeFormation.Client.exceptions.EntityNotFoundException`

  
  *   :py:class:`LakeFormation.Client.exceptions.TransactionCommittedException`

  
  *   :py:class:`LakeFormation.Client.exceptions.TransactionCanceledException`

  
  *   :py:class:`LakeFormation.Client.exceptions.ResourceNotReadyException`

  
  *   :py:class:`LakeFormation.Client.exceptions.ConcurrentModificationException`

  