Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API & Integration, DevOps,NetOps,SecOps

Reply

Register MAC address with additional fields

Member
Posts: 1
974     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 
Did you mean: 

Recommended for You