listInternetEvents method

Future<ListInternetEventsOutput> listInternetEvents({
  1. DateTime? endTime,
  2. String? eventStatus,
  3. String? eventType,
  4. int? maxResults,
  5. String? nextToken,
  6. DateTime? startTime,
})

Lists internet events that cause performance or availability issues for client locations. Amazon CloudWatch Internet Monitor displays information about recent global health events, called internet events, on a global outages map that is available to all Amazon Web Services customers.

You can constrain the list of internet events returned by providing a start time and end time to define a total time frame for events you want to list. Both start time and end time specify the time when an event started. End time is optional. If you don't include it, the default end time is the current time.

You can also limit the events returned to a specific status (ACTIVE or RESOLVED) or type (PERFORMANCE or AVAILABILITY).

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

Parameter endTime : The end time of the time window that you want to get a list of internet events for.

Parameter eventStatus : The status of an internet event.

Parameter eventType : The type of network impairment.

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.

Parameter startTime : The start time of the time window that you want to get a list of internet events for.

Implementation

Future<ListInternetEventsOutput> listInternetEvents({
  DateTime? endTime,
  String? eventStatus,
  String? eventType,
  int? maxResults,
  String? nextToken,
  DateTime? startTime,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (endTime != null) 'EndTime': [_s.iso8601ToJson(endTime).toString()],
    if (eventStatus != null) 'EventStatus': [eventStatus],
    if (eventType != null) 'EventType': [eventType],
    if (maxResults != null)
      'InternetEventMaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
    if (startTime != null)
      'StartTime': [_s.iso8601ToJson(startTime).toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v20210603/InternetEvents',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListInternetEventsOutput.fromJson(response);
}