Basic Reporting¶
drpcli provides rich listing and filtering capabilities that make it straightforward to produce inventory reports and job status summaries without writing custom API code. The key pattern is drpcli <object> list [filter...] combined with jq for field selection and formatting.
Listing Objects¶
Every DRP object type supports the list sub-command. Without filters, it returns all objects of that type as a JSON array:
# List all machines
drpcli machines list
# List all jobs
drpcli jobs list
# List all workflows
drpcli workflows list
Filtering Lists¶
Pass key=value filter expressions to narrow results server-side. Multiple filters are ANDed together:
# Machines currently running a specific workflow
drpcli machines list Workflow=ubuntu-install
# Machines in a specific stage
drpcli machines list Stage=configure-base
# Jobs for a specific machine
drpcli jobs list Machine=<machine-uuid>
# Jobs in a specific state (incomplete, failed, finished)
drpcli jobs list State=failed
See Filter Syntax for filtering information.
Selecting Fields with --format and jq¶
Use --format yaml to get YAML output, or pipe JSON output to jq for field projection:
# Machine inventory: name, address, workflow
drpcli machines list | jq -r '.[] | [.Name, .Address, .Workflow] | @tsv'
# Count machines per workflow
drpcli machines list | jq 'group_by(.Workflow) | map({workflow: .[0].Workflow, count: length})'
# List machines that are NOT in the "complete" stage
drpcli machines list | jq '[.[] | select(.Stage != "complete")]'
Common Reporting Tasks¶
Machine Inventory Report¶
# Tab-separated: Name, Address, Workflow, Stage, BootEnv
drpcli machines list | jq -r \
'.[] | [.Name, (.Address // "unset"), .Workflow, .Stage, .BootEnv] | @tsv' \
| column -t
Job Status Summary¶
# Count jobs by state across all machines
drpcli jobs list | jq 'group_by(.State) | map({state: .[0].State, count: length})'
# Find all failed jobs with machine uuid
drpcli jobs list State=failed | jq -r \
'.[] | [.UUID[0:8], .Machine, .Task, .State] | @tsv'
Recent Job Log for a Machine¶
# Get the UUID of the most recent job for a machine
JOB=$(drpcli jobs list Machine=<machine-uuid> sort=StartTime reverse=true | jq -r '.[0].UUID')
# Print the job log
drpcli jobs log $JOB
Parameter Report Across Machines¶
# Show a specific parameter value for every machine
drpcli machines list | jq -r \
'.[] | [.Name, (.Params["my-param"] // "not-set")] | @tsv'
Scripting Tips¶
- Set
RS_ENDPOINTandRS_TOKEN(orRS_KEY) as environment variables so you do not need to pass flags on every call. - Use
drpcli --format json(the default) and pipe tojqfor the most flexibility. - For large environments, use server-side filters (
drpcli machines list Stage=X) rather than client-sidejqselects to reduce data transfer. - Combine
drpcliwith standard shell tools likesort,uniq -c, andcolumn -tfor quick summaries without writing full scripts.
See Basic Scripting for environment variable setup and scripting patterns.