07-20-2017 01:39 PM
I am trying to get the perl api working with infoblox and am having a heck of a time with the nested structure. I have the following snippet of code working, I can add the host.
my $host = Infoblox:NS::Host->new(
name => "wls-cctest215-249.cc.buffalo.edu",
comment => "added AP via perl script",
disable => "false",
ipv4addrs => ["10.3.215.249"],
my $response = $session->add( $host );
But I am trying to add a 'mac' and 'configure for dhcp' to $host.. I believe they have to be put in the ipv4addrs section but for the life of me can not get the syntax right to get it to work?
If have the same issue when I get a host, I can not figure out how to display the ipv4addr and configure for dhcp options.
Solved! Go to Solution.
07-21-2017 12:45 AM
In this case, your IP must be of type Infoblox:HCP::FixedAddr.
Then it works.
my $host_addr = Infoblox::DHCP::FixedAddr->new( mac => "cafedeadbe98", match_client => "MAC", configure_for_dhcp => "true", ipv4addr => "192.168.32.98", ); my $host = Infoblox::DNS::Host->new( name => "test98.test.net", #aliases => ["one", "two"], comment => "my comment", disable => "false", #ipv4addrs => ["192.168.32.98"], ipv4addrs => [$host_addr], ttl => 3600, );