Skip to main content
Use Lifecycle for durable event history and webhooks. Use Monitor for live runtime observations while a client is connected.

Lifecycle

Method groupUse
Lifecycle.list_events(...)List account-level lifecycle events.
Lifecycle.list_sandbox_events(sandbox_id, ...)List events for one sandbox.
Lifecycle.list_snapshot_events(snapshot_id, ...)List events for one snapshot.
Lifecycle.stream(...)Stream lifecycle transitions.
Lifecycle.create_webhook(...)Register a webhook endpoint.
Lifecycle.list_webhooks, get_webhook, delete_webhookManage webhook registrations.
Lifecycle.list_webhook_deliveries(...)Inspect delivery attempts.

Monitor

MethodUse
Monitor.subscribe(...)Subscribe to sandbox info, metrics, process, update, snapshot, and error callbacks.
subscription.stop()Stop a live subscription.
from nullspace import Monitor

def on_metrics(metrics):
    print(metrics.cpu_percent, metrics.memory_bytes)

subscription = Monitor(sandbox.id).subscribe(on_metrics=on_metrics)
try:
    sandbox.commands.run("sleep 5", shell=True)
finally:
    subscription.stop()