Docs
Live demo
POST/api/v2/policies/{id}/plan/diff

Generate a Terraform-style before/after diff for plan visualization. member_policy_removals lists the per-member policies a successful apply also deletes, with the access each deletion revokes. Apply_blockers lists why the apply would refuse before it changes anything. With save=true the same operation also saves the plan, from the same read of the target, and returns it as saved_plan.

Returns before/after diff, risk, apply_blockers and deduplicated warning_details (code, object, text, check_before_apply). Group warnings by code (other if uncoded).

Parameters

Path and query1 required of 2
idstringpathrequired

Policy ID (UUID)

savebooleanquery

Also save the shown plan for POST /plans/{id}/apply and return it as saved_plan. The target state is read once for both. The plan expires like one from POST /policies/{id}/plan.

Responses

200

OK

PlanDiffResponse · 20 fields
access_impactAccessImpact

Effect of successful execution on inspected existing MariaDB databases and global privileges. Unknown assessments block confirmation. Sessions describes cached privilege protection over every execution prefix. Removed patterns change grant coverage for future databases, separately from the enumerated existing databases. Runtime failures require a fresh access check.

7 fields
statusstringrequired
preservedreducedunknown
sessionsstringrequired
preservedclosedunknown
reasonstring
databasesarray of stringrequired
tablesarray of stringrequired
global_privilegesarray of stringrequired
removed_patternsarray of stringrequired
apply_blockersarray of PlanApplyBlockerDTOrequired

Reasons the apply refuses before it changes anything, such as group members whose kubeconfigs still wait for the re-issue after a sign-in source change. Empty when the apply can run.

3 fields
codestringrequired
member_credentials_pendingservice_account_incompleteaccount_not_created_by_principal
membersarray of PlanApplyBlockerMemberDTOrequired

The people the blocker concerns, sorted by name: group members, or the person of a personal rule for account_not_created_by_principal. Empty for a target blocker.

3 fields
accountstring

For account_not_created_by_principal, the account on the target, for example maria@%. Empty for other blockers.

member_display_namestringrequired

Name of the member.

member_idstring · uuidrequired

The service account of a MariaDB target as its last check found it (access model MD-P1): the account Principal connects with, the privileges of the contract it lacks with what each one breaks, and the command a database administrator runs. The sentences come from the static contract. Only the account name and the command built from it come from the target. A target response carries it from GET /targets/{id} and from an update (PUT or PATCH /targets/{id}), which answers with the check of a replaced connection, and not before the first check.

6 fields
target_idstring · uuidrequired

The target whose service account was checked. "Check again" checks it.

statestringrequired

ready when the account holds every privilege of the contract. Incomplete blocks changes.

readyincomplete
accountstringrequired

The account as MariaDB writes it, for example "principal@%".

missingarray of ServiceAccountPrivilegeResponserequired
recommended_sqlstring

The GRANT statements a database administrator runs to meet the contract. Absent when ready or when the account name can't be written into a command safely.

checked_atstring · date-timerequired

When the check ran.

created_atstring
current_statemap of string → any

State snapshots (optional, for detailed inspection)

desired_statemap of string → any
errorsarray of string

Validation

expires_atstring

Dependency graph for visualization

2 fields
edgesarray of DependencyEdgeDTO
3 fields
fromstring
tostring
typestring

"depends_on", "references"

nodesarray of DependencyNodeDTO
5 fields
actionstring
idstring
labelstring
resource_typestring
risk_levelstring
instance_idstring

Target the plan was computed for

member_policy_removalsarray of MemberPolicyRemovalDTOrequired

Per-member policies a successful apply deletes after it binds a group itself (Kubernetes direct group RBAC), with the access each deletion revokes. Empty when the apply removes none.

4 fields
member_display_namestringrequired

Name of the member. Empty when the member is unknown in the organization.

member_idstring · uuidrequired

Identity the member policy grants access to.

policy_idstring · uuidrequired

The per-member policy the apply deletes.

rulesarray of PolicyRuleResponserequired

The access the deletion revokes from the member.

3 fields
permissionsarray of string
resourcesarray of string
originstring (AccessOrigin)

Where a row of a rule came from: written in the rule, materialized from its template, or imported from the live account at adoption or by the one-off import after an upgrade. An imported row is part of the desired state like any other row.

ruletemplateimported
policy_versioninteger

Version of the rule a rule preview was built from. Apply sends it back as expected_version. Absent on drift plans.

plan_idstring

Basic plan information

resourcesarray of ResourceDiffDTO

Resource diffs with before/after state

15 fields
actionstring

Change information

action_symbolstring

+, ~, -, -/+, =

addressstring

Human-readable address (e.g., "pg.role.app_reader")

aftermap of string → any

Desired state (null for deletes)

beforemap of string → any

Before/after state for diff visualization

changesarray of AttributeChangeDTO

Attribute-level changes for update operations

5 fields
actionstring

add, remove, change. PostgreSQL role attributes report update

new_valueany

New value (null for removals)

can be null
old_valueany

Previous value (null for additions)

can be null
pathstring

JSON path to attribute

sensitiveboolean

Is this a sensitive value?

depends_onarray of string

Dependencies

descriptionstring

Engine description of the change. Technical wording that may name raw objects

labelstring

The change in plain English: what happens to which object, such as "Grant SELECT on table public.orders in the shop database to user alice". Absent when Principal cannot describe the change.

manifeststring

Kubernetes: YAML manifest

resource_idstring

Resource identification

resource_typestring

role, grant, k8s-role, k8s-rolebinding

risk_levelstring

Risk assessment

risk_reasonstring

Why a high or critical change got its risk level, in words without the level itself (risk_level carries it). Empty for a lower risk and when the row's own description already says it, as for SSH host changes.

sqlstring

Implementation details

Risk analysis

4 fields
high_risk_itemsarray of HighRiskItemDTO
6 fields
actionstring
addressstring
reasonstring

Why this is high risk

resource_idstring
resource_typestring
risk_levelstring
overall_riskstring

low, medium, high, critical

requires_approvalboolean
summarystring

Human-readable risk summary

Present only with save=true when the apply can run (no apply_blockers and access_impact.status is not unknown). The plan saved from the same read of the target and the same rule version as these rows. POST /plans/{id}/apply with its plan_id applies exactly the rows above while exact_apply_supported is true. The rows and summary above are the only count of changes.

4 fields
access_impactAccessImpact

Effect of successful execution on inspected existing MariaDB databases and global privileges. Unknown assessments block confirmation. Sessions describes cached privilege protection over every execution prefix. Removed patterns change grant coverage for future databases, separately from the enumerated existing databases. Runtime failures require a fresh access check.

7 fields
statusstringrequired
preservedreducedunknown
sessionsstringrequired
preservedclosedunknown
reasonstring
databasesarray of stringrequired
tablesarray of stringrequired
global_privilegesarray of stringrequired
removed_patternsarray of stringrequired
exact_apply_supportedbooleanrequired

True when POST /plans/{id}/apply runs this plan exactly. False applies the current state of the rule.

expires_atstring

After this time POST /plans/{id}/apply refuses the plan as not applicable.

plan_idstringrequired
scopestring

"policy" or "drift"

statusstring

"pending": the plan has changes to apply or member policies to remove (member_policy_removals). "applied": the target already matches the policy. "error": the plan has validation errors. Empty only from servers that did not set it.

pendingappliederror

Terraform-style summary of the resource diffs. Member_policy_removals are not counted

10 fields
by_riskmap of string → integer

Breakdown by risk level

by_typemap of string → ActionCountsDTO

Breakdown by resource type

5 fields
createinteger
deleteinteger
no_opinteger
replaceinteger
updateinteger
changes_countinteger

ChangesCount is the actual number of changes (to_create + to_update + to_delete + to_replace) This is distinct from Total, which includes unchanged resources

messagestring

Human-readable message

to_createinteger

Terraform-style counts

to_deleteinteger
to_replaceinteger
to_updateinteger
totalinteger
unchangedinteger
warning_detailsarray of PlanWarningDetailrequired

The same warnings as warnings, one record each, with the code a screen groups them by. Repeats with the same code, object and text are dropped. Empty when the plan has no warnings.

4 fields
check_before_applybooleanrequired

True when the administrator should act on this warning before Apply, false when it only reports what Apply does or leaves. Set by the code, the same for every engine.

codestringrequired

What is wrong, for the administrator. One of role_missing, database_missing, state_partly_unread, privilege_reading_denied, wildcard_not_checked, revocations_skipped, privileges_left_as_is, account_import_pending, sessions_may_end, system_database_access, wildcard_grants_ambiguous, namespace_missing, host_needs_repair, account_not_managed, host_unreachable, host_key_changed, host_sudo_missing, host_refused_change, host_setup_blocks_access, account_not_assignable, group_missing, file_too_large, grant_option_missing, other. other marks a warning that has no code yet. Read its text. The table with the meaning of each code is in the error contract of the backend.

max length 64 · pattern ^[a-z][a-z_]*$
objectstring

The object the warning is about, as the plan names it: a role, a database, database.schema, a table, a namespace or a host. Absent when the warning is about the whole target.

textstringrequired

The warning in words, the same text as in warnings

warningsarray of string

Texts of the warnings, kept for older screens. Warning_details carries the same texts with codes

400

Bad Request - the policy ID is not a UUID, or save is not true or false

409

Conflict - the policy is in cleanup and read-only (details.cleanup_task_id names the task), or the group role name of a group rule is taken by a role Principal didn't create (code policy.group_role_taken, details.role names the role, detail and resolution come from the failure reason group_role_taken of ROLE_EXISTS)

422

Unprocessable Entity - the rule cannot be executed or planned on the target as written, for example a privilege on an object level that does not take it, Kubernetes guards that leave nothing to grant, or future objects with no known creators. Detail and field_errors name the fix Also when Principal doesn't manage the target of the rule or template (before v7.3 that answer was 403 authorization.denied).

501

Not Implemented - a rule uses a privilege the target engine does not support

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

↑ ↓ to moveEnter to openEsc to close