SecurityHub / Client / cancel_export_job_v2

cancel_export_job_v2

SecurityHub.Client.cancel_export_job_v2(**kwargs)

Cancels a findings export job that is in progress. Security Hub transitions a running job to the CANCELLED state and returns the ExportJobId and its new Status. Canceling a job that is already in the CANCELLED state succeeds and returns the same result, so you can safely retry a cancel request.

You can’t cancel an export job that has already reached a terminal SUCCEEDED or FAILED state; in that case, this operation returns a ConflictException. If no export job matches the ExportJobId that you provide, this operation returns a ResourceNotFoundException.

The Status value returned by this operation reflects the cancellation immediately, even though the job can take a short time to stop completely.

See also: AWS API Documentation

Request Syntax

response = client.cancel_export_job_v2(
    ExportJobId='string'
)
Parameters:

ExportJobId (string) –

[REQUIRED]

The unique identifier of the export job to cancel. This is the value returned by StartExportJobV2.

Return type:

dict

Returns:

Response Syntax

{
    'ExportJobId': 'string',
    'Status': 'RUNNING'|'SUCCEEDED'|'FAILED'|'CANCELLED'
}

Response Structure

  • (dict) –

    • ExportJobId (string) –

      The unique identifier of the export job.

    • Status (string) –

      The state of the export job after the cancel request.

Exceptions

  • SecurityHub.Client.exceptions.AccessDeniedException

  • SecurityHub.Client.exceptions.ConflictException

  • SecurityHub.Client.exceptions.InternalServerException

  • SecurityHub.Client.exceptions.ResourceNotFoundException

  • SecurityHub.Client.exceptions.ThrottlingException

  • SecurityHub.Client.exceptions.ValidationException