Spoon71 has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data Structure confusion...
by talexb (Chancellor) on Apr 26, 2016 at 15:47 UTC | |
|
Re: Data Structure confusion...
by AnomalousMonk (Archbishop) on Apr 26, 2016 at 13:52 UTC | |
|
Re: Data Structure confusion...
by stevieb (Canon) on Apr 26, 2016 at 13:49 UTC | |
|
Re: Data Structure confusion...
by NetWallah (Canon) on Apr 26, 2016 at 16:55 UTC | |
by Spoon71 (Initiate) on Apr 27, 2016 at 08:17 UTC |