You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(server): introduce services layer with typed Server model
First step of the incremental migration spelled out in ADR-0007 (which
supersedes ADR-0004's "no services layer" stance). Sets up the two new
packages and converts the four most-used server subcommands as a
proof of concept.
New layout:
- orca_cli/models/server.py — TypedDict view of the Nova server payload
covering the fields orca actually reads (standard names + the
OS-EXT-* / OS-SRV-USG / os-extended-volumes colon-prefixed keys).
- orca_cli/services/server.py — ServerService wraps OrcaClient and owns
/servers URL construction. Methods: find/find_all (paginated read),
get, delete, action, start, stop, reboot. The list operation is
named find/find_all so list[Server] annotations on sibling methods
resolve to the builtin instead of the method itself.
Migrated commands:
- server list, server show, server delete, server reboot
The remaining 30+ subcommands continue to call OrcaClient directly
until they're each migrated in their own commit; ADR-0007 tracks
progress.
Drive-by:
- print_list signature widened from list[dict] to list (any sequence
of mapping-like items, so TypedDict instances pass).
- server_show's local fields annotation widened from list[tuple[str,
str]] to list[tuple[str, Any]] — the second element is whatever the
Nova field returns, stringified by print_detail.
- ADR-0004 marked Superseded by ADR-0007; mkdocs nav and the ADR
index updated.
0 commit comments