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.
kinstactl cache clear my-site --env live --no-waitkinstactl operations get <operation-id>kinstactl operations wait <operation-id>Operation IDs
Section titled “Operation IDs”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 cacheFollow with: kinstactl operations wait 0e7b2d61-exampleWith --json stdout has the ID in the operation_id field, next to status: "pending", so use --json when a script has to capture it.
operations get
Section titled “operations get”Show the current status of an operation.
kinstactl operations get 0e7b2d61-examplekinstactl operations get <id> [options]Show the current status of an operation
Arguments
| Argument | Description |
|---|---|
id | operation 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.
operations wait
Section titled “operations wait”Wait until an operation has finished.
kinstactl operations wait 0e7b2d61-example --timeout 10kinstactl operations wait <id> [options]Wait until an operation has finished
Arguments
| Argument | Description |
|---|---|
id | operation ID |
Options
| Option | Description |
|---|---|
--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.