Skip to content

cancel_bulk_operation

cancel_bulk_operation(
    bulk_operation_arn: BulkOperationArn,
    *,
    config_overrides: Optional[DynamoDBClientConfig] = None,
) -> CancelBulkOperationOutput

Cancels an in-progress bulk operation asynchronously. Cancellation doesn't remove items that the operation has already written. Use DescribeBulkOperation to monitor the operation until it reaches a terminal status.

Parameters:

  • bulk_operation_arn (BulkOperationArn) –

    The Amazon Resource Name (ARN) of the bulk operation to cancel.

Raises:

  • ResourceNotFoundException –

    The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be ACTIVE.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_dynamodb/_services/dynamo_db.py
def cancel_bulk_operation(
    self,
    bulk_operation_arn: "capo_dynamodb.types.bulk_operation_arn.BulkOperationArn",
    *,
    config_overrides: Optional[DynamoDBClientConfig] = None,
) -> "capo_dynamodb.types.cancel_bulk_operation_output.CancelBulkOperationOutput":
    """<p>Cancels an in-progress bulk operation asynchronously. Cancellation doesn't remove items that the operation has already written. Use <code>DescribeBulkOperation</code> to monitor the operation until it reaches a terminal status.</p>

    Args:
        bulk_operation_arn: <p>The Amazon Resource Name (ARN) of the bulk operation to cancel.</p>

    Raises:
        capo_dynamodb.errors.invalid_endpoint_exception.InvalidEndpointException
        capo_dynamodb.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
        capo_dynamodb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_dynamodb.types.cancel_bulk_operation_input.CancelBulkOperationInput]",
    ) -> OperationResponse[
        "capo_dynamodb.types.cancel_bulk_operation_output.CancelBulkOperationOutput"
    ]:
        import capo_dynamodb._operations.dynamo_db_20120810.cancel_bulk_operation

        output, http_response = (
            capo_dynamodb._operations.dynamo_db_20120810.cancel_bulk_operation.cancel_bulk_operation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelBulkOperation")
    )
    input_: capo_dynamodb.types.cancel_bulk_operation_input.CancelBulkOperationInput = {
        "bulk_operation_arn": bulk_operation_arn
    }

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