Overview
Add scm operations command group for dispatching and monitoring asynchronous device jobs. Wraps the new client.device_operations service from SDK 0.13.0.
Context
SDK 0.13.0 adds client.device_operations supporting 7 operation types:
- Route tables — retrieve device routing tables
- FIB tables — retrieve forwarding information base
- DNS proxy — query DNS proxy configuration/status
- Network interfaces — retrieve interface status/config
- Device rules — retrieve applied security rules
- BGP policy export — export BGP routing policies
- Logging service status — check logging service health
Each supports async (fire-and-forget, returns job ID) and sync (poll-to-completion) modes.
Dependencies
Design Decisions (from brainstorming session 2026-04-16)
- Top-level command group:
scm operations <action> [options]
- Default sync,
--async flag for fire-and-forget: Commands block and poll by default. --async returns the job ID immediately.
- Sync mode shows results; async mode shows job ID: When sync completes, display the operation results. When
--async, print only the job ID for later follow-up.
- Job status check subcommand:
scm operations status --job-id <id> to check on async jobs
Scope
- In scope:
- New command module:
src/scm_cli/commands/operations.py
- Subcommands for each operation type:
scm operations route-table --device <name>
scm operations fib-table --device <name>
scm operations dns-proxy --device <name>
scm operations interfaces --device <name>
scm operations device-rules --device <name>
scm operations bgp-export --device <name>
scm operations logging-status --device <name>
scm operations status --job-id <id> (check job status)
- All commands support
--async flag and --timeout <seconds> for sync mode
- SDK client methods in
sdk_client.py for each operation type
- Mock mode support with realistic job dispatch/completion data
- Register in
main.py as top-level command group
- Tests:
tests/test_operations_commands.py
- Documentation:
docs/cli/operations/ pages
- Update
mkdocs.yml nav
- Out of scope:
CLI Interface
# Sync (default) — blocks until complete, shows results
scm operations route-table --device fw-01
# Async — returns job ID immediately
scm operations route-table --device fw-01 --async
# Sync with custom timeout
scm operations fib-table --device fw-01 --timeout 120
# Check job status
scm operations status --job-id abc-123
# Mock mode
scm operations interfaces --device fw-01 --mock
Acceptance Criteria
Implementation Notes
- SDK dispatch methods return a job object with
job_id; sync mode internally polls until state == "completed"
JobTimeoutError has job_id and last_state attributes — surface both in error message: "Job {job_id} timed out in state '{last_state}'. Check status with: scm operations status --job-id {job_id}"
- Table output for results varies by operation type (route tables have different columns than interface status)
- Consider a shared
--device option constant since all 7 operations require it
- Follow
commands/jobs.py for job-related output patterns
Overview
Add
scm operationscommand group for dispatching and monitoring asynchronous device jobs. Wraps the newclient.device_operationsservice from SDK 0.13.0.Context
SDK 0.13.0 adds
client.device_operationssupporting 7 operation types:Each supports async (fire-and-forget, returns job ID) and sync (poll-to-completion) modes.
Dependencies
Design Decisions (from brainstorming session 2026-04-16)
scm operations <action> [options]--asyncflag for fire-and-forget: Commands block and poll by default.--asyncreturns the job ID immediately.--async, print only the job ID for later follow-up.scm operations status --job-id <id>to check on async jobsScope
src/scm_cli/commands/operations.pyscm operations route-table --device <name>scm operations fib-table --device <name>scm operations dns-proxy --device <name>scm operations interfaces --device <name>scm operations device-rules --device <name>scm operations bgp-export --device <name>scm operations logging-status --device <name>scm operations status --job-id <id>(check job status)--asyncflag and--timeout <seconds>for sync modesdk_client.pyfor each operation typemain.pyas top-level command grouptests/test_operations_commands.pydocs/cli/operations/pagesmkdocs.ymlnavscm jobscommands)CLI Interface
Acceptance Criteria
src/scm_cli/commands/operations.pyexists with subcommands for all 7 operation types + status--asyncflag returns job ID immediately without polling--timeoutflag controls sync polling timeout (default from SDK)scm operations status --job-id <id>retrieves job statusJobTimeoutErrorhandled gracefully — shows job ID and last state for manual follow-upmkdocs.ymlmake qualitypassesImplementation Notes
job_id; sync mode internally polls untilstate == "completed"JobTimeoutErrorhasjob_idandlast_stateattributes — surface both in error message: "Job {job_id} timed out in state '{last_state}'. Check status with: scm operations status --job-id {job_id}"--deviceoption constant since all 7 operations require itcommands/jobs.pyfor job-related output patterns