Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add command to get aggregate report #338

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Conversation

infinitewarp
Copy link
Member

@infinitewarp infinitewarp commented May 28, 2024

Relates to JIRA: DISCOVERY-611

This PR adds a new aggregate subcommand under report.

❯ poetry run qpc report aggregate --help
usage: qpc report aggregate [-h] (--scan-job SCAN_JOB_ID | --report REPORT_ID)

options:
  -h, --help            show this help message and exit
  --scan-job SCAN_JOB_ID
                        Scan job identifier.
  --report REPORT_ID    Report identifier.

Given an apropriate scan job ID or report ID, it simply retrieves and outputs the requested aggregate report.

❯ poetry run qpc report aggregate --report 15 | head
{
    "ansible_hosts_all": 200,
    "ansible_hosts_in_database": 100,
    "ansible_hosts_in_jobs": 200,
    "inspect_result_status_failed": 0,
    "inspect_result_status_success": 0,
    "inspect_result_status_unknown": 601,
    "inspect_result_status_unreachable": 0,
    "instances_hypervisor": 0,
    "instances_physical": 0,

This command has no custom output formatting options. This command simply prints to stdout the JSON response returned by the server using qpc's existing pretty_format function.

❯ poetry run qpc report aggregate --scan-job 1701
Scan Job 1701 does not exist.

As discussed with Justin, we are not yet updating the man page to document this new feature. We may revisit that decision and update docs later.

@infinitewarp infinitewarp marked this pull request as ready for review May 29, 2024 17:04
@infinitewarp infinitewarp force-pushed the 611-aggregate-report branch 3 times, most recently from 890e6c7 to adbfb51 Compare May 30, 2024 15:57
@infinitewarp infinitewarp requested review from bruno-fs and a team May 30, 2024 16:44
Relates to JIRA: DISCOVERY-611
@infinitewarp infinitewarp merged commit e801026 into main Jun 4, 2024
15 checks passed
@infinitewarp infinitewarp deleted the 611-aggregate-report branch June 4, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants