Infoblox::Grid::DNS::Nsgroup::ForwardingMember - A forwarding member group.


NAME

Infoblox::Grid::DNS::Nsgroup::ForwardingMember - A forwarding member group.


DESCRIPTION

The forwarding member group provides forwarding servers configuration for forward zones.


CONSTRUCTOR

 my $object = Infoblox::Grid::DNS::Nsgroup::ForwardingMember->new(
     name                  => $string,                                                              #Required
     forwarding_servers    => [$dnsmember1, $dnsmember2, ...],                                      #Required
     comment               => $string,                                                              #Optional / Default is undefined
     extattrs              => { $string => $extattr, ... },                                         #Optional / Default is undefined
     extensible_attributes => {$string => $string | $num, $string => [ $string | $num, ... ], ... } #Optional / Default is undefined
 );

You cannot set both extattrs and extensible_attributes attributes at the same time.


SESSION METHODS

This section describes all the methods in an Infoblox::Session module that you can apply to a forwarding members group object.

Infoblox::Session->add( )

Use this method to add the object to the Infoblox appliance. See Infoblox::Session->add() for parameters and return values.

Example
 #Construct an object
 my $object = Infoblox::Grid::DNS::Nsgroup::ForwardingMember->new(
     name               => 'fwdgroup',
     forwarding_servers => [$dnsmember1, $dnsmember2],
 );
 #Submit for addition
 my $response = $session->add($object);

Infoblox::Session->get( )

Use this method to retrieve all the matching objects from the Infoblox appliance. See Infoblox::Session->get() for parameters and return values.

Key Reference
 Apply the following attributes to get a specific forwarding member group object:
  comment               - Optional. The forwarding member group comment in a string format.
  name                  - Optional. The forwarding member group name in a string format.
  extattrs              - Optional. A hash reference containing extensible attributes.
  extensible_attributes - Optional. A hash reference containing extensible attributes.

For more information about searching extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Searching Extensible Attributes.

Example
 my @retrieved_objs = $session->get(
     object => 'Infoblox::Grid::DNS::Nsgroup::ForwardingMember',
     name   => 'fwdgroup',
 );
 # search for objects defining 'Santa Clara' for 'Site' extensible attribute
 my @retrieved_objs = $session->search(
     object                => 'Infoblox::Grid::DNS::Nsgroup::ForwardingMember',
     extensible_attributes => {'Site' => 'Santa Clara'},
 );

Infoblox::Session->modify( )

Use this method to modify the object in the Infoblox appliance. See Infoblox::Session->modify() for parameters and return values.

Example
 #Modify comment value
 $object->comment('this is a modified comment');
 #Submit modification
 my $response = $session->modify($object);

Infoblox::Session->remove( )

Use this method to remove the object from the Infoblox appliance. See Infoblox::Session->remove() for parameters and return values.

To remove a specific object, first use get() or search() to retrieve the specific DHCP range object, and then submit this object for removal.

Example
 #Get the objects
 my @retrieved_objs = $session->get(
     object => 'Infoblox::Grid::DNS::Nsgroup::ForwardingMember',
     name   => 'fwdgroup',
 );
 #Find the desired object from the retrieved list
 my $desired_object = $retrieved_objs[0];
 #Submit for removal
 my $response = $session->remove($desired_object);

Infoblox::Session->search( )

Use this method to search for objects in the Infoblox appliance. See Infoblox::Session->search() for parameters and return values.

Key References
 Apply the following attributes to search for the forwarding member group object:
  comment               - Optional. The forwarding member group comment in a string format (regexp).
  name                  - Optional. The forwarding member group name in a string format (regexp).
  extattrs              - Optional. A hash reference containing extensible attributes.
  extensible_attributes - Optional. A hash reference containing extensible attributes.

For more information about searching extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Searching Extensible Attributes.

Examples
 # search for objects
 my @retrieved_objs = $session->search(
     object  => 'Infoblox::Grid::DNS::Nsgroup::ForwardingMember',
     name    => '^fwd.*',
     comment => '.*comment',
 );
 # search for objects defining 'Santa Clara' for 'Site' extensible attribute
 my @retrieved_objs = $session->search(
     object                => 'Infoblox::Grid::DNS::Nsgroup::ForwardingMember',
     extensible_attributes => {'Site' => 'Santa Clara'},
 );


METHODS

This section describes all the methods that you can use to configure and retrieve the attribute values of a forwarding member group.

comment( )

Use this method to set or retrieve the forwarding member group comment.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

The valid value is a desired comment in a string format.

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 comment value
 my $comment = $object->comment();
 #Modify comment value
 $object->comment('fwd comment');

extattrs( )

Use this method to set or retrieve the extensible attributes associated with a forwarding member group object.

Parameter

Valid value is a hash reference that contains the names of extensible attributes and their associated values (Infoblox::Grid::Extattr objects).

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 extattrs value
 my $extattrs = $object->extattrs();
 #Modify extattrs value
 $object->extattrs({'Site' => $extattr1, 'Administrator' => $extattr2});

extensible_attributes( )

Use this method to set or retrieve the extensible attributes associated with a forwarding member group object.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

For valid values for extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Extensible Attribute Values.

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 extensible attributes value
 my $extensible_attributes = $object->extensible_attributes();
 #Modify extensible attributes
 $object->extensible_attributes({'Site' => 'Santa Clara', 'Administrator' => ['Peter', 'Tom']});

forwarding_servers( )

Use this method to set or retrieve the list of forwarding servers.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

The valid value is an array of Infoblox::DNS::Member objects.

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 forwarding_servers value
 my $forwarding_servers = $object->forwarding_servers();
 #Modify forwarding_servers value
 #Create nameserver object
 my $nameserver = Infoblox::DNS::Nameserver->new(
     name     => 'ns1.domain1.extra',
     ipv4addr => '5.5.5.5',
 );
 #Create dns member object
 my $dnsmember = Infoblox::DNS::Member->new(
     ipv4addr   => '1.1.1.1',
     forward_to => [$nameserver],
 );
 #Set forwarding_servers value
 $object->forwarding_servers([$dnsmember]);

name( )

Use this method to set or retrieve the forwarding member group name.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

The valid value is a desired name in a string format.

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 value
 my $name = $object->name();
 #Modify name value
 $object->name('fwdg1');


SAMPLE CODE

The following sample code demonstrates the different functions that can be applied to an object, such as modify and remove. This sample also includes error handling for the operations.

#Preparation prior to an Forwarding Member Nsgroup object insertion

 #PROGRAM STARTS: Include all the modules that will be used
 use strict;
 use Infoblox;
 my ($session, $result);
 #Create a session to the Infoblox device
 $session = Infoblox::Session->new(
     master   => "192.168.1.2",
     username => "admin",
     password => "infoblox"
 );
 unless ($session) {
    die("Construct session failed: ",
        Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Session created successfully\n";

#Create an Forwarding Member Nsgroup object

 #Creating an external nameserver
 my $nameserver = Infoblox::DNS::Nameserver->new(
     name     => "ns1.domain0.external",
     ipv4addr => "5.5.5.5",
 );
 #Creating a forwarding member object.
 my $fwd_member = Infoblox::DNS::Member->new(
     name       => "infoblox.localdomain",
     ipv4addr   => "192.168.1.2",
     forward_to =>  [$nameserver],
 );
 #Creating a forwarding nsgroup object.
 my $fwd_nsg1 = Infoblox::Grid::DNS::Nsgroup::ForwardingMember->new(
     name               => "fwd_group_1",
     forwarding_servers => [$fwd_member],
 );
 unless ($fwd_nsg1) {
    die("Construct Forwarding Member Nsgroup failed: ",
        Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Forwarding Member Nsgroup object constructed successfully\n";

#Add the Nsgroup object

 $result = $session->add($fwd_nsg1);
 
 unless ($result) {
     die("Add Forwarding Member Nsgroup to session failed: ",
         $session->status_code() . ":" . $session->status_detail());
 }
 print "Forwarding Member Nsgroup object created successfully\n";

#Search and Modify the Nsgroup object

 my @result_array = $session->search(
     object => "Infoblox::Grid::DNS::Nsgroup::ForwardingMember",
     name   => "fwd_.*",
 );
 my $object = $result_array[0];
 unless ($object) {
    die("Search for Forwarding Member Nsgroup failed: ",
        $session->status_code() . ":" . $session->status_detail());
 }
 $result = $object->comment("forwarding member");
 unless ($result) {
     die("Modify Forwarding Member Nsgroup failed: ",
         Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 $result = $session->modify($object);
 unless ($result) {
     die("Submit modification to the session failed: ",
         $session->status_code() . ":" . $session->status_detail());
 }
 print "Forwarding Member Nsgroup object modified successfully\n";

#Remove a Nsgroup object

 my @result_array = $session->get(
     object => "Infoblox::Grid::DNS::Nsgroup::ForwardingMember",
     name   => "fwd_group_1",
 );
 my $object = $result_array[0];
 unless ($object) {
    die("Get Forwarding Member Nsgroup failed: ",
        $session->status_code() . ":" . $session->status_detail());
 }
 $result = $session->remove($object);
 unless ($result) {
     die("Remove Nsgroup failed: ",
         $session->status_code() . ":" . $session->status_detail());
 }
 print "Forwarding Member Nsgroup object removed successfully\n";
 ####PROGRAM ENDS####


AUTHOR

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


SEE ALSO

Infoblox::Session, Infoblox::Session->add(), Infoblox::Session->get(), Infoblox::Session->modify(), Infoblox::Session->remove(), Infoblox::Session->search(), Infoblox::DNS::Member, Infoblox::Grid::ExtensibleAttributeDef/Extensible Attribute Values, Infoblox::Grid::Extattr


COPYRIGHT

Copyright (c) 2017 Infoblox Inc.