Skip to content

operations

Many Kinsta actions, such as creating a site or pushing an environment, run in the background and return an operation ID. By default kinstactl waits for the operation to finish for you. The operations commands are for the other case: you started something with --no-wait and want to look at it or wait for it later.

Terminal window
kinstactl cache clear my-site --env live --no-wait
kinstactl operations get <operation-id>
kinstactl operations wait <operation-id>

Most commands that start an operation take --no-wait (commands that finish immediately, such as ssh enable, do not; --help lists the flags). It returns as soon as Kinsta has accepted the request. Without --json stdout gets a Started … line and the operation ID appears only in the Follow with: hint on stderr:

✔ Started Clear cache
Follow with: kinstactl operations wait 0e7b2d61-example

With --json stdout has the ID in the operation_id field, next to status: "pending", so use --json when a script has to capture it.

Show the current status of an operation.

Terminal window
kinstactl operations get 0e7b2d61-example
kinstactl operations get <id> [options]

Show the current status of an operation

Arguments

ArgumentDescription
idoperation ID

Kinsta API: GET /operations/{operation_id}

This asks Kinsta once and returns. It does not wait, so use it to peek at an operation that is still running. The status is pending or completed. An operation that Kinsta reports as failed makes the command exit with code 3, and an unknown ID fails with a USAGE error.

Wait until an operation has finished.

Terminal window
kinstactl operations wait 0e7b2d61-example --timeout 10
kinstactl operations wait <id> [options]

Wait until an operation has finished

Arguments

ArgumentDescription
idoperation ID

Options

OptionDescription
--timeout <minutes>give up waiting after this many minutes (default 30)

Global options --profile, --json and --no-input apply too. See scripting and CI.

Kinsta API: GET /operations/{operation_id}

The command polls the operation and prints a success line when it has completed. --timeout is in minutes and defaults to 30, the same as on every command that waits by itself. The exit code tells a script what happened:

  • 0: the operation completed.
  • 3: the operation failed (OPERATION_FAILED).
  • 4: the timeout passed before the operation finished (OPERATION_TIMEOUT).

The same codes apply to any command that waits for an operation without --no-wait.