I have a number of virtual servers and need to take an educated guess in my script which server to connect to (based on the vm name for example). This way the user who runs the script does not need to provide --server argument.
What variable should I use to set the server name? $VI_SERVER does not seem to be it...
Thanks. I have some default server already configured in .visdkrc, but relying on that is cumbersome, especially since I am trying to use different servers based on a specific user input.
After reading through some subs in VILib.pm, look like Opts::set_option('server' => $server) is all I need:
# validate options, and connect to the server
Opts::add_options(%opts);
Opts::parse();
Opts::validate();
Opts::set_option('server' => 'XXXX');
Util::connect();
It is VI_SERVER, however that needs to be defined inside a file and then you can pass that using --config param. To get a list of variables, you can just run --help and each param will have it's equivalent variable listed in the output
Thanks. I have some default server already configured in .visdkrc, but relying on that is cumbersome, especially since I am trying to use different servers based on a specific user input.
After reading through some subs in VILib.pm, look like Opts::set_option('server' => $server) is all I need:
# validate options, and connect to the server
Opts::add_options(%opts);
Opts::parse();
Opts::validate();
Opts::set_option('server' => 'XXXX');
Util::connect();