Maintenance plan and approval API

Maintenance plan and approval API

Preview disruptive plans, bind approvals to revisions, and inspect partial execution.

Maintenance plans record a reviewed target set and ordered node actions. Execution and approval references preserve the plan revision used for each child.

Create a draft

POST/organizations/{organization_id}/maintenance-plans
Scope
maintenance:write
Auth
Bearer API key

Creates a draft maintenance plan for the selected nodes.

Send name, node_ids, steps, concurrency, and an optional execution window. Steps are named actions supported by the plan schema, such as cordon, drain, patch, validate, and uncordon. concurrency defaults to 1 and must be a positive integer permitted by organization policy.

To create a drain-and-patch plan for 2 selected nodes, send:

JSON
{
  "name": "eu-west security rollout",
  "node_ids": ["nod_eu01", "nod_eu02"],
  "steps": [
    { "type": "cordon" },
    { "type": "drain" },
    { "type": "patch", "patch_policy_id": "patch_security" },
    { "type": "validate" },
    { "type": "uncordon" }
  ],
  "concurrency": 1,
  "failure_policy": "pause"
}

Returns 201 with draft ID and revision. failure_policy defaults to pause and can be continue only where organization policy permits it. Unsupported step sequences return 422 invalid_plan.

Preview and approve

POST/organizations/{organization_id}/maintenance-plans/{plan_id}/preflight
Scope
maintenance:write
Auth
Bearer API key

Returns the target digest, capacity and storage blockers, and approval requirements. It does not reserve future destinations.

POST/organizations/{organization_id}/maintenance-plans/{plan_id}/approvals
Scope
maintenance:approve
Auth
Bearer API key

Records approval for the reviewed plan revision.

Requires maintenance:approve, If-Match, a preflight_id, and a reason. It records an approval for that revision. Self-approval returns 403 self_approval_forbidden under the default policy. A changed target set returns 412 plan_stale.

Execute

POST/organizations/{organization_id}/maintenance-plans/{plan_id}/execute
Scope
maintenance:write
Auth
Bearer API key

Starts an approved maintenance plan.

Requires maintenance:write, If-Match, and an idempotency key. Valid admission returns 202 with parent operation ID. Missing or expired approval returns 409 approval_required.

Execution repeats required checks before each disruptive step. A valid approval does not bypass insufficient capacity or unresolved storage ownership.

Pause and resume

POST/organizations/{organization_id}/maintenance-plans/{plan_id}/pause
Scope
maintenance:write
Auth
Bearer API key

Stops admission of new node sequences. Running children resolve according to their lifecycle.

POST/organizations/{organization_id}/maintenance-plans/{plan_id}/resume
Scope
maintenance:write
Auth
Bearer API key

Resumes maintenance within the reviewed revision and approval window.

Requires the same reviewed revision and a valid approval window; otherwise new review is needed.

Read the plan for per-node step outcomes and the Operation API for active children. Successful moves or patches are not rolled back when another target fails. See maintenance approvals for revocation and exceptions.