Skip to content

Auto-report status to PSA-OPS after lifecycle commands #91

Description

@kbens

Current state

Only psa domain status --report pushes status to PSA-OPS (via _report_status_to_api at src/psa/commands/domain.py:171). Lifecycle commands (start, stop, restart, bounce, kill, configure, purge, flush) execute the action and exit without updating PSA-OPS. Users have to follow up with psa domain status --report to sync.

Desired

After each lifecycle command's success, send the resulting status to PSA-OPS automatically. Reuse _report_status_to_api — we already know the post-action state without re-parsing psadmin (e.g. Running after start, Stopped after stop).

Proposed shape

  • Add config.ops.auto_report_status (bool, default false). One-time opt-in via psa config set auto_report_status true.
  • When enabled and PSA-OPS is configured, lifecycle commands report the new state after a successful action.
  • --no-report escape hatch on each lifecycle command to suppress per-invocation.
  • Quiet when PSA-OPS isn't configured (existing _report_status_to_api already handles it).

Out of scope

  • Reporting failures / intermediate states (e.g. Starting, Stopping).
  • Auto-report on every command (read-only commands like list and compare shouldn't push state).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions