Expose persistent read-only reconciliation CLI
This commit is contained in:
@@ -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}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user