I'm trying to use a Perl module (Opsview::REST) it wants to use a data structure that looks like below. I'm properly confused as to what this is hash of hashes or whatever...
'hostattributes' => [ { 'value' => 'some value +1', 'name' => 'URL', 'arg2' => undef, 'arg4' => undef, 'arg1' => 'someurl.com +', 'arg3' => undef }, { 'arg3' => undef, 'arg1' => 'someurl..co +m', 'name' => 'URL', 'arg4' => undef, 'arg2' => undef, 'value' => 'some value + 2' } ],
I need to create it programatically as I need to read and parse data to create multiple blocks (which is no problem) then once created I need to pass it into the Opsview::Rest piece as below
my $host = $ops->create_or_update_host( ip => 'nodename.com', name => "Name", hostgroup => { name => 'RDG - Prod Services' }, hosttemplates => [ { 'ref' => '/rest/config/hosttemplate/94 +', 'name' => 'AA-RDG-Pseudo-services' } ], hostattributes => PASS HERE, notification_period => { name => 'RDG-24x7-Minus-Bounce' } );
I'm an occasional Perl programmer so this may be simple to some but I'm bloody confused, any help welcome
In reply to Data Structure confusion... by Spoon71
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |