Bug 1037592

Summary: [RFE] current machine user/job/loan owner available via CLI
Product: [Retired] Beaker Reporter: Ales Zelinka <azelinka>
Component: command lineAssignee: Raymond Mancy <rmancy>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 0.14CC: aigao, asaha, dcallagh, ebaak, esammons, jburke, llim, qwan, rmancy, xjia
Target Milestone: 0.15.3Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-03 04:52:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ales Zelinka 2013-12-03 12:38:08 UTC
Please provide machine's user (including current job ID for regular jobs) so I don't have to parse html page.

Comment 2 Nick Coghlan 2013-12-06 07:45:19 UTC
Targeting 0.15.3, since the UI upgrade is likely to break any existing scripts that are scraping the HTML for this info.

Comment 3 Nick Coghlan 2013-12-09 00:13:12 UTC
We'll look into two options for this:

1. Adding more info to the output of "bkr system-details"
2. Adding a new "bkr system-status" command

Option 1 seems more likely at this point, but option 2 is a possibility if there turns out to be some technical reason that option 1 isn't a good idea after all.

Comment 4 Dan Callaghan 2013-12-10 06:10:22 UTC
The bkr system-details command is for hardware details and other physical properties that don't normally change over time. A separate command for querying system reservations would be a better choice.

Comment 5 Nick Coghlan 2013-12-10 06:29:15 UTC
In that case, here's the info I think we should include for a new "bkr system-status" command:

- current condition (automated, manual, broken, removed)
- power type (if any)
- current reservation (if any)
- current loan (if any)

Including the power type is mostly to pick up cases where a system is "Automated", but doesn't have automatic power control configured.

In the future, we may also want to support something like:

    bkr system-reservations --current
    bkr system-loans --current

But that CLI making sense depends on tracking historical data for reservations and loans directly (so they can be listed over time), whereas the system-status command would just be about providing a snapshot of the current state of the system.

Comment 6 Raymond Mancy 2013-12-10 07:21:10 UTC
I think bkr system-status is a bad name because status is already used when designating a system as 'Automated', 'Broken' etc.
(In reply to Nick Coghlan from comment #5)
> In that case, here's the info I think we should include for a new "bkr
> system-status" command:
> 
> - current condition (automated, manual, broken, removed)
> - power type (if any)
> - current reservation (if any)
> - current loan (if any)
> 
> Including the power type is mostly to pick up cases where a system is
> "Automated", but doesn't have automatic power control configured.
> 

This seems out of place and a gateway option for further scope creep. Should bkr list-systems not be used for filtering on such things ?

> In the future, we may also want to support something like:
> 
>     bkr system-reservations --current
>     bkr system-loans --current
> 
> But that CLI making sense depends on tracking historical data for
> reservations and loans directly (so they can be listed over time), whereas
> the system-status command would just be about providing a snapshot of the
> current state of the system.

Comment 7 Nick Coghlan 2013-12-10 07:31:38 UTC
As noted on bug 1039842, the system details paged currently uses "Condition", rather than Status for the automated/manual/broken/removed setting.

I think it's better to use "Status" in the more general sense, and start working towards using "Condition" more consistently for the narrow sense.

Agreed on leaving out the power type information, though.

Comment 8 Dan Callaghan 2013-12-12 22:11:09 UTC
*** Bug 783565 has been marked as a duplicate of this bug. ***

Comment 9 Amit Saha 2013-12-17 06:58:06 UTC
When this fix is ready, will it also fix BZ#858723 ?

Comment 10 Nick Coghlan 2013-12-17 07:45:33 UTC
Ray's patch on Gerrit: http://gerrit.beaker-project.org/#/c/2614/

Comment 11 Nick Coghlan 2013-12-17 07:45:59 UTC
*** Bug 858723 has been marked as a duplicate of this bug. ***

Comment 15 Nick Coghlan 2014-02-03 04:52:09 UTC
This change is included in the Beaker 0.15.3 maintenance release:

http://beaker-project.org/docs/whats-new/release-0.15.html#beaker-0-15-3