updateInferenceExperiment method

Future<UpdateInferenceExperimentResponse> updateInferenceExperiment({
  1. required String name,
  2. InferenceExperimentDataStorageConfig? dataStorageConfig,
  3. String? description,
  4. List<ModelVariantConfig>? modelVariants,
  5. InferenceExperimentSchedule? schedule,
  6. ShadowModeConfig? shadowModeConfig,
})

Updates an inference experiment that you created. The status of the inference experiment has to be either Created, Running. For more information on the status of an inference experiment, see DescribeInferenceExperiment.

May throw ConflictException. May throw ResourceNotFound.

Parameter name : The name of the inference experiment to be updated.

Parameter dataStorageConfig : The Amazon S3 location and configuration for storing inference request and response data.

Parameter description : The description of the inference experiment.

Parameter modelVariants : An array of ModelVariantConfig objects. There is one for each variant, whose infrastructure configuration you want to update.

Parameter schedule : The duration for which the inference experiment will run. If the status of the inference experiment is Created, then you can update both the start and end dates. If the status of the inference experiment is Running, then you can update only the end date.

Parameter shadowModeConfig : The configuration of ShadowMode inference experiment type. Use this field to specify a production variant which takes all the inference requests, and a shadow variant to which Amazon SageMaker replicates a percentage of the inference requests. For the shadow variant also specify the percentage of requests that Amazon SageMaker replicates.

Implementation

Future<UpdateInferenceExperimentResponse> updateInferenceExperiment({
  required String name,
  InferenceExperimentDataStorageConfig? dataStorageConfig,
  String? description,
  List<ModelVariantConfig>? modelVariants,
  InferenceExperimentSchedule? schedule,
  ShadowModeConfig? shadowModeConfig,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateInferenceExperiment'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (dataStorageConfig != null) 'DataStorageConfig': dataStorageConfig,
      if (description != null) 'Description': description,
      if (modelVariants != null) 'ModelVariants': modelVariants,
      if (schedule != null) 'Schedule': schedule,
      if (shadowModeConfig != null) 'ShadowModeConfig': shadowModeConfig,
    },
  );

  return UpdateInferenceExperimentResponse.fromJson(jsonResponse.body);
}