Skip to content

NameRecord

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

new NameRecord(
name: string,
microvmId: string,
endpoint: string,
agentToken: string,
region: Region
): NameRecord;

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

Parameter Type
name string
microvmId string
endpoint string
agentToken string
region Region

NameRecord

get at(): number;

Seconds since the epoch when the name was registered.

number


get egressPosture(): string | null;

string | null


get endpoint(): string;

string


get microvmId(): string;

string


get name(): string;

string


get region(): string;

string

agentToken(): string;

The VM’s bearer credential. A method rather than a getter, so it is never read by accident; store it only privately.

string


toObject(): NameRecordObject;

The record as a plain object, agent token included — the form to store privately and read back with fromObject.

NameRecordObject


toString(): string;

The record without its secrets.

string


tunnelIdentity(): TunnelIdentity | null;

The VM’s tunnel identity, when it was launched with identity: true; null otherwise.

Throws 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. A method, like agentToken(), because it holds the host’s secret half.

TunnelIdentity | null


static forSandbox(name: string, sandbox: Sandbox): Promise<NameRecord>;

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

Parameter Type
name string
sandbox Sandbox

Promise<NameRecord>


static fromObject(object: NameRecordObject): NameRecord;

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

Parameter Type
object NameRecordObject

NameRecord

This page is generated from bindings/microvms-js/index.d.ts by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, 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 dts. mise run dts:check fails when the committed file no longer matches the source.