Skip to content

list_experiment_runs

list_experiment_runs(
    experiment_id: ExperimentId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[NextToken] = None,
) -> ListExperimentRunsOutput

Lists the runs of an experiment. Returns a summary for each run, newest first. Use GetExperimentRun to retrieve a single run's full details.

Parameters:

  • experiment_id (ExperimentId) –

    The ID of the experiment to list runs for.

  • max_results (Optional[int], default: None ) –

    The maximum number of runs to return in one page, from 1 to 100. Defaults to 50.

  • next_token (Optional[NextToken], default: None ) –

    A token to retrieve the next page of results.

Raises:

Examples:

List an experiment's runs The following example lists the runs of an experiment: a run reported from the caller's code and a hosted run, newest first. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.list_experiment_runs(experiment_id='exp-01JD8K3M5N7P9Q2R4S6T8V0W1X', max_results=10)
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def list_experiment_runs(
    self,
    experiment_id: "capo_cloudwatchomni.types.experiment_id.ExperimentId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional["capo_cloudwatchomni.types.next_token.NextToken"] = None,
) -> (
    "capo_cloudwatchomni.types.list_experiment_runs_output.ListExperimentRunsOutput"
):
    """Lists the runs of an experiment. Returns a summary for each run, newest first. Use GetExperimentRun to retrieve a single run's full details.

    Args:
        experiment_id: The ID of the experiment to list runs for.
        max_results: The maximum number of runs to return in one page, from 1 to 100. Defaults to 50.
        next_token: A token to retrieve the next page of results.

    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:
        List an experiment's runs
        The following example lists the runs of an experiment: a run reported from the caller's code and a hosted run, newest first. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.list_experiment_runs(experiment_id='exp-01JD8K3M5N7P9Q2R4S6T8V0W1X', max_results=10)
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.list_experiment_runs_input.ListExperimentRunsInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.list_experiment_runs_output.ListExperimentRunsOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.list_experiment_runs

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

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

        return (
            capo_cloudwatchomni.types.list_experiment_runs_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListExperimentRuns", redact_output=_redact_output),
    )
    input_: capo_cloudwatchomni.types.list_experiment_runs_input.ListExperimentRunsInput = {
        "experiment_id": experiment_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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