getQueryResults method

Future<GetQueryResultsOutput> getQueryResults({
  1. required String monitorName,
  2. required String queryId,
  3. int? maxResults,
  4. String? nextToken,
})

Return the data for a query with the Amazon CloudWatch Internet Monitor query interface. Specify the query that you want to return results for by providing a QueryId and a monitor name.

For more information about using the query interface, including examples, see Using the Amazon CloudWatch Internet Monitor query interface in the Amazon CloudWatch Internet Monitor User Guide.

May throw AccessDeniedException. May throw InternalServerException. May throw LimitExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter monitorName : The name of the monitor to return data for.

Parameter queryId : The ID of the query that you want to return data results for. A QueryId is an internally-generated identifier for a specific query.

Parameter maxResults : The number of query results that you want to return with this call.

Parameter nextToken : The token for the next set of results. You receive this token from a previous call.

Implementation

Future<GetQueryResultsOutput> getQueryResults({
  required String monitorName,
  required String queryId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/v20210603/Monitors/${Uri.encodeComponent(monitorName)}/Queries/${Uri.encodeComponent(queryId)}/Results',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetQueryResultsOutput.fromJson(response);
}