Skip to content

NameRecord

@final
class NameRecord

One named VM: everything Sandbox.adopt needs, under a name.

Holds a secret. agent_token is readable so the VM can be adopted, but it stays out of repr; keep records (and to_dict() output) in private storage.

NameRecord(name: str, microvm_id: str, endpoint: str, agent_token: str, region: Region)

A record for a VM this process can already address. Refuses an illegal name or an empty id, endpoint, or token.

agent_token: str

The VM’s bearer credential. Store only privately; never in repr.

at: int

Seconds since the epoch when the name was registered.

egress_posture: str | None

The launch’s egress posture label, or None when the registering process did not know it.

endpoint: str
microvm_id: str
name: str
region: str

The region the VM runs in, as the record spells it.

tunnel_identity: TunnelIdentity | None

The VM’s tunnel identity, when it was launched with identity=True; None otherwise.

Raises when the record carries one half of the pair, or a half that doesn’t decode: the record claims a verifiable VM, and reading it as unverifiable would hide that it’s broken. Holds the host’s secret half, which stays out of this record’s repr.

@staticmethod
def for_sandbox(name: str, sandbox: Sandbox) -> NameRecord

A record naming the VM sandbox addresses — launched or adopted.

@staticmethod
def from_dict(record: dict) -> NameRecord

A record from to_dict() output (or a CLI registry file’s JSON), checked.

def to_dict() -> Any

The record as a JSON-safe dict with the CLI registry’s camelCase keys, agent token included — the form to store privately and read back with from_dict.

def __eq__(other: object, /) -> bool
def __repr__() -> str

This page is generated from bindings/microvms-py/microvms.pyi by Griffe 2.3.0, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run stubs. mise run stubs:check fails when the committed file no longer matches the source.