Skip to main content
Access via:io.apps.instances

Object that can be used for managing running app instances.

11 Methods

get()⚓︎

(options: InstanceSelect) => Promise<ApplicationInstance | null>

Retrieves an app instance.

Parameters (1)

Name Type Required Description
options⚓︎ InstanceSelect

Filter for selecting an app instance.

getContext()⚓︎

(options: InstanceSelect) => Promise<Record<string, any>>

Retrieves the context of an app instance.

Parameters (1)

Name Type Required Description
options⚓︎ InstanceSelect

Filter for selecting an app instance.

getMany()⚓︎

(filter?: InstanceFilter) => Promise<ApplicationInstance[]>

Retrieves all running app instances. You can also provide an optional filter to refine the result.

Parameters (1)

Name Type Required Description
filter⚓︎ InstanceFilter x

Filter for retrieving app instances.

getState()⚓︎

(options: InstanceSelect) => Promise<InstanceState>

Retrieves the current state of an app instance.

Parameters (1)

Name Type Required Description
options⚓︎ InstanceSelect

Filter for selecting an app instance.

onStarted()⚓︎

Notifies when an app instance has been started. Returns an unsubscribe function.

Parameters (1)

Name Type Required Description
handler⚓︎ InstanceEventHandler<InstanceStartedEvent>

Callback function for handling the event. Receives as an argument an object describing the started app instance.

onStateChanged()⚓︎

Notifies when the current state an app instance has been changed. Returns an unsubscribe function.

Parameters (1)

Name Type Required Description
handler⚓︎ InstanceEventHandler<InstanceStateChangedEvent>

Callback function for handling the event. Receives as an argument an object describing the app instance and its new state.

onStopped()⚓︎

Notifies when an app instance has been stopped. Returns an unsubscribe function.

Parameters (1)

Name Type Required Description
handler⚓︎ InstanceEventHandler<InstanceStoppedEvent>

Callback function for handling the event. Receives as an argument an object describing the stopped app instance and a reason (optional) for stopping the instance.

restart()⚓︎

Restarts an app instance.

Parameters (1)

Name Type Required Description
options⚓︎ RestartInstanceOptions

Options for restarting the instance.

start()⚓︎

(options: StartAppOptions) => Promise<ApplicationInstance>

Starts a new app instance.

Parameters (1)

Name Type Required Description
options⚓︎ StartAppOptions

Options for starting the app instance.

stop()⚓︎

(options: StopInstanceOptions) => Promise<void>

Stops an app instance.

Parameters (1)

Name Type Required Description
options⚓︎ StopInstanceOptions

Options for stopping the app instance.

waitForReady()⚓︎

(options: InstanceSelect) => Promise<void>

Waits for an app instance to be fully initialized.

Parameters (1)

Name Type Required Description
options⚓︎ InstanceSelect

Filter for selecting an app instance.