On this page

Resources

stado resources reads the cloud resources and storage this fleet holds, plans what to remove, and carries out exactly the plan an operator reviewed. Planning never changes anything; execution only ever follows a plan file whose hash the operator states.

Invocations

  • stado resources show [--provider <PROVIDER>] [--json] prints one read-only inventory across the configured providers and storage. Its closing line counts the registry's hosts and coordinators; when the host registry source read no list, it prints not read (<the source's error>) instead of counting zero.
  • stado resources adopt <RESOURCE-ID> --owner <OWNER> --policy-ref <POLICY> --expect-revision <REVISION> brings one observed resource under Stado ownership. The resource id is the canonical stado:// id resources show prints, and the revision is the provider revision seen during review.
  • stado resources rationalize --min-age <AGE> --output <PLAN> [--provider <PROVIDER>] [--json] writes an immutable rationalization plan. --min-age is a number followed by s, m, h or d; it has no default, because how old a resource must be before it may be called unneeded is the operator's to say. Without --json it prints one row per recommendation and one per source read, SOURCE, STATE and WHY: a source read in full has nothing in WHY, and any other (skipped, blocked, degraded, unsupported) shows the error, reason and remedy: it gave, or not reported when it gave none.
  • stado resources shutdown --project <GCP-PROJECT> (--all-stado-owned | --resource <LOCATOR> ...) --output <PLAN> [--json] writes a reversible shutdown plan. A locator looks like gcp:instance:ZONE/NAME.
  • stado resources apply --plan <PLAN> --expect-hash <SHA256> [--approve <ACTION> ...] [--allow-irreversible] [--yes] [--json] carries out the plan.
  • stado resources verify --operation <ID> [--json] checks live resources against an applied or restored operation.
  • stado resources restore --operation <ID> --yes [--json] undoes the reversible actions an operation applied.
  • stado resources operations list [--json] and stado resources operations show <ID> [--json] read the operation journal, newest first, with each operation's archived plan, state and events.

How apply reads a plan

apply checks the file before it does anything. The plan must be the canonical bytes Stado wrote, its SHA-256 must match --expect-hash, it must not have expired, and the Stado configuration must be the one it was planned under. Then it runs the plan as the plan's own intent says.

  • Rationalization plan (from rationalize). Without --yes, apply prints which actions it would run and changes nothing. With --yes, it runs the actions the plan marks automatic, the actions named with --approve, and every action those depend on. An irreversible action runs only when it is named with --approve and --allow-irreversible is given.
  • Shutdown plan (from shutdown). apply runs every action in the plan and needs --yes. --approve and --allow-irreversible are refused here, because they choose among a rationalization plan's actions.

Every run is recorded in the operation journal, and verify, restore and operations read it.

Refusals

  • plan is not canonical Stado JSON; regenerate it instead of editing it
  • plan hash mismatch: expected <EXPECTED>, actual <ACTUAL>
  • plan expired at <TIME>; generate a fresh inventory and plan
  • Stado configuration changed after planning; generate a fresh plan
  • resources apply executes the plans `resources rationalize` and `resources shutdown` write; this plan's intent is <INTENT>
  • --approve references unknown action "<ID>"
  • irreversible actions require explicit --approve even when automatic: <IDS>
  • selected irreversible actions require --allow-irreversible: <IDS>
  • a shutdown plan runs every action it holds; --approve and --allow-irreversible select among a rationalization plan's actions
  • resources apply requires --yes after reviewing the shutdown plan
  • resources restore requires --yes after reviewing rollback coverage
  • archived plan hash does not match operation state (from verify and restore)

Stado Desktop

The operator console runs every resources command. A request it judges from the command's own help to only read, such as show, verify and operations, runs without confirmation; it asks before any other, such as adopt, rationalize, shutdown, apply and restore.

Source: this website