List available profiles
Profiles describe the runner capabilities and guardrails a sandbox runs under. List them first to decide where to place a sandbox. Uselist_profiles() to query profiles and their capabilities:
Filter by networking
Pass networking filters tolist_profiles() to narrow results to profiles that support a specific ingress and egress combination:
Parameters
The following parameters are available onlist_profiles():
Get a single profile
Useget_profile() to fetch a specific profile by name:
runner_id parameter.
List available runners
List runners to see which clusters are registered, what hardware they expose, and how much capacity is free before you target one. Uselist_runners() to query runners and their capabilities:
Runner objects have a built-in representation that shows the runner ID, health
status, CPU and memory in human-readable units, GPU count, and profile list.
Check resource availability
Passinclude_resources=True to include live resource data on each runner.
Use format_bytes() and format_cpu() to display values in human-readable units:
Filter by capacity
Use capacity filters to find runners that have enough free resources. These filters enableinclude_resources automatically.
Parameters
The following parameters are available onlist_runners():
Get a single runner
Useget_runner() to fetch a specific runner by ID. The call always returns full
runner details, including resource availability:
Create a sandbox from discovery results
After you select a profile, pass it directly into sandbox creation to control where the sandbox runs. EachProfile exposes profile_name as its identifier. Pass that value to the
profile_names parameter on Sandbox.run() or SandboxDefaults.
Target a profile directly
Pass a discovered profile name toSandbox.run() through the profile_names parameter:
Use discovery with NetworkOptions
Filter profiles by networking capabilities, then configure the sandbox with matchingNetworkOptions:
Set profile in SandboxDefaults
UseSandboxDefaults to apply a discovered profile to all sandboxes in a session:
Error reference
Discovery calls can raise the following exceptions. Use them to handle missing resources and authentication failures in your code.
For the full exception hierarchy, see the
exceptions reference.
For common troubleshooting steps, see the
troubleshooting guide.