Skip to content

get_experiment_run

get_experiment_run(
    experiment_id: ExperimentId,
    run_id: ExperimentRunId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> GetExperimentRunOutput

Retrieves the details of a run. The response includes the run's status, progress, case summary, evaluator metrics and, when it has a rule, its verdict and the checks behind it. For a hosted run, it also includes the batch evaluation's progress.

Parameters:

  • experiment_id (ExperimentId) –

    The ID of the experiment the run belongs to.

  • run_id (ExperimentRunId) –

    The ID of the run to retrieve.

Raises:

Examples:

Get a completed hosted run The following example returns a hosted run that has completed and passed its rule. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.get_experiment_run(experiment_id='exp-01JD8K3M5N7P9Q2R4S6T8V0W1X', run_id='run-01JD8M2A4C6E8G0J2K4M6P8R0T')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def get_experiment_run(
    self,
    experiment_id: "capo_cloudwatchomni.types.experiment_id.ExperimentId",
    run_id: "capo_cloudwatchomni.types.experiment_run_id.ExperimentRunId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.get_experiment_run_output.GetExperimentRunOutput":
    """Retrieves the details of a run. The response includes the run's status, progress, case summary, evaluator metrics and, when it has a rule, its verdict and the checks behind it. For a hosted run, it also includes the batch evaluation's progress.

    Args:
        experiment_id: The ID of the experiment the run belongs to.
        run_id: The ID of the run to retrieve.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Get a completed hosted run
        The following example returns a hosted run that has completed and passed its rule. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.get_experiment_run(experiment_id='exp-01JD8K3M5N7P9Q2R4S6T8V0W1X', run_id='run-01JD8M2A4C6E8G0J2K4M6P8R0T')
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.get_experiment_run_input.GetExperimentRunInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.get_experiment_run_output.GetExperimentRunOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.get_experiment_run

        output, http_response = (
            capo_cloudwatchomni._operations.cloud_watch_omni_frontend.get_experiment_run.get_experiment_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_cloudwatchomni.types.get_experiment_run_output.GetExperimentRunOutput",
    ) -> dict[str, Any]:
        import capo_cloudwatchomni.types.get_experiment_run_output

        return capo_cloudwatchomni.types.get_experiment_run_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetExperimentRun", redact_output=_redact_output),
    )
    input_: capo_cloudwatchomni.types.get_experiment_run_input.GetExperimentRunInput = {
        "experiment_id": experiment_id,
        "run_id": run_id,
    }

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