Skip to content

Python Runtimes

AsyncRunta and Runta expose the same runtime collection and runtime object interfaces. Async examples await each call; sync examples use the same methods directly.

InterfacePurpose
runta.runtimes.list()List runtimes. Accepts a single status or list of statuses.
runta.runtimes.get(id_or_name)Fetch one runtime by UUID or display name.
runta.runtimes.create(name, …)Create a runtime, optionally with resources or a checkpoint.
runtimes = await runta.runtimes.list()
for runtime in runtimes:
print(runtime.id, runtime.name, runtime.cached_info.status)
running = await runta.runtimes.list(status="running")
stopped = await runta.runtimes.list(status=["stopped", "paused"])
runtime = await runta.runtimes.get("runtime-uuid-or-name")
runtime = await runta.runtimes.create(
"worker",
vcpus=2,
memory_mib=2048,
)

create(), start(), and resume() wait until the runtime is ready by default. Pass wait=False when you only want to send the request.

MethodPurpose
runtime.start()Boot a shut-down runtime.
runtime.pause()Pause a running runtime.
runtime.resume()Resume a paused runtime.
runtime.stop()Shut down a runtime.
runtime.delete()Delete the runtime.
runtime.refresh_info()Refresh local runtime metadata.
await runtime.start()
await runtime.pause()
await runtime.resume()
await runtime.stop()
await runtime.delete()

Refresh local runtime metadata:

await runtime.refresh_info()
print(runtime.cached_info.status)