Bug 1211119 - ability to create lab controllers from CLI
Summary: ability to create lab controllers from CLI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 19
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: 23.0
Assignee: matt jia
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On: 1251355
Blocks: 1337812
TreeView+ depends on / blocked
 
Reported: 2015-04-13 05:00 UTC by matt jia
Modified: 2018-02-06 00:41 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
: 1337812 (view as bug list)
Environment:
Last Closed: 2016-07-07 23:10:43 UTC
Embargoed:


Attachments (Terms of Use)

Description matt jia 2015-04-13 05:00:05 UTC
It would be good to offer people the ability of adding a new lab controller via command line.

Comment 1 Dan Callaghan 2015-04-13 07:17:55 UTC
bkr labcontroller-create --fqdn <fqdn> --username <username> --password <password> --email <address>

--password should be optional in case the site is using Kerberos, other options should be mandatory.

We can add a new Flask handler POST /labcontrollers/ in anticipation of porting that stuff over to Flask/Backbone (it's still TG for now).

Comment 2 Amit Saha 2015-07-06 05:36:13 UTC
(In reply to Dan Callaghan from comment #1)
> bkr labcontroller-create --fqdn <fqdn> --username <username> --password
> <password> --email <address>
> 
> --password should be optional in case the site is using Kerberos, other
> options should be mandatory.
> 
> We can add a new Flask handler POST /labcontrollers/ in anticipation of
> porting that stuff over to Flask/Backbone (it's still TG for now).

Won't labcontroller-add be a better command?

Comment 3 Amit Saha 2015-07-06 07:05:50 UTC
Adds a new subcommand bkr labcontroller-create: http://gerrit.beaker-project.org/#/c/4279/

I have implemented a new API endpoint labcontrollers/new for this so that we can leave the current labcontrollers/ untouched.

Comment 4 Dan Callaghan 2015-07-08 04:21:26 UTC
(In reply to Amit Saha from comment #2)
> Won't labcontroller-add be a better command?

We should stick with labcontroller-create I think. I'd like us to use "create" for creating new records and "add" for adding existing records into collections/relationships (create a pool, vs. add a system to a pool). Even though we're not really consistent with this in old interfaces.

Comment 5 Roman Joost 2015-10-27 04:23:12 UTC
Moving this back to new. Good to have but not really high priority.

Comment 6 Dan Callaghan 2016-04-14 11:21:34 UTC
For playbook idempotency we really want a command which will either create a lab controller with the given FQDN, or update the existing one if it already exists (HTTP PUT semantic, not PATCH).

So maybe bkr labcontroller-modify, with an option --create meaning create it if it doesn't exist? Or maybe the opposite, bkr labcontroller-create --update-existing?

Comment 7 Dan Callaghan 2016-04-14 11:22:12 UTC
Forgot to mention, I want to use this in the Fedora infra playbooks to programmtically define the lab controller. And we have the server side APIs for this now. So I am planning to whip something up.

Comment 8 matt jia 2016-05-19 06:24:03 UTC
(In reply to Dan Callaghan from comment #6)
> For playbook idempotency we really want a command which will either create a
> lab controller with the given FQDN, or update the existing one if it already
> exists (HTTP PUT semantic, not PATCH).
> 
> So maybe bkr labcontroller-modify, with an option --create meaning create it
> if it doesn't exist? Or maybe the opposite, bkr labcontroller-create
> --update-existing?

I would prefer to use bkr labcontroller-modify to update the existing ones. This will match what we have for others, like bkr system-modify, group-modify..

Comment 9 matt jia 2016-05-19 07:00:13 UTC
(In reply to Amit Saha from comment #3)
> Adds a new subcommand bkr labcontroller-create:
> http://gerrit.beaker-project.org/#/c/4279/
> 
> I have implemented a new API endpoint labcontrollers/new for this so that we
> can leave the current labcontrollers/ untouched.

Update this patch with this:

   https://gerrit.beaker-project.org/#/c/4904/

Comment 10 Dan Callaghan 2016-06-13 01:02:33 UTC
This bug fix is included in beaker-client-23.0-0.git.244.0980974 which is currently available for download here:

https://beaker-project.org/nightlies/develop/

Comment 12 Dan Callaghan 2016-07-07 23:10:43 UTC
Beaker 23.0 has been released.


Note You need to log in before you can comment on or make changes to this bug.