Lifecycle for durable event history and webhooks. Use Monitor for live
runtime observations while a client is connected.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Python SDK object reference for lifecycle events, webhooks, and live monitor streams.
Lifecycle for durable event history and webhooks. Use Monitor for live
runtime observations while a client is connected.
| Method group | Use |
|---|---|
Lifecycle.list_events(...) | List account-level lifecycle events. |
Lifecycle.list_machine_events(machine_id, ...) | List events for one machine. |
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_webhook | Manage webhook registrations. |
Lifecycle.list_webhook_deliveries(...) | Inspect delivery attempts. |
| Method | Use |
|---|---|
Monitor.subscribe(...) | Subscribe to machine 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(machine.id).subscribe(on_metrics=on_metrics)
try:
machine.commands.run("sleep 5", shell=True)
finally:
subscription.stop()