describeQueries method
Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account. You can request all queries or limit it to queries of a specific log group or queries with a certain status.
This operation includes both interactive queries started directly by users and automated queries executed by scheduled query configurations. Scheduled query executions appear in the results alongside manually initiated queries, providing visibility into all query activity in your account.
May throw InvalidParameterException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
Parameter logGroupName :
Limits the returned queries to only those for the specified log group.
Parameter maxResults :
Limits the number of returned queries to the specified number.
Parameter queryLanguage :
Limits the returned queries to only the queries that use the specified
query language.
Parameter status :
Limits the returned queries to only those that have the specified status.
Valid values are Cancelled, Complete,
Failed, Running, and Scheduled.
Implementation
Future<DescribeQueriesResponse> describeQueries({
String? logGroupName,
int? maxResults,
String? nextToken,
QueryLanguage? queryLanguage,
QueryStatus? status,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Logs_20140328.DescribeQueries'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (logGroupName != null) 'logGroupName': logGroupName,
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
if (queryLanguage != null) 'queryLanguage': queryLanguage.value,
if (status != null) 'status': status.value,
},
);
return DescribeQueriesResponse.fromJson(jsonResponse.body);
}