It would be good to offer people the ability of adding a new lab controller via command line.
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).
(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?
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.
(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.
Moving this back to new. Good to have but not really high priority.
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?
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.
(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..
(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/
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/
Beaker 23.0 has been released.