getScalingConfigurationRecommendation method
Starts an Amazon SageMaker Inference Recommender autoscaling recommendation job. Returns recommendations for autoscaling policies that you can apply to your SageMaker endpoint.
May throw ResourceNotFound.
Parameter inferenceRecommendationsJobName :
The name of a previously completed Inference Recommender job.
Parameter endpointName :
The name of an endpoint benchmarked during a previously completed
inference recommendation job. This name should come from one of the
recommendations returned by the job specified in the
InferenceRecommendationsJobName field.
Specify either this field or the RecommendationId field.
Parameter recommendationId :
The recommendation ID of a previously completed inference recommendation.
This ID should come from one of the recommendations returned by the job
specified in the InferenceRecommendationsJobName field.
Specify either this field or the EndpointName field.
Parameter scalingPolicyObjective :
An object where you specify the anticipated traffic pattern for an
endpoint.
Parameter targetCpuUtilizationPerCore :
The percentage of how much utilization you want an instance to use before
autoscaling. The default value is 50%.
Implementation
Future<GetScalingConfigurationRecommendationResponse>
getScalingConfigurationRecommendation({
required String inferenceRecommendationsJobName,
String? endpointName,
String? recommendationId,
ScalingPolicyObjective? scalingPolicyObjective,
int? targetCpuUtilizationPerCore,
}) async {
_s.validateNumRange(
'targetCpuUtilizationPerCore',
targetCpuUtilizationPerCore,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.GetScalingConfigurationRecommendation'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InferenceRecommendationsJobName': inferenceRecommendationsJobName,
if (endpointName != null) 'EndpointName': endpointName,
if (recommendationId != null) 'RecommendationId': recommendationId,
if (scalingPolicyObjective != null)
'ScalingPolicyObjective': scalingPolicyObjective,
if (targetCpuUtilizationPerCore != null)
'TargetCpuUtilizationPerCore': targetCpuUtilizationPerCore,
},
);
return GetScalingConfigurationRecommendationResponse.fromJson(
jsonResponse.body);
}