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

API & Integration

Reply
Highlighted

Register MAC address with additional fields

Techie
Posts: 1
140     0

Hello, I have this existing PERL code which registers a MAC address along with various other information, such as a filter (which says if network adapter is wireless or wired), username, expiriation time, etc. I want to recreate this MAC address registration using the new Infoblox Rest API. What would be the equivalent to this PERL code using the REST API? Thanks.

 

Below is the existing PERL code:

 

use Infoblox;

my $argc = @ARGV;

my $session;
$session = Infoblox:Smiley Frustratedession->new(
"master" => "",
"username" => "",
"password" => "");
my @obj = $session->get(
object => "Infoblox:Smiley Very HappyHCP::MAC",
mac => $ARGV[0]);

unless (@obj){
my $mac = Infoblox:Smiley Very HappyHCP::MAC->new (
"mac" => $ARGV[0],
"filter" => $ARGV[1],
"comment" => $ARGV[4],
"expiration_time" => "0",
"username" => $ARGV[3],
"authentication_time" => $ARGV[2],
"reserved_for_infoblox" => "For Infoblox Use only"
);
my $response = $session->add($mac);
unless($response) {
die ("Create registration failed (" . $session->status_code() . ":" . $session->status_detail() . ")\n");
}
print "Registration was successful.\n";
}

Showing results for 
Search instead for 
Do you mean 

Recommended for You