Docs
Live demo
POST/api/v2/plans/{id}/apply
access:applyAPI token

Execute an immutable saved plan artifact exactly as persisted.

  • Applies a plan saved by POST /policies/{id}/plan when exact_apply_supported: true. Otherwise use POST /policies/{id}/apply.
  • Refuses (409) if the target changed since planning.
  • For a group rule, apply the group plan itself: a single member’s plan returns 404.

Parameters

Path1 required of 1
idstringpathrequired

Saved Plan ID (UUID)

Responses

202

Accepted

ApplyPolicyResponse · 10 fields
terminalbooleanrequired

Whether this operation has finished.

outcomestring (entity.OperationOutcome)required

Final operation result, or null while the operation is active.

successfailurecancelledpartial
can be null
substatestring (entity.OperationSubstate)required

Qualifies the status and outcome of an operation where they alone would hide what the operator must know. Null when none applies.

rollback_in_progressrolled_backneeds_repairoutcome_unknowninterruptedrequires_approvalholds_lockawaiting_confirmationexpiredtimed_outrescheduled
can be null
created_atstring
execution_modestring
job_idstring
messagestring

Human-readable message about job status

plan_idstring

May be empty if plan creation failed

policy_idstring

Where a background operation is in the shared lifecycle (decision S1). outcome says how a finished operation ended and substate qualifies the state.

queuedrunningfinished
400

Bad Request - the plan ID is not a UUID, or the saved plan cannot be executed exactly (details.error_code exact_plan_not_supported). POST /policies/{id}/plan reports the latter in advance as exact_apply_supported false

409

Conflict - another mutation or cleanup of the policy is in progress (details.cleanup_task_id names a cleanup task. Code policy.apply_in_progress names a running apply of the rule with the same resources, resolution and details as POST /policies/{id}/apply), the saved plan can no longer be applied because it expired, its apply failed or it is a legacy plan not bound to a policy (details.error_code plan_not_applicable), or the plan was generated for an older policy version (the version-mismatch detail). A spent or stale plan needs a new plan. Code policy.member_credentials_pending means members of a group bound directly still have kubeconfigs for the target's previous sign-in source (resources names them). Nothing was applied. Code policy.target_service_account_incomplete means the last check of the MariaDB target's service account found privileges missing (resources names the target, details.missing_privileges the privileges, details.recommended_sql the command a database administrator runs). Nothing was queued

422

Unprocessable: Principal doesn't manage the target, so it doesn't change access on it (code request.unprocessable). Switch the target to managed, then try again. Before v7.3 this answer was 403 authorization.denied.

Common errors: 401 403 404 429 503 504. They mean the same for every operation, see Errors.

↑ ↓ to moveEnter to openEsc to close