listMonitorEvaluations method

Future<ListMonitorEvaluationsResponse> listMonitorEvaluations({
  1. required String monitorArn,
  2. List<Filter>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

Returns a list of the monitoring evaluation results and predictor events collected by the monitor resource during different windows of time.

For information about monitoring see predictor-monitoring. For more information about retrieving monitoring results see Viewing Monitoring Results.

May throw InvalidInputException. May throw InvalidNextTokenException. May throw ResourceNotFoundException.

Parameter monitorArn : The Amazon Resource Name (ARN) of the monitor resource to get results from.

Parameter filters : An array of filters. For each filter, provide a condition and a match statement. The condition is either IS or IS_NOT, which specifies whether to include or exclude the resources that match the statement from the list. The match statement consists of a key and a value.

Filter properties

  • Condition - The condition to apply. Valid values are IS and IS_NOT.
  • Key - The name of the parameter to filter on. The only valid value is EvaluationState.
  • Value - The value to match. Valid values are only SUCCESS or FAILURE.
For example, to list only successful monitor evaluations, you would specify:

"Filters": [ { "Condition": "IS", "Key": "EvaluationState", "Value": "SUCCESS" } ]

Parameter maxResults : The maximum number of monitoring results to return.

Parameter nextToken : If the result of the previous request was truncated, the response includes a NextToken. To retrieve the next set of results, use the token in the next request. Tokens expire after 24 hours.

Implementation

Future<ListMonitorEvaluationsResponse> listMonitorEvaluations({
  required String monitorArn,
  List<Filter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonForecast.ListMonitorEvaluations'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MonitorArn': monitorArn,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListMonitorEvaluationsResponse.fromJson(jsonResponse.body);
}