Sandbox class

Constructors

Sandbox({String? class_, int? connectedAt, int? createdAt, String? error, int? expiresAt, String? id, String? image, String? kind, int? lastUsedAt, String? org, String? project, String? runtime, String? status, String? volume})
Returns a new Sandbox instance.

Properties

class_ ↔ String?
Class is what the sandbox is FOR, and it decides the image, the working directory and the isolation: "exec" for a code-interpreter call (workdir /mnt/data, no project, bounded per org), "dev" for a workspace bound to a project (workdir /work, single-attach), "desktop" for one with a screen.
getter/setter pair
connectedAt ↔ int?
ConnectedAt is when somebody was last known to have this sandbox's project OPEN, Unix seconds. It is a fact with an EXPIRY rather than a flag: a watcher restamps it every beat of its stream, and it goes stale on its own when the stream dies, so nothing has to be turned off by a process that may not be there any more. The reaper reads it to choose WHICH idle allowance applies — see lifecycle.go. Zero means nobody has said so, which puts the sandbox on the short clock.
getter/setter pair
createdAt ↔ int?
CreatedAt is when the lease was first taken, Unix seconds.
getter/setter pair
error ↔ String?
Error is why the sandbox could not come up, in plain words. Present only with status "error", and it is the field to read rather than inferring a cause from the absence of a pod.
getter/setter pair
expiresAt ↔ int?
ExpiresAt is when the lease ends, Unix seconds. Past it the reaper may take the sandbox at any time; it is a deadline, not a guarantee of survival until then, since an idle sandbox goes sooner.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
id ↔ String?
ID is the sandbox's server-minted handle and what every operation addresses it by. The caller does not choose it.
getter/setter pair
image ↔ String?
Image is the container image this sandbox is actually running — the one the class chose, or an override the policy admitted. It is what ran, not what was asked for.
getter/setter pair
kind ↔ String?
Kind is the resource family this row belongs to. Always "sandbox" here; it exists because the store this shares is keyed across kinds.
getter/setter pair
lastUsedAt ↔ int?
LastUsedAt is when the sandbox last did work, Unix seconds. The reaper reads it: a sandbox idle past the idle window is reclaimed even inside its TTL, because an idle lease is capacity nobody is using.
getter/setter pair
org ↔ String?
Org is the org that holds the lease — the validated caller's, never a value a request supplied. It is also the store's key, so a sandbox is not merely filtered out of another org's answers; it is unreachable from them.
getter/setter pair
project ↔ String?
Project is the project this sandbox is bound to. A dev or desktop sandbox has one and is SINGLE-ATTACH under it, so asking twice resumes rather than leasing a second; an exec sandbox has none.
getter/setter pair
runtime ↔ String?
Runtime is the isolation boundary this sandbox GOT, which is not always the one it asked for: a caller states a preference and runtimeFor answers with what the sandbox can actually have. Reported so a person comparing two runtimes is comparing the runtimes they got rather than the ones they typed — the difference between those two is the whole reason to record it. Empty means the node's default runtime, which is a real answer and not a missing one. This is not a copy that can go stale. runtimeClassName is IMMUTABLE on a pod, a sandbox's pod is created once and never recreated (restartPolicy Never, no pool), and its name is never reused — so for as long as the pod this row names exists, it is running this runtime. The alternative, asking the apiserver on every read, buys nothing and costs a round trip per row.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status ↔ String?
Status is where the sandbox is in its life: "pending" while the pod is coming up, "running" once it can take work, "error" when it cannot. Only a running sandbox takes an exec or mints an interactive ticket.
getter/setter pair
volume ↔ String?
Volume is the persistent volume attached to the sandbox, when it has one. A dev sandbox keeps its work across leases through it; an exec sandbox has none and loses everything outside /mnt/data when the lease ends.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → Sandbox?
Returns a new Sandbox instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<Sandbox>
mapFromJson(dynamic json) → Map<String, Sandbox>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<Sandbox>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.