Infoblox::DHCP::Member - DHCP Member object.


NAME

Infoblox::DHCP::Member - DHCP Member object.


DESCRIPTION

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.


CONSTRUCTOR

 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
 );


MODULE METHODS

This section describes all the functions that you can apply to an DHCP Member object.

Infoblox::DHCP::Network->members( )

Use this function to specify the primary member for a network. See Infoblox::DHCP::Network->members() for parameters and return values.

Example
 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],
 );

Infoblox::DHCP::Range->member( )

Use this function to specify the primary member for a DHCP range. See Infoblox::DHCP::Range->members() for parameters and return values.

Example
 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,
 );


METHODS

This section describes all the methods that you can use to set and retrieve the attribute values of a DHCP Member object.

ipv4addr( )

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.

Parameter

IPv4 address (32 bits) of the member.

Returns

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.

Example
 #Get ipv4addr
 my $ipv4addr = $member->ipv4addr();
 #Modify ipv4addr
 $member->ipv4addr("192.168.1.3");

ipv6addr( )

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.

Parameter

IPv6 address of the member.

Returns

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.

Example
 #Get ipv6addr
 my $ipv6addr = $member->ipv6addr();
 #Modify ipv6addr
 $member->ipv6addr("fd46:e105:2eac:89b1::1");

name( )

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.

Parameter

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.

Returns

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.

Example
 #Get name
 my $name = $member->name();
 #Modify name
 $member->name("dhcp.infoblox.com");


SAMPLE CODE

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####


AUTHOR

Infoblox Inc. http://www.infoblox.com/


SEE ALSO

Infoblox::DHCP::Network, Infoblox::Session->add(),Infoblox::Session


COPYRIGHT

Copyright (c) 2017 Infoblox Inc.