Out Plane
app

app instances

List the instances an application is actually running.

read onlyrepeatable

What is actually running, one row per instance, with the state the platform sees for each. app list and app get report what was configured; this reports what came of it.

A difference between the two numbers is a rollout in progress, a restart, or an instance that cannot be placed.

Usage

outplane app instances [APP]

Arguments

ArgumentTypeDescription
APPstringApp name or id. Defaults to the linked app.

Output

FieldTypeDescription
namestringThe instance's own name, which changes on every restart.
statestringThe platform's reading of the lifecycle, and the field to branch on: pending, starting, running, failing, terminating, terminated. An unrecognised one decodes to unknown:N, carrying the number the server sent. One of pending, starting, running, failing, terminating, terminated, unknown.
phasestringThe runtime's own word, passed through unchanged: Pending, Running, Succeeded, Failed or Unknown. Weaker than state, which separates starting from failing.
readyboolWhether it is taking traffic. Running and not ready is the interesting state during a rollout.
restartsintHow many times the container has restarted since the instance was created. The only field that shows a crash loop which has since recovered.
reasonstring | nullWhy it is not up, in one sentence. Null while it is running or still starting.
createdAtstring | nullWhen the instance came into being. The only age an instance that never starts has.
startedAtstring | nullWhen the container running now started. After a restart this, not createdAt, is what "up for" measures from.
lastExitCodeint | nullWhat the previous container exited with, when there was one. The application's own code: 137 is a kill for exceeding the memory limit.
deploymentIdint | nullThe deployment that put this instance here, so it can be traced to a row in deploy list.
containerstringThe container a shell attaches to.
containerstring
startedAtstring | nullRFC 3339, UTC.

Examples

What is running right now

outplane app instances checkout

Find the instance to open a shell on

outplane app instances checkout -o text

Wait for a rollout in a script

outplane app instances --json --fields name,ready
{
  "items": [
    {
      "name": "checkout-7d9f-abcde",
      "ready": true
    },
    {
      "name": "checkout-7d9f-fghij",
      "ready": false
    }
  ],
  "total": 2,
  "truncated": false
}

What to Know

  • total is what is running, which is not the configured count. app list reports the configuration; a difference between them is a rollout, a restart or a failure to schedule.
  • phase comes from the container runtime and is passed through unchanged, so a value this release has never seen still arrives intact.
  • An instance name changes every time it restarts. Do not store one.
  • state is the field to branch on. phase is the runtime's raw word and cannot tell a container that is starting from one that keeps dying; state can.
  • createdAt and startedAt answer different questions. The first is how old the instance is, the second is how long the container running now has been up, and after a restart they are hours apart. "Up for" measures from startedAt.
  • restarts is the only field that shows a crash loop which has since recovered: an instance that restarted ten minutes ago and is running now reads healthy everywhere else.
  • lastExitCode is the application's own exit code, so it is safe to show a user. 137 means the container was killed for using more memory than it was allowed.
  • A paused application runs nothing, so this is empty and that is not an error.

Errors

Beyond 0 for success, this command exits with:

ExitKindMeaning
2usageInvalid arguments, unknown flag, or client-side validation failure.
3authNot authenticated, token revoked or expired, or forbidden for this team.
5not_foundThe named resource does not exist, or is not visible to this credential.
8upstreamThe Out Plane API returned a server error.

The code on the error object is one of app.not_found, context.no_app. Branch on that, or on the exit status. The message is prose and changes.

On this page