Skip to content

RuntimeManager

Creates, lists, and resolves runtimes for a synchronous client.

Sync · Async counterpart: AsyncRuntimeManager

class RuntimeManager(_SdkOwnedHandle):

This type is created by the SDK; do not construct it directly.

manager = client.runtimes

List runtimes, optionally filtered by lifecycle state.

def list(status: str | Sequence[str] | None = None) -> list[Runtime]
NameTypeDefaultDescription
statusstr | Sequence[str] | NoneNoneOptional lifecycle status filter.
  • list[Runtime]

Create a runtime and optionally wait until it is ready.

def create(name: str | None = None, *, checkpoint_id: str | None = None, vcpus: int = 1, memory_mib: int = 1024, memory_max_mib: int | None = None, resources: CreateRuntimeResources | Mapping[str, object] | None = None, ingress_specs: Sequence[IngressSpec | Mapping[str, object]] | None = None, egress_policy: EgressPolicy | None = None, idle_suspend_after_secs: int | None = None, runtime_agent: str | None = None, wait: bool = True, timeout: float = 240.0, poll_interval: float = 0.5) -> Runtime
NameTypeDefaultDescription
namestr | NoneNoneOptional display name for the runtime.
checkpoint_idstr | NoneNoneCheckpoint UUID to restore into the new runtime.
vcpusint1Requested virtual CPU count when resources is not supplied.
memory_mibint1024Requested memory in MiB when resources is not supplied.
memory_max_mibint | NoneNoneOptional maximum memory allocation in MiB.
resourcesCreateRuntimeResources | Mapping[str, object] | NoneNoneStructured resource requests and limits.
ingress_specsSequence[IngressSpec | Mapping[str, object]] | NoneNonePorts and protocols to expose from the runtime.
egress_policyEgressPolicy | NoneNoneInitial outbound network policy.
idle_suspend_after_secsint | NoneNoneIdle time before automatic suspension.
runtime_agentstr | NoneNoneOptional runtime-agent version or channel.
waitboolTrueWait until the runtime is ready before returning.
timeoutfloat240.0Maximum number of seconds to wait for readiness.
poll_intervalfloat0.5Seconds between readiness checks.
  • Runtime — The newly created runtime handle.
  • ApiError — If the control plane rejects the create request.
  • TimeoutError — If wait is true and the runtime is not ready in time.
>>> runtime = client.runtimes.create(name="worker", memory_mib=2048)
>>> runtime.status()
<RuntimeStatus.RUNNING: 'running'>

Resolve a runtime by UUID or display name.

def get(id: str) -> Runtime
NameTypeDefaultDescription
idstrResource UUID or display name.
  • Runtime