BoxRef
The BoxRef class of @cubicle/sdk: its constructor, properties and methods.
A Box addressed by reference. Creating one makes no request, so it may name a Box that does not exist; the first call reports that.
Get one from cubicle.boxes.ref("acme/job-1"). Its methods are those of Boxes,
bound to this Box. It holds no copy of the Box's record: call info() for current values.
Extended by
Constructors
Constructor
new BoxRef(ref, boxes): BoxRef;Internal
Parameters
| Parameter | Type |
|---|---|
ref | string |
boxes | Boxes |
Returns
BoxRef
Properties
Methods
delete()
delete(options?): Promise<void>;Deletes the Box and waits until its Node removed it. Same as Boxes.delete.
Parameters
| Parameter | Type |
|---|---|
options? | LifecycleOptions |
Returns
Promise<void>
exec()
exec(argv, options?): Promise<ExecResult>;Runs a command and waits for its result. Same as Boxes.exec.
Parameters
| Parameter | Type |
|---|---|
argv | string[] |
options? | ExecOptions |
Returns
Promise<ExecResult>
hibernate()
hibernate(options?): Promise<BoxInfo>;Hibernates the Box and waits until it is hibernated. Same as Boxes.hibernate.
Parameters
| Parameter | Type |
|---|---|
options? | LifecycleOptions |
Returns
Promise<BoxInfo>
info()
info(options?): Promise<BoxInfo>;The Box's current record. Same as Boxes.get.
Parameters
| Parameter | Type |
|---|---|
options? | SignalOptions |
Returns
Promise<BoxInfo>
listOperations()
listOperations(options?): Promise<Operation[]>;The Box's 50 most recent operations. Same as Boxes.listOperations.
Parameters
| Parameter | Type |
|---|---|
options? | SignalOptions |
Returns
Promise<Operation[]>
listSnapshots()
listSnapshots(options?): Promise<Snapshot[]>;The Box's snapshots, newest first. Same as Boxes.listSnapshots.
Parameters
| Parameter | Type |
|---|---|
options? | SignalOptions |
Returns
Promise<Snapshot[]>
restore()
restore(snapshotId, options?): Promise<Operation>;Restores the stopped Box's disk from a snapshot. Same as Boxes.restore.
Parameters
| Parameter | Type |
|---|---|
snapshotId | string |
options? | OperationOptions |
Returns
Promise<Operation>
snapshot()
snapshot(name, options?): Promise<Snapshot>;Snapshots the stopped Box's disk. Same as Boxes.snapshot.
Parameters
| Parameter | Type |
|---|---|
name | string |
options? | OperationOptions |
Returns
Promise<Snapshot>
start()
start(options?): Promise<BoxInfo>;Starts or resumes the Box and waits until it is ready. Same as Boxes.start.
Parameters
| Parameter | Type |
|---|---|
options? | LifecycleOptions |
Returns
Promise<BoxInfo>
stop()
stop(options?): Promise<BoxInfo>;Stops the Box and waits until it is stopped. Same as Boxes.stop.
Parameters
| Parameter | Type |
|---|---|
options? | LifecycleOptions |
Returns
Promise<BoxInfo>
waitUntil()
waitUntil(target, options?): Promise<BoxInfo>;Polls until the Box is ready, stopped or hibernated. Same as Boxes.waitUntil.
Parameters
| Parameter | Type |
|---|---|
target | WaitTarget |
options? | WaitOptions |
Returns
Promise<BoxInfo>
waitUntilReady()
waitUntilReady(options?): Promise<BoxInfo>;Polls until exec and SSH can be used. Same as Boxes.waitUntilReady.
Parameters
| Parameter | Type |
|---|---|
options? | WaitOptions |
Returns
Promise<BoxInfo>

