hichtakk/nsxctl

If nsx-t site is not set, alb subcommands will not work.

mu853 opened this issue · 1 comments

mu853 commented

alb subcommands should also work outside of the nsx-t environment

$ nsxctl show alb-cloud
2022/07/09 20:27:02 site '' not found
$
$ nsxctl config set-site dummy --endpoint xxx -u xxx -p xxx
$ nsxctl show alb-cloud
Default-Cloud cloud-63d5653f-7a9e-4369-9430-6a3cf32aff88 CLOUD_VCENTER
$

mu853 commented

@hichtakk
Currently, logging into NSX-T or ALB is handled by NewCmdShow.
In that case, if the subcommand prefix is "alb-", you need to login ALB, but NewCmdShow cannot determine this.

So we have two options,
1: discard #28 feature (auto-completion of arguments) and login to NSX-T/ALB at each sub command.
2: make new sub command (nsxctl alb) and move the existing alb-xxxx sub commands to its sub commands.

example of use of option 2:

$ alias alb='nsxctl alb'
$ alb show vs

Do you have any other ideas?