stopQuery method
Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.
May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.
Parameter queryId
:
The ID number of the query to stop. To find this ID number, use
DescribeQueries
.
Implementation
Future<StopQueryResponse> stopQuery({
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.StopQuery'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'queryId': queryId,
},
);
return StopQueryResponse.fromJson(jsonResponse.body);
}