createAnomalyMonitor method
Future<CreateAnomalyMonitorResponse>
createAnomalyMonitor({
- required AnomalyMonitor anomalyMonitor,
Creates a new cost anomaly detection monitor with the requested type and monitor specification.
May throw LimitExceededException.
Parameter anomalyMonitor
:
The cost anomaly detection monitor object that you want to create.
Implementation
Future<CreateAnomalyMonitorResponse> createAnomalyMonitor({
required AnomalyMonitor anomalyMonitor,
}) async {
ArgumentError.checkNotNull(anomalyMonitor, 'anomalyMonitor');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSInsightsIndexService.CreateAnomalyMonitor'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AnomalyMonitor': anomalyMonitor,
},
);
return CreateAnomalyMonitorResponse.fromJson(jsonResponse.body);
}