Skip to content

get_scaling_configuration_recommendation

get_scaling_configuration_recommendation(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    inference_recommendations_job_name: Optional[RecommendationJobName] = None,
    recommendation_id: Optional[String] = None,
    endpoint_name: Optional[EndpointName] = None,
    target_cpu_utilization_per_core: Optional[UtilizationPercentagePerCore] = None,
    scaling_policy_objective: Optional[ScalingPolicyObjective] = None,
) -> GetScalingConfigurationRecommendationResponse

Starts an Amazon SageMaker Inference Recommender autoscaling recommendation job. Returns recommendations for autoscaling policies that you can apply to your SageMaker endpoint.

Parameters:

  • inference_recommendations_job_name (Optional[RecommendationJobName], default: None ) –

    The name of a previously completed Inference Recommender job.

  • recommendation_id (Optional[String], default: None ) –

    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.

  • endpoint_name (Optional[EndpointName], default: None ) –

    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.

  • target_cpu_utilization_per_core (Optional[UtilizationPercentagePerCore], default: None ) –

    The percentage of how much utilization you want an instance to use before autoscaling. The default value is 50%.

  • scaling_policy_objective (Optional[ScalingPolicyObjective], default: None ) –

    An object where you specify the anticipated traffic pattern for an endpoint.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def get_scaling_configuration_recommendation(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    inference_recommendations_job_name: Optional[
        "capo_sagemaker.types.recommendation_job_name.RecommendationJobName"
    ] = None,
    recommendation_id: Optional["capo_sagemaker.types.string.String"] = None,
    endpoint_name: Optional[
        "capo_sagemaker.types.endpoint_name.EndpointName"
    ] = None,
    target_cpu_utilization_per_core: Optional[
        "capo_sagemaker.types.utilization_percentage_per_core.UtilizationPercentagePerCore"
    ] = None,
    scaling_policy_objective: Optional[
        "capo_sagemaker.types.scaling_policy_objective.ScalingPolicyObjective"
    ] = None,
) -> "capo_sagemaker.types.get_scaling_configuration_recommendation_response.GetScalingConfigurationRecommendationResponse":
    """<p>Starts an Amazon SageMaker Inference Recommender autoscaling recommendation job. Returns recommendations for autoscaling policies that you can apply to your SageMaker endpoint.</p>

    Args:
        inference_recommendations_job_name: <p>The name of a previously completed Inference Recommender job.</p>
        recommendation_id: <p>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 <code>InferenceRecommendationsJobName</code> field.</p> <p>Specify either this field or the <code>EndpointName</code> field.</p>
        endpoint_name: <p>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 <code>InferenceRecommendationsJobName</code> field.</p> <p>Specify either this field or the <code>RecommendationId</code> field.</p>
        target_cpu_utilization_per_core: <p>The percentage of how much utilization you want an instance to use before autoscaling. The default value is 50%.</p>
        scaling_policy_objective: <p>An object where you specify the anticipated traffic pattern for an endpoint.</p>

    Raises:
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.get_scaling_configuration_recommendation_request.GetScalingConfigurationRecommendationRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.get_scaling_configuration_recommendation_response.GetScalingConfigurationRecommendationResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.get_scaling_configuration_recommendation

        output, http_response = (
            capo_sagemaker._operations.sage_maker.get_scaling_configuration_recommendation.get_scaling_configuration_recommendation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetScalingConfigurationRecommendation")
    )
    input_: capo_sagemaker.types.get_scaling_configuration_recommendation_request.GetScalingConfigurationRecommendationRequest = {}
    if inference_recommendations_job_name is not None:
        input_["inference_recommendations_job_name"] = (
            inference_recommendations_job_name
        )
    if recommendation_id is not None:
        input_["recommendation_id"] = recommendation_id
    if endpoint_name is not None:
        input_["endpoint_name"] = endpoint_name
    if target_cpu_utilization_per_core is not None:
        input_["target_cpu_utilization_per_core"] = target_cpu_utilization_per_core
    if scaling_policy_objective is not None:
        input_["scaling_policy_objective"] = scaling_policy_objective

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output