updateMonitor method

Future<UpdateMonitorOutput> updateMonitor({
  1. required int aggregationPeriod,
  2. required String monitorName,
})

Updates the aggregationPeriod for a monitor. Monitors support an aggregationPeriod of either 30 or 60 seconds. This action requires the monitorName and probeId parameter. Run ListMonitors to get a list of monitor names.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter aggregationPeriod : The aggregation time, in seconds, to change to. This must be either 30 or 60.

Parameter monitorName : The name of the monitor to update.

Implementation

Future<UpdateMonitorOutput> updateMonitor({
  required int aggregationPeriod,
  required String monitorName,
}) async {
  _s.validateNumRange(
    'aggregationPeriod',
    aggregationPeriod,
    30,
    1152921504606846976,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'aggregationPeriod': aggregationPeriod,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/monitors/${Uri.encodeComponent(monitorName)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateMonitorOutput.fromJson(response);
}