On Wed, Dec 05, 2018 at 12:54:41PM +0100, Roland Fehrenbacher wrote:
"A" == Ansgar Esztermann-Kirchner aeszter@mpibpc.mpg.de writes:
A> The long-term goal would be to have a CLI that does everything A> the GUI does.
Pretty ambitious.
Indeed.
A> In the short term, I'd like to create a tool that can add new A> hosts according to the parameters it is given, i.e. something A> like A> addhost -i 10.208.0.1 -n node01 -m 11:22:33:44:55:66 \ A> -t standard_node -e 1U A> This makes it easy to add a large number of nodes with MAC A> addresses obtained via SNMP from a network switch.
Our approach to this would be to integrate reading the MACs by SNMP into the GUI and then 'mass setup' the nodes from there. It's on our long list of features to be implemented, though not at a top spot unless someone funds development.
This looks like a promising approach. I am fond of CLIs (at least as an alternative) because scripting is so powerful. For example, cable lengths often mean that switch ports are increasing with node numbers in one half of a rack, but decreasing in the other half. This can be done easily from a shell script, but is a lot harder from a GUI (unless it's coded in as a special case).
Anyway if you want to write your own CLI, have a look at how qluman-cli generates tokens for users and check in the GUI code, how the communication with qlumand looks when a host is generated from the 'New Hosts' dialog.
I'll be sure to do that.
Beware though, that there is no stable API for this, so changes in the QluMan code can make it necessary to adjust your CLI every now and then.
Understood. Having an open interface at all is such a boon that some API instability is just fine.
Thanks,
A.