createMonitoringSchedule method

Future<CreateMonitoringScheduleResponse> createMonitoringSchedule({
  1. required MonitoringScheduleConfig monitoringScheduleConfig,
  2. required String monitoringScheduleName,
  3. List<Tag>? tags,
})

Creates a schedule that regularly starts Amazon SageMaker Processing Jobs to monitor the data captured for an Amazon SageMaker Endoint.

May throw ResourceLimitExceeded. May throw ResourceInUse.

Parameter monitoringScheduleConfig : The configuration object that specifies the monitoring schedule and defines the monitoring job.

Parameter monitoringScheduleName : The name of the monitoring schedule. The name must be unique within an AWS Region within an AWS account.

Parameter tags : (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

Implementation

Future<CreateMonitoringScheduleResponse> createMonitoringSchedule({
  required MonitoringScheduleConfig monitoringScheduleConfig,
  required String monitoringScheduleName,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(
      monitoringScheduleConfig, 'monitoringScheduleConfig');
  ArgumentError.checkNotNull(
      monitoringScheduleName, 'monitoringScheduleName');
  _s.validateStringLength(
    'monitoringScheduleName',
    monitoringScheduleName,
    1,
    63,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateMonitoringSchedule'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MonitoringScheduleConfig': monitoringScheduleConfig,
      'MonitoringScheduleName': monitoringScheduleName,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateMonitoringScheduleResponse.fromJson(jsonResponse.body);
}