Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Security

Reply
Highlighted

How to add a network using a template via the API

Techie
Posts: 5
3073     0

Hi there,

I'm trying to provison a new network via the API whilst using a pre-defined template, using the following code snippet to build the object before adding it to the grid:

 
my $network = Infoblox:Smiley Very HappyHCP::Network->new(
template => "STANDARD-HSRP",
network => "$net",        
comment => "$comment",
);
 
$session->add($network);
 
and get the following status error code:
staus code: 1001-Ipv4addr is not specified
 
So am I completly missing the point with the "template=>XXX" reference?
 
Thanks,
 
Andy Sainsbury
Highlighted

Re: How to add a network

Community Manager
Community Manager
Posts: 248
3074     0

Network have 2 different mandatory fields depending on the action, I'm guessing your template has a fixed netmask restriction:

Highlighted

Re: How to add a network

Techie
Posts: 5
3074     0

Thanks for the reply Geoff!

Should have mentioned that we are running nIOS version 4.2, and I can't see the reference

you quoted above with regards to the $ipv4addr in the documentation guide?

 

I'm supplying a subnet and prefix of: 1.1.144.0/22 as test values:

 

 

my $network = Infoblox:Smiley Very HappyHCP::Network->new(
template => "STANDARD-HSRP",
network => "1.1.144.0/22",        
comment => "this_is_a_test",
);
 
And the template is in existance and working well via the GUI.
 
Thanks,
 
Andy
Highlighted

Re: How to add a network

Community Manager
Community Manager
Posts: 248
3074     0

It's probably a documentation bug, but again, it depends on how your template is set up.

 

if the template allows for a variable netmask, you would use 'network'

if the template allows for a fixed netmask, you would use 'ipv4addr'

Highlighted

Re: How to add a network

Employee
Employee
Posts: 171
3074     0

I think Geoff is correct. I'm looking through the API reference docs for various releases, and it's documented in the 4.3 release doc and later. I don't have the 4.2 docs available right now (I have 4.1 and 4.3), but there was a big update/improvement to the CLI doc with 4.3 over 4.1. I'd suggest going to the support site and downloading the 4.3 CLI guide; while there may be a few things in there you can't use, I think it'll be a help for you trying to learn all of this. 

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You