list_runners
Source: src/cwsandbox/_discovery.py:405
List available runners, optionally filtered.
Creates a gRPC channel, issues the RPC(s), and closes the channel before
returning. Automatically paginates when the server returns a
next_page_token.
Parameters
runner_group_id (str | None): Restrict results to this runner group.
profile_name (str | None): Only return runners that have this profile.
gpu_type (str | None): Only return runners that support this GPU type.
architecture (str | None): Only return runners that support this CPU architecture.
include_resources (bool): If True, include live resource availability on each runner. Defaults to False (basic view).
min_available_cpu_millicores (int | None): Only return runners with at least this many unreserved CPU millicores. Automatically enables include_resources. Filtered client-side.
min_available_memory_bytes (int | None): Only return runners with at least this many unreserved memory bytes. Automatically enables include_resources. Filtered client-side.
min_available_gpu_count (int | None): Only return runners with at least this many unreserved GPUs. Automatically enables include_resources. Filtered client-side.
service_exposure_mode (str | None): Only return runners whose profiles support this service exposure mode. Requires an additional profile fetch. Filtered client-side.
egress_mode (str | None): Only return runners whose profiles support this egress mode. Requires an additional profile fetch. Filtered client-side.
Note: The service_exposure_mode and egress_mode filters check across all profiles on each runner, not only the profile specified by profile_name. A runner will match if any of its profiles provides the requested mode, even if the profile selected by profile_name does not.
Returns
list[Runner]: List of Runner objects matching the filters.
Raises
CWSandboxAuthenticationError: If credentials are invalid.
CWSandboxError: On network or service errors.
get_runner
Source: src/cwsandbox/_discovery.py:530
Get a single runner by ID.
Always returns full details including resource availability.
Parameters
runner_id (str): Unique identifier of the runner.
Returns
Runner: Runner with full details.
Raises
ValueError: If runner_id is empty.
RunnerNotFoundError: If no runner exists with the given ID.
CWSandboxAuthenticationError: If credentials are invalid.
CWSandboxError: On network or service errors.
list_profiles
Source: src/cwsandbox/_discovery.py:609
List available profiles, optionally filtered.
Creates a gRPC channel, issues the RPC(s), and closes the channel before
returning. Automatically paginates when the server returns a
next_page_token.
Parameters
gpu_type (str | None): Only return profiles that support this GPU type.
architecture (str | None): Only return profiles that support this CPU architecture.
runner_id (str | None): Only return profiles belonging to this runner.
service_exposure_mode (str | None): Only return profiles that support this service exposure mode. Filtered client-side after fetching results from the backend.
egress_mode (str | None): Only return profiles that support this egress mode. Filtered client-side after fetching results from the backend.
Returns
list[Profile]: List of Profile objects matching the filters.
Raises
CWSandboxAuthenticationError: If credentials are invalid.
CWSandboxError: On network or service errors.
get_profile
Source: src/cwsandbox/_discovery.py:698
Get a single profile by name.
Parameters
profile_name (str): Name of the profile to retrieve.
runner_id (str | None): Optionally scope the lookup to a specific runner.
Returns
Profile: Profile matching the given name.
Raises
ValueError: If profile_name is empty.
ProfileNotFoundError: If no matching profile is found.
CWSandboxAuthenticationError: If credentials are invalid.
CWSandboxError: On network or service errors.
Source: src/cwsandbox/_discovery.py:43
Format bytes as a human-readable string using binary units.
Parameters
value (int): Number of bytes.
Returns
str: Human-readable string with appropriate unit.
Examples
Source: src/cwsandbox/_discovery.py:71
Format CPU millicores as a human-readable string.
Parameters
millicores (int): CPU capacity in millicores.
Returns
str: Human-readable string in cores.
Examples
Last modified on June 10, 2026