Skip to content

cancel_export_task

cancel_export_task(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    export_task_identifier: Optional[String] = None,
) -> ExportTask

Cancels an export task in progress that is exporting a snapshot or cluster to Amazon S3. Any data that has already been written to the S3 bucket isn't removed.

Parameters:

  • export_task_identifier (Optional[String], default: None ) –

    The identifier of the snapshot or cluster export task to cancel.

Raises:

Examples:

To cancel a snapshot export to Amazon S3 The following example cancels an export task in progress that is exporting a snapshot to Amazon S3.

>>> client.cancel_export_task(export_task_identifier='my-s3-export-1')
Source code in docs_src/capo_rds/_services/rds.py
def cancel_export_task(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    export_task_identifier: Optional["capo_rds.types.string.String"] = None,
) -> "capo_rds.types.export_task.ExportTask":
    """<p>Cancels an export task in progress that is exporting a snapshot or cluster to Amazon S3. Any data that has already been written to the S3 bucket isn't removed.</p>

    Args:
        export_task_identifier: <p>The identifier of the snapshot or cluster export task to cancel.</p>

    Raises:
        capo_rds.errors.export_task_not_found_fault.ExportTaskNotFoundFault: <p>The export task doesn't exist.</p>
        capo_rds.errors.invalid_export_task_state_fault.InvalidExportTaskStateFault: <p>You can't cancel an export task that has completed.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To cancel a snapshot export to Amazon S3
        The following example cancels an export task in progress that is exporting a snapshot to Amazon S3.

        >>> client.cancel_export_task(export_task_identifier='my-s3-export-1')
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.cancel_export_task_message.CancelExportTaskMessage]",
    ) -> OperationResponse["capo_rds.types.export_task.ExportTask"]:
        import capo_rds._operations.amazon_rd_sv19.cancel_export_task

        output, http_response = (
            capo_rds._operations.amazon_rd_sv19.cancel_export_task.cancel_export_task(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelExportTask")
    )
    input_: capo_rds.types.cancel_export_task_message.CancelExportTaskMessage = {}
    if export_task_identifier is not None:
        input_["export_task_identifier"] = export_task_identifier

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output