I like the endpoint option but I think it would imply that the username and
password parameters of br login should be optional in the case that they
have already been stored.
Possibly an alternative would be an init command a bit like the gcloud init
command but non-interactive. br --config /path/to/.brooklyn_cli init
https://localhost:8443 admin pa55w0rd. To me init better describes what
are doing anyway given there is no option to log out.
On Mon, 11 Jun 2018 at 17:49 Aled Sage <aled.sage@xxxxxxxxx> wrote:
TL;DR: I want to add `--endpoint` to the br command, because `br login`
has global scope.
We at Cloudsoft use `br` in our qa jenkins jobs. However, the `br login`
command has global scope. This means that two jobs run on the same
jenkins slave (both running as user `jenkins`) will interfere if their
`br login ...; br catalog add ...` commands become interleaved.
I propose that we add support for a `--endpoint` argument in br
commands. For example:
br login https://localhost:8443 admin pa55w0rd
br --endpoint https://localhost:8443 catalog add /path/to/mybundle/
Note that `br login` stores the credentials in ~/.brooklyn_cli, along
with a "target" for the endpoint that is currently active.
Alternative approaches include:
1. Custom configuration file, such as:
br --config /path/to/.brooklyn_cli login https://localhost:8443
br --config /path/to/.brooklyn_cli catalog add /path/to/mybundle/
2. Introduce the notion of "profiles", such as:
br login --profile staging https://localhost:8443 admin pa55w0rd
br --profile staging catalog add /path/to/mybundle/
But profiles would be more complex to implement - it implies support for
multiple logins to the same endpoint with different user:credentials.