Mellanox XML gateway adapter/wrapper module.
This module wraps the Mellanox XML-gateway API, an "interesting" sort of interface offered up by Mellanox switches running MLNX-OS. This module handles all of the connection setup and XML encoding / decoding. Users of the module pass in arrays of commands to run, and arrays of results are returned. All commands in lists passed to a single call() invocation will be passed along together to be invoked, in order, on the switch. Mixtures of 'get', 'set-*', and 'action' commands are allowed. This check-in also includes a test harness for this module. Sample use: my $gw = MLNX_XMLGateway->new("user:pass@switch.somehost.org"); my @cmds = ( ["get", "/some/REST/path"], ["set-create", "/some/REST/path/to/create"], ["set-modify", "/some/REST/path/to/modify=newvalue"], ["action", "/some/REST/action/path", {var => value, ...}] ); $results = eval { $gw->call(\@cmds) }; if ($@) { die "error: $@"; } foreach my $res (@$results) { # path, type, value print "@$res\n"; }
Please register or sign in to comment