Skip to content

cancel_query

Operation

cancel_query

cancel_query(request: CancelQueryInput | CancelQueryInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CancelQueryInputDict]) -> CancelQueryOutput
Warning

CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.

Cancels a query if the query is not in a terminated state, such as CANCELLED, FAILED, TIMED_OUT, or FINISHED. You must specify an ARN value for EventDataStore. The ID of the query that you want to cancel is also required. When you run CancelQuery, the query status might show as CANCELLED even if the operation is not yet finished.

Parameters:

Name Type Description Default
request CancelQueryInput | CancelQueryInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CancelQueryInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CancelQueryOutput

An instance of CancelQueryOutput.

cancel_query async

cancel_query(request: CancelQueryInput | CancelQueryInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CancelQueryInputDict]) -> CancelQueryOutput
Warning

CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.

Cancels a query if the query is not in a terminated state, such as CANCELLED, FAILED, TIMED_OUT, or FINISHED. You must specify an ARN value for EventDataStore. The ID of the query that you want to cancel is also required. When you run CancelQuery, the query status might show as CANCELLED even if the operation is not yet finished.

Parameters:

Name Type Description Default
request CancelQueryInput | CancelQueryInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CancelQueryInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CancelQueryOutput

An instance of CancelQueryOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

CancelQueryInputDict

Bases: TypedDict

Dictionary form of CancelQueryInput.

Attributes

event_data_store instance-attribute
event_data_store: str | None

The ARN (or the ID suffix of the ARN) of an event data store on which the specified query is running.

event_data_store_owner_account_id instance-attribute
event_data_store_owner_account_id: str | None

The account ID of the event data store owner.

query_id instance-attribute
query_id: Required[str]

The ID of the query that you want to cancel. The QueryId comes from the response of a StartQuery operation.

CancelQueryInput dataclass

Bases: _SerdeShape

Dataclass for CancelQueryInput structure.

Attributes

event_data_store class-attribute instance-attribute
event_data_store: str | None = ...

The ARN (or the ID suffix of the ARN) of an event data store on which the specified query is running.

event_data_store_owner_account_id class-attribute instance-attribute
event_data_store_owner_account_id: str | None = ...

The account ID of the event data store owner.

query_id class-attribute instance-attribute
query_id: str | None = ...

The ID of the query that you want to cancel. The QueryId comes from the response of a StartQuery operation.

Output

CancelQueryOutput dataclass

Bases: _SerdeShape

Dataclass for CancelQueryOutput structure.

Attributes

event_data_store_owner_account_id class-attribute instance-attribute
event_data_store_owner_account_id: str | None = ...

The account ID of the event data store owner.

query_id instance-attribute
query_id: str

The ID of the canceled query.

query_status instance-attribute
query_status: str

Shows the status of a query after a CancelQuery request. Typically, the values shown are either RUNNING or CANCELLED.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.