Expose persistent read-only reconciliation CLI

This commit is contained in:
Lyncoln
2026-09-19 18:56:54 -04:00
parent 5cd1bc5ba3
commit 86396447d9
4 changed files with 322 additions and 2 deletions
+36
View File
@@ -13,3 +13,39 @@ def print_plan(plan):
print(f"{'SKIP':<10} {h:<45} {item.reason}")
else:
print(f"{'UNCHANGED':<10} {h:<45} {item.desired.ip}")
def print_endpoint_plans(plans):
if not plans:
print("No apply-capable endpoints have planned actions.")
return
for plan in plans:
print(f"Endpoint: {plan.endpoint_id}")
if not plan.actions:
print(" No desired objects for this endpoint.")
continue
for action in plan.actions:
desired = action.desired
if desired is None:
identity = "(no desired object)"
else:
identity = (
f"{desired.object_type} "
f"{desired.logical_key}"
)
suffix = ""
if (
desired is not None
and desired.object_type == "dns_records"
):
target_ip = desired.payload.get("ip")
if target_ip:
suffix = f" -> {target_ip}"
print(
f" {action.operation.value.upper():<8} "
f"{identity}{suffix}"
)