Skip to content

get_recommendations

get_recommendations(
    profiling_group_name: ProfilingGroupName,
    start_time: Timestamp,
    end_time: Timestamp,
    *,
    config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
    locale: Optional[Locale] = None,
) -> GetRecommendationsResponse

Returns a list of Recommendation objects that contain recommendations for a profiling group for a given time period. A list of Anomaly objects that contains details about anomalies detected in the profiling group for the same time period is also returned.

Parameters:

  • profiling_group_name (ProfilingGroupName) –

    The name of the profiling group to get analysis data about.

  • start_time (Timestamp) –

    The end time of the profile to get analysis data about. You must specify startTime and endTime. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.

  • end_time (Timestamp) –

    The start time of the profile to get analysis data about. You must specify startTime and endTime. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.

  • locale (Optional[Locale], default: None ) –

    The language used to provide analysis. Specify using a string that is one of the following BCP 47 language codes.

    • de-DE - German, Germany

    • en-GB - English, United Kingdom

    • en-US - English, United States

    • es-ES - Spanish, Spain

    • fr-FR - French, France

    • it-IT - Italian, Italy

    • ja-JP - Japanese, Japan

    • ko-KR - Korean, Republic of Korea

    • pt-BR - Portugese, Brazil

    • zh-CN - Chinese, China

    • zh-TW - Chinese, Taiwan

Raises:

Source code in docs_src/capo_codeguruprofiler/_services/code_guru_profiler.py
def get_recommendations(
    self,
    profiling_group_name: "capo_codeguruprofiler.types.profiling_group_name.ProfilingGroupName",
    start_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
    end_time: "capo_codeguruprofiler.types.timestamp.Timestamp",
    *,
    config_overrides: Optional[CodeGuruProfilerClientConfig] = None,
    locale: Optional["capo_codeguruprofiler.types.locale.Locale"] = None,
) -> "capo_codeguruprofiler.types.get_recommendations_response.GetRecommendationsResponse":
    """<p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Recommendation.html"> <code>Recommendation</code> </a> objects that contain recommendations for a profiling group for a given time period. A list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Anomaly.html"> <code>Anomaly</code> </a> objects that contains details about anomalies detected in the profiling group for the same time period is also returned. </p>

    Args:
        profiling_group_name: <p> The name of the profiling group to get analysis data about. </p>
        start_time: <p> The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
        end_time: <p> The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
        locale: <p> The language used to provide analysis. Specify using a string that is one of the following <code>BCP 47</code> language codes. </p> <ul> <li> <p> <code>de-DE</code> - German, Germany </p> </li> <li> <p> <code>en-GB</code> - English, United Kingdom </p> </li> <li> <p> <code>en-US</code> - English, United States </p> </li> <li> <p> <code>es-ES</code> - Spanish, Spain </p> </li> <li> <p> <code>fr-FR</code> - French, France </p> </li> <li> <p> <code>it-IT</code> - Italian, Italy </p> </li> <li> <p> <code>ja-JP</code> - Japanese, Japan </p> </li> <li> <p> <code>ko-KR</code> - Korean, Republic of Korea </p> </li> <li> <p> <code>pt-BR</code> - Portugese, Brazil </p> </li> <li> <p> <code>zh-CN</code> - Chinese, China </p> </li> <li> <p> <code>zh-TW</code> - Chinese, Taiwan </p> </li> </ul>

    Raises:
        capo_codeguruprofiler.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_codeguruprofiler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
        capo_codeguruprofiler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_codeguruprofiler.errors.validation_exception.ValidationException: <p>The parameter is not valid.</p>
        capo_codeguruprofiler.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codeguruprofiler.types.get_recommendations_request.GetRecommendationsRequest]",
    ) -> OperationResponse[
        "capo_codeguruprofiler.types.get_recommendations_response.GetRecommendationsResponse"
    ]:
        import capo_codeguruprofiler._operations.code_guru_profiler.get_recommendations

        output, http_response = (
            capo_codeguruprofiler._operations.code_guru_profiler.get_recommendations.get_recommendations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetRecommendations")
    )
    input_: capo_codeguruprofiler.types.get_recommendations_request.GetRecommendationsRequest = {
        "profiling_group_name": profiling_group_name,
        "start_time": start_time,
        "end_time": end_time,
    }
    if locale is not None:
        input_["locale"] = locale

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