createMonitor method
Creates a predictor monitor resource for an existing auto predictor. Predictor monitoring allows you to see how your predictor's performance changes over time. For more information, see Predictor Monitoring.
May throw InvalidInputException.
May throw LimitExceededException.
May throw ResourceAlreadyExistsException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
Parameter monitorName :
The name of the monitor resource.
Parameter resourceArn :
The Amazon Resource Name (ARN) of the predictor to monitor.
Parameter tags :
A list of tags
to apply to the monitor resource.
Implementation
Future<CreateMonitorResponse> createMonitor({
required String monitorName,
required String resourceArn,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonForecast.CreateMonitor'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'MonitorName': monitorName,
'ResourceArn': resourceArn,
if (tags != null) 'Tags': tags,
},
);
return CreateMonitorResponse.fromJson(jsonResponse.body);
}