- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Register MAC address with additional fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2020 12:50 PM
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:ession->new(
"master" => "",
"username" => "",
"password" => "");
my @obj = $session->get(
object => "Infoblox:HCP::MAC",
mac => $ARGV[0]);
unless (@obj){
my $mac = Infoblox:HCP::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";
}