list_queries
async
¶
list_queries(
event_data_store: EventDataStoreArn,
*,
config_overrides: Optional[AsyncCloudTrailClientConfig] = None,
next_token: Optional[PaginationToken] = None,
max_results: Optional[ListQueriesMaxResultsCount] = None,
start_time: Optional[Date] = None,
end_time: Optional[Date] = None,
query_status: Optional[QueryStatus] = None,
) -> ListQueriesResponse
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.
Returns a list of queries and query statuses for the past seven days. You must specify an ARN value for EventDataStore. Optionally, to shorten the list of results, you can specify a time range, formatted as timestamps, by adding StartTime and EndTime parameters, and a QueryStatus value. Valid values for QueryStatus include QUEUED, RUNNING, FINISHED, FAILED, TIMED_OUT, or CANCELLED.
Parameters:
-
event_data_store(EventDataStoreArn) –The ARN (or the ID suffix of the ARN) of an event data store on which queries were run.
-
next_token(Optional[PaginationToken], default:None) –A token you can use to get the next page of results.
-
max_results(Optional[ListQueriesMaxResultsCount], default:None) –The maximum number of queries to show on a page.
-
start_time(Optional[Date], default:None) –Use with
EndTimeto bound aListQueriesrequest, and limit its results to only those queries run within a specified time period. -
end_time(Optional[Date], default:None) –Use with
StartTimeto bound aListQueriesrequest, and limit its results to only those queries run within a specified time period. -
query_status(Optional[QueryStatus], default:None) –The status of queries that you want to return in results. Valid values for
QueryStatusincludeQUEUED,RUNNING,FINISHED,FAILED,TIMED_OUT, orCANCELLED.
Raises:
-
EventDataStoreARNInvalidException–The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException–The specified event data store was not found.
-
InactiveEventDataStoreException–The event data store is inactive.
-
InvalidDateRangeException–A date range for the query was specified that is not valid. Be sure that the start time is chronologically before the end time. For more information about writing a query, see Create or edit a query in the CloudTrail User Guide.
-
InvalidMaxResultsException–This exception is thrown if the limit specified is not valid.
-
InvalidNextTokenException–A token that is not valid, or a token that was previously used in a request with different parameters. This exception is thrown if the token is not valid.
-
InvalidParameterException–The request includes a parameter that is not valid.
-
InvalidQueryStatusException–The query status is not valid for the operation.
-
NoManagementAccountSLRExistsException–This exception is thrown when the management account does not have a service-linked role.
-
OperationNotPermittedException–This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException–This exception is thrown when the requested operation is not supported.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudtrail/_services/async_cloud_trail.py
2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 | |