Infoblox::DHCP::Member - DHCP Member object.
A grid member is part of a grid which is a group of two or more Infoblox appliances that share sections of a common, distributed, built-in database. A grid member inherits its settings from the grid. A member is a single Infoblox appliance or an HA pair that provides DHCP services seamlessly across an entire network.
my $member = Infoblox::DHCP::Member->new( ipv4addr => $ipv4addr, #Optional. At least one ipv4addr or ipv6addr is required. ipv6addr => $ipv6addr, #Optional. At least one ipv4addr or ipv6addr is required. name => $fqdn, #Optional );
This section describes all the functions that you can apply to an DHCP Member object.
Use this function to specify the primary member for a network. See Infoblox::DHCP::Network->members() for parameters and return values.
my $member1 = Infoblox::DHCP::Member->new( name => "localhost.localdomain", ipv4addr => "192.168.1.2", );
unless($member1) { die("Construct member failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Member object created successfully\n";
#Create the Network object with this member my $network = Infoblox::DHCP::Network->new( network => "10.0.0.0/255.0.0.0", members => [$member1], );
Use this function to specify the primary member for a DHCP range. See Infoblox::DHCP::Range->members() for parameters and return values.
my $member = Infoblox::DHCP::Member->new( name => "localhost.localdomain", ipv4addr => "192.168.1.2", );
unless($member) { die("Construct member failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Member object created successfully\n";
#Create the DHCP Range object with this member my $dhcp_range = Infoblox::DHCP::Range->new( network => "10.0.0.0/8", start_addr => "10.0.0.1", end_addr => "10.0.0.10", member => $member, );
This section describes all the methods that you can use to set and retrieve the attribute values of a DHCP Member object.
Use this method to set or retrieve the IPv4 address of the member.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
IPv4 address (32 bits) of the member.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get ipv4addr my $ipv4addr = $member->ipv4addr(); #Modify ipv4addr $member->ipv4addr("192.168.1.3");
Use this method to set or retrieve the IPv6 address of the member.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
IPv6 address of the member.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get ipv6addr my $ipv6addr = $member->ipv6addr(); #Modify ipv6addr $member->ipv6addr("fd46:e105:2eac:89b1::1");
Use this method to set or retrieve the name of the member.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
A name in FQDN (Fully Qualified Domain Name) format. The FQDN consists of the host name followed by the domain name (example: abc.com). A host name can have a maximum of 256 characters.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get name my $name = $member->name(); #Modify name $member->name("dhcp.infoblox.com");
The following sample code demonstrates the different functions that can be applied to an object, such as add, search, modify, and remove. This sample also includes error handling for the operations.
#Preparation prior to a DHCP Member object insertion
#PROGRAM STARTS: Include all the modules that will be used use strict; use Infoblox;
#Create a session to the Infoblox appliance
my $session = Infoblox::Session->new( master => "192.168.1.2", #appliance host ip username => "admin", #appliance user login password => "infoblox" #appliance password );
unless ($session) { die("Construct session failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Session created successfully\n";
#Create a DHCP Member object
my $member1 = Infoblox::DHCP::Member->new( name => "infoblox.localdomain", ipv4addr => "192.168.1.2", );
unless($member1) { die("Construct member failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Member object created successfully\n";
#Create the Network object with this member my $network = Infoblox::DHCP::Network->new( network => "10.0.0.0/255.0.0.0", comment => "add network", members => [ $member1 ] );
unless($network) { die("Construct Network object failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Network object created successfully\n";
#Add the Network object into the Infoblox appliance through a session $session->add($network) or die("Add Network object failed: ", $session->status_code() . ":" . $session->status_detail()); print "DHCP member object added to the network successfully\n";
####PROGRAM ENDS####
Infoblox Inc. http://www.infoblox.com/
Infoblox::DHCP::Network, Infoblox::Session->add(),Infoblox::Session
Copyright (c) 2017 Infoblox Inc.