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

API & Integration


How to set the Domain Name of a network through API

Posts: 2
2633     0

Hi, I can create network view and add network through API.

However, to make our system work, we need to set the Domian Name (in the IPV4 DHCP options) of the network just added.

Is there an API call to do that?

In addition, can we add a Zone in DNS through API?

Thanks in advance.


Re: How to set the Domain Name of a network through API

[ Edited ]
Posts: 1
2634     0

First time response!  Hope this helps..


Was finally able to add a DHCP Router in the IP DHCP Options via WAPI!  Figure it shouldn't be far off from where you are wanting to go.  Please, just use this as a means to an end and not an actual solution!


Here is the Code:

(The Java Boolean got me!  Remember it's true not True!!)

(Needed to google building a java Array filled with hashes for the $json value)


use strict;

use Data:Smiley Very Happyumper;
use JSON;
use LWP;
use LWP:Smiley Frustratedimple;
use POSIX qw(strftime);




my $json = '{
"value": "",
"vendor_class": "DHCP",
"name": "routers",
"use_option": true

my $req = HTTP::Request->new(PUT => $baseURI . 'network/ZG5zLm5ldHdvcmskMTAuMTY5EyLjAvMjYvMTk5'); #This _ref was manually updated in this script, format was important.
$req->authorization_basic($username, $passwd);
$req->header('Content-Type' => 'application/json');

#print Dumper($req);

my $r = $agent->request($req);
print "Provisioned $name and default gateway : " . $r->content;


I hope this helps your endeavour.  

Showing results for 
Search instead for 
Do you mean 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin