Skip to content

CloudTrail  >  Operations  >  describe_query

describe_query

Operation

describe_query async

describe_query(input: DescribeQueryInput, plugins: list[Plugin] | None = None) -> DescribeQueryOutput

Returns metadata about a query, including query run time in milliseconds, number of events scanned and matched, and query status. If the query results were delivered to an S3 bucket, the response also provides the S3 URI and the delivery status.

You must specify either QueryId or QueryAlias. Specifying the QueryAlias parameter returns information about the last query run for the alias. You can provide RefreshId along with QueryAlias to view the query results of a dashboard query for the specified RefreshId.

Parameters:

Name Type Description Default
input DescribeQueryInput

An instance of DescribeQueryInput.

required
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

Returns:

Type Description
DescribeQueryOutput

An instance of DescribeQueryOutput.

Input

DescribeQueryInput dataclass

Dataclass for DescribeQueryInput structure.

Attributes

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

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

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

The account ID of the event data store owner.

query_alias class-attribute instance-attribute
query_alias: str | None = None

The alias that identifies a query template.

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

The query ID.

refresh_id class-attribute instance-attribute
refresh_id: str | None = None

The ID of the dashboard refresh.

Output

DescribeQueryOutput dataclass

Dataclass for DescribeQueryOutput structure.

Attributes

delivery_s3_uri class-attribute instance-attribute
delivery_s3_uri: str | None = None

The URI for the S3 bucket where CloudTrail delivered query results, if applicable.

delivery_status class-attribute instance-attribute
delivery_status: DeliveryStatus | None = None

The delivery status.

error_message class-attribute instance-attribute
error_message: str | None = None

The error message returned if a query failed.

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

The account ID of the event data store owner.

prompt class-attribute instance-attribute
prompt: str | None = None

The prompt used for a generated query. For information about generated queries, see Create CloudTrail Lake queries from natural language prompts in the CloudTrail user guide.

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

The ID of the query.

query_statistics class-attribute instance-attribute
query_statistics: QueryStatisticsForDescribeQuery | None = None

Metadata about a query, including the number of events that were matched, the total number of events scanned, the query run time in milliseconds, and the query's creation time.

query_status class-attribute instance-attribute
query_status: QueryStatus | None = None

The status of a query. Values for QueryStatus include QUEUED, RUNNING, FINISHED, FAILED, TIMED_OUT, or CANCELLED

query_string class-attribute instance-attribute
query_string: str | None = None

The SQL code of a query.