createInferenceRecommendationsJob method
Starts a recommendation job. You can create either an instance recommendation or load test job.
May throw ResourceInUse.
May throw ResourceLimitExceeded.
Parameter inputConfig :
Provides information about the versioned model package Amazon Resource
Name (ARN), the traffic pattern, and endpoint configurations.
Parameter jobName :
A name for the recommendation job. The name must be unique within the
Amazon Web Services Region and within your Amazon Web Services account.
The job name is passed down to the resources created by the recommendation
job. The names of resources (such as the model, endpoint configuration,
endpoint, and compilation) that are prefixed with the job name are
truncated at 40 characters.
Parameter jobType :
Defines the type of recommendation job. Specify Default to
initiate an instance recommendation and Advanced to initiate
a load test. If left unspecified, Amazon SageMaker Inference Recommender
will run an instance recommendation (DEFAULT) job.
Parameter roleArn :
The Amazon Resource Name (ARN) of an IAM role that enables Amazon
SageMaker to perform tasks on your behalf.
Parameter jobDescription :
Description of the recommendation job.
Parameter outputConfig :
Provides information about the output artifacts and the KMS key to use for
Amazon S3 server-side encryption.
Parameter stoppingConditions :
A set of conditions for stopping a recommendation job. If any of the
conditions are met, the job is automatically stopped.
Parameter tags :
The metadata that you apply to Amazon Web Services resources to help you
categorize and organize them. Each tag consists of a key and a value, both
of which you define. For more information, see Tagging
Amazon Web Services Resources in the Amazon Web Services General
Reference.
Implementation
Future<CreateInferenceRecommendationsJobResponse>
createInferenceRecommendationsJob({
required RecommendationJobInputConfig inputConfig,
required String jobName,
required RecommendationJobType jobType,
required String roleArn,
String? jobDescription,
RecommendationJobOutputConfig? outputConfig,
RecommendationJobStoppingConditions? stoppingConditions,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.CreateInferenceRecommendationsJob'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InputConfig': inputConfig,
'JobName': jobName,
'JobType': jobType.value,
'RoleArn': roleArn,
if (jobDescription != null) 'JobDescription': jobDescription,
if (outputConfig != null) 'OutputConfig': outputConfig,
if (stoppingConditions != null)
'StoppingConditions': stoppingConditions,
if (tags != null) 'Tags': tags,
},
);
return CreateInferenceRecommendationsJobResponse.fromJson(
jsonResponse.body);
}