getQueryResults method

Future<GetQueryResultsResponse> getQueryResults({
  1. required String queryId,
})

Returns the results from the specified query.

Only the fields requested in the query are returned, along with a @ptr field, which is the identifier for the log record. You can use the value of @ptr in a GetLogRecord operation to get the full log record.

GetQueryResults does not start a query execution. To run a query, use StartQuery.

If the value of the Status field in the output is Running, this operation returns only partial results. If you see a value of Scheduled or Running for the status, you can retry the operation later to see the final results.

May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter queryId : The ID number of the query.

Implementation

Future<GetQueryResultsResponse> getQueryResults({
  required String queryId,
}) async {
  ArgumentError.checkNotNull(queryId, 'queryId');
  _s.validateStringLength(
    'queryId',
    queryId,
    0,
    256,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.GetQueryResults'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'queryId': queryId,
    },
  );

  return GetQueryResultsResponse.fromJson(jsonResponse.body);
}