Skip to content

Run API

api_get_all_run(runner_id='')

Retrieves all runs for a given runner ID or for all runners if no ID is provided.

This function calls an internal API to get available runs and then converts each run into a dictionary format.

Parameters:

Name Type Description Default
runner_id str

The ID of the runner to retrieve runs for. If empty, runs for all runners

''

Returns:

Type Description
list[dict]

list[dict]: A list of dictionaries, each representing a run's data.

Source code in moonshot/src/api/api_run.py
def api_get_all_run(runner_id: str = "") -> list[dict]:
    """
    Retrieves all runs for a given runner ID or for all runners if no ID is provided.

    This function calls an internal API to get available runs and then converts each run into a dictionary format.

    Args:
        runner_id (str, optional): The ID of the runner to retrieve runs for. If empty, runs for all runners
        are retrieved.

    Returns:
        list[dict]: A list of dictionaries, each representing a run's data.
    """
    _, runs = _api_get_available_runs(runner_id)
    return [run.to_dict() for run in runs]