listClusterAlerts method

Future<ListClusterAlertsResponse> listClusterAlerts({
  1. required String clusterId,
  2. int? maxResults,
  3. String? nextToken,
  4. String? stateFilter,
})

List the alerts for a cluster with optional filtering based on alert state.

May throw BadGatewayException. May throw BadRequestException. May throw ForbiddenException. May throw GatewayTimeoutException. May throw InternalServerErrorException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter clusterId : The unique ID of the cluster

Parameter maxResults : The maximum number of items to return

Parameter nextToken : The next pagination token

Parameter stateFilter : Specifies the set of alerts to return based on their state. SET - Return only alerts with SET state. CLEARED - Return only alerts with CLEARED state. ALL - Return all alerts.

Implementation

Future<ListClusterAlertsResponse> listClusterAlerts({
  required String clusterId,
  int? maxResults,
  String? nextToken,
  String? stateFilter,
}) async {
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (stateFilter != null) 'stateFilter': [stateFilter],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/prod/clusters/${Uri.encodeComponent(clusterId)}/alerts',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListClusterAlertsResponse.fromJson(response);
}