Skip to content
Stackship documentation Svenska

Stackship platformUsers

Operations

What a platform operation is, the states it passes through, and how to follow one in the portal, with the CLI and through the API.

Creating, changing, scaling, deploying or deleting a resource takes longer than one request. The platform records such work as an operation: who started it, what it acts on, its steps, and how it ended. An operation belongs to the boundary of the resource it acts on; a platform upgrade is an operation of the platform itself.

What an operation records

  • Kind — what is being done: Create, Update, Delete, Scale, Start, Stop, Restart, Deploy, Rollback, the slot variants of these for apps, and Rollout for platform upgrades.
  • Resource — its type, name and resource group.
  • Initiated by — the person or service account that started it.
  • Steps — the parts of the work, each with its own status and message.
  • Status and message — how it stands, and why when it failed.
  • Started and completed times.

Statuses

Status Meaning
Running The work is in progress.
Paused Waiting to be resumed — used by platform upgrades.
Succeeded Done.
Failed Stopped with an error; the message says why.
Cancelled Stopped on request.
Superseded A newer operation on the same resource replaced it before it finished.
Dismissed Carried by some older operations. Removing an operation from your notifications does not set it; that hides the operation for you only.

The notifications and a resource's Operations tab leave out Superseded and Dismissed operations; the full history on the boundary's Operations tab includes them.

A running operation in which no step has started or finished for 30 minutes is marked Failed with "Operation timed out waiting for status update." A paused operation is not timed out. Finished operations are kept for 30 days unless your platform is configured otherwise.

In the portal

  • Notifications (the bell in the header) lists running operations and those that finished in the last 24 hours, in the selected boundary — yours, or everyone's. Removing one from the list, or choosing Clear completed, hides it for you only.
  • Each resource has an Operations tab with the operations on that resource.
  • The boundary's page has an Operations tab with its full history, searchable by resource name and filterable by status and time.

Seeing operations needs kernel/operations/read, which every built-in role that can see a resource also has.

With the CLI

Commands that change a resource wait for their operation to finish, unless you pass --no-wait. To follow operations yourself:

bash
stsh operation list --running
stsh operation get <operation-id>
stsh operation wait <operation-id> --timeout 900

stsh operation wait exits with 0 when the operation succeeds, 6 when it fails and 7 when the timeout passes first.

Through the API

A few requests answer 202 Accepted with the operation's id in operationId: deploying and rolling back a static web app, deploying a blueprint, and restoring a snapshot. Most requests that start work do not return it; find it in the operations of the resource. Then poll the operation until its status is neither Running nor Paused:

Method and path Returns
GET /boundaries/{boundaryId}/resourcegroups/{resourceGroupName}/resources/{type}/{name}/operations The resource's operations
GET /boundaries/{boundaryId}/operations Running operations and those finished in the last 24 hours, at most 50
GET /boundaries/{boundaryId}/operations?viewScope=History The full history, paged with pageSize and pageToken, filterable by status, resourceType, resourceName, search, from and to
GET /boundaries/{boundaryId}/operations/{operationId} One operation with its steps