Infoblox::Grid::DNS::DNS64Group - DNS64 Synthesis Group object


NAME

Infoblox::Grid::DNS::DNS64Group - DNS64 Synthesis Group object


DESCRIPTION

A DNS64 synthesis group is used to configure the DNS64 feature.


CONSTRUCTOR

 my $group = Infoblox::Grid::DNS::DNS64Group->new(
     name                  => $string,                                                                    #Required
     prefix                => $ipv6prefix,                                                                #Required
     clients               => [ $ipv4addr | $ipv4_subnet/prefix | $ipv6addr | $ipv6_subnet/prefix ,... ] | $nacl, #Optional / Default is an empty list
     comment               => $string,                                                                    #Optional
     disable               => "true" | "false"                                                            #Optional / Default is "false"
     dnssec_dns64_enabled  => "true" | "false"                                                            #Optional / Default is "false"    
     exclude               => [ $ipv4addr | $ipv4_subnet/prefix | $ipv6addr | $ipv6_subnet/prefix ,... ] | $nacl, #Optional / Default is an empty list
     extattrs              => { $string => $extattr, ... },                                               #Optional / Default is undefined
     extensible_attributes => { $string => $string|$num, $string => [ $string|$num, ...], ... },          #Optional / Default is undefined
     mapped                => [ $ipv4addr | $ipv4_subnet/prefix | $ipv6addr | $ipv6_subnet/prefix ,... ] | $nacl, #Optional / Default is an empty list
 );

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


SESSION METHODS

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

Infoblox::Session->add( )

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

If you have applied an access control list to an object, you must restart services after you update the access control list for the changes to take effect. See Infoblox::Session->restart() method.

Example
 #Construct an object
 my $group = Infoblox::Grid::DNS::DNS64Group->new(
     name        => "dns64group_A",
     prefix      => "64:FF9B::/96",
     );
 #Submit for addition
 my $response = $session->add( $group );

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 References
 Apply the following attributes to get a specific DNS64 synthesis group object:
  name                  - Optional. Group name in string format.
  prefix                - Optional. An IPv6 prefix.
  extattrs              - Optional. A hash reference containing extensible attributes.
  extensible_attributes - Optional. A hash reference containing extensible attributes.
  comment               - Optional. User-specified comment for the group.
Examples
 my @retrieved_objs = $session->get(
     object => "Infoblox::Grid::DNS::DNS64Group",
     name   => "dns64group_A",
     );
 my @retrieved_objs = $session->get(
     object => "Infoblox::Grid::DNS::DNS64Group",
     extensible_attributes => { 'Site' => 'Santa Clara' });

Infoblox::Session->modify( )

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

If you have applied an access control list to an object, you must restart services after you update the access control list for the changes to take effect. See Infoblox::Session->restart() method.

Example
 #Use this method to modify the comment.
 $group->comment("this is a modified comment");
 #Submit modification
 my $response = $session->modify( $group );

Infoblox::Session->remove( )

Use this method to remove an 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 object, and then submit this object for removal.

Example
 #Get the objects with the same name
 my @retrieved_objs = $session->get(
     object => "Infoblox::Grid::DNS::DNS64Group",
     name   => "dns64group_A",
      );
 #Find the desired object on the retrieved list
 my $desired_nsgroup= $retrieved_objs[0];
 #Submit for removal
 my $response = $session->remove( $desired_nsgroup );

Infoblox::Session->search( )

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

Key References
 Apply the following attributes to search for a DNS64 synthesis group object:
  name                  - Optional. Group name in string format. (regular expression)
  prefix                - Optional. An IPv6 prefix. (regular expression)
  extattrs              - Optional. A hash reference containing extensible attributes.
  extensible_attributes - Optional. A hash reference containing extensible attributes.
  comment               - Optional. User-specified comment for the group. (regular expression)

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

Examples
 # Search for all DNS64 synthesis group objects
 my @retrieved_objs = $session->search(
     object => "Infoblox::Grid::DNS::DNS64Group",
     name   => ".*",
     );
 # Search for all DNS64 synthesis group objects with "Santa Clara" as the value for the "Site" extensible attribute
 my @retrieved_objs = $session->get(
     object => "Infoblox::Grid::DNS::DNS64Group",
     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 DNS64 synthesis group object.

comment( )

Use this method to set or retrieve the comment field of the DNS64 synthesis group object.

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

Parameter

Comment of the group in 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
 #Getting comment
 my $comment = $group->comment();
 #Modifying comment
 $group->comment("Some comment");

clients( )

Use this method to set or retrieve the clients ACL list of a DNS64 synthesis group object. This is the list of clients for which synthesized records are returned. The default is "any".

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

Parameter

The valid value is an Infoblox::Grid::NamedACL object or an array reference that contains IPv4/IPv6 addresses and networks. To exclude addresses and networks, add "!" as a prefix to the IP addresses and networks. The default value is an empty list.

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
  #Getting clients
  my $clients = $group->clients();
  #Modifying clients
  $group->clients(["2001::333/64", "!2001::1234", "20.0.0.0/8"]);
  #Use Infoblox::Grid::NamedACL
  $group->clients($nacl);

disable( )

Use this method to set or retrieve the disable flag of a DNS64 synthesis group object.

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

Parameter

Specify "true" to set the disable flag or "false" to deactivate/unset it. The default value is "false".

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 disable
 my $disable = $fixed_addr->disable();
 #Modify disable
 $fixed_addr->disable("true");

dnssec_dns64_enabled( )

Use this method to set or retrieve the dnssec_dns64_enabled flag of a DNS64 synthesis group object.

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

Parameter

Specify "true" to set the dnssec_dns64_enabled flag or "false" to deactivate/unset it. The default value is "false".

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 dnssec_dns64_enabled
 my $dnssec_dns64_enabled = $group->dnssec_dns64_enabled();
 #Modify dnssec_dns64_enabled
 $group->dnssec_dns64_enabled('true');

exclude( )

Use this method to set or retrieve the exclude ACL list of a DNS64 synthesis group object. AAAA records which match this ACL are treated as non-existent for the purposes of synthesis. By default, the ACL is empty and no records match.

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

Parameter

The valid value is an Infoblox::Grid::NamedACL object or an array reference that contains IPv4/IPv6 addresses and networks. To exclude addresses and networks, add "!" as a prefix to the IP addresses and networks. The default value is an empty list.

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
  #Getting exclude
  my $exclude = $group->exclude();
  #Modifying exclude
  $group->exclude(["2001::333/64", "!2001::1234"]);
  #Use Infoblox::Grid::NamedACL
  $group->exclude($nacl);

extattrs( )

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

Parameter

Valid value is a hash reference containing 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
 my $ref_extattrs = $group->extattrs();
 #Modify extattrs
 $group->extattrs({ 'Site' => $extattr1, 'Administrator' => $extattr2 });

extensible_attributes( )

Use this method to set or retrieve the extensible attributes associated with a DNS64 synthesis 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
 my $ref_extensible_attributes = $group->extensible_attributes();
 #Modify extensible attributes
 $group->extensible_attributes({ 'Site' => 'Santa Clara', 'Administrator' => [ 'Peter', 'Tom' ] });

name( )

Use this method to set or retrieve the DNS64 synthesis group name.

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

Parameter

Name of the group in 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
 #Getting name
 my $name = $group->name();
 #Modifying name
 $group->name("ns_group_2");

mapped( )

Use this method to set or retrieve the mapped ACL list of a DNS64 synthesis group object. The appliance generates AAAA records only for A records that match this ACL. If the ACL is empty, as it is by default, then all records will match.

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

Parameter

The valid value is an Infoblox::Grid::NamedACL object or an array reference that contains IPv4/IPv6 addresses and networks. To deny addresses and networks, add "!" as a prefix to the IP addresses and networks. The default value is an empty list.

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
  #Getting mapped
  my $mapped = $group->mapped();
  #Modifying mapped
  $group->mapped(["40.10.0.0/24", "!40.10.3.4]);
  #Use Infoblox::Grid::NamedACL
  $group->mapped($nacl);
  

prefix( )

Use this method to set or retrieve the DNS64 synthesis group prefix. The prefix is an IPv6 subnet prefix with a length of /32, /40, /48, /56, /64, or /96.

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

Parameter

Prefix of the group in 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
 #Getting prefix
 my $prefix = $group->prefix();
 #Modifying prefix
 $group->prefix("64:FF9B::/96");


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 the addition of a DNS64 synthesis group object

 #PROGRAM STARTS: Include all the modules that will be used
 use strict;
 use Infoblox;
 #Create a session to the Infoblox device
 my $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 a DNS64 synthesis group object and add it to the appliance

 my $group = Infoblox::Grid::DNS::DNS64Group->new(
                                                  name => 'testgroup',
                                                  prefix => '64:FF9B::/96',
                                                  clients => ["2001::333/64", "!2001::1234", "20.0.0.0/8"],
                                                  comment => 'some comment',
                                                 );
 unless ($group) {
     die("Construct DNS64 synthesis group failed: ",
         Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "DNS64 synthesis group object created successfully\n";
 my $response = $session->add( $group );
 unless ($response) {
     die("Adding DNS64 synthesis group failed: ",
         Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Add DNS64 synthesis group success.\n" if ( $response );

#Add the DNS64 synthesis group object to the grid and enable it

 my @result_array = $session->get( "object" => "Infoblox::Grid::DNS" ,  "grid" => "Infoblox" );
 if ( defined @result_array  and scalar( @result_array ) > 0 ) {
     my $object = $result_array[0];
     if ( ref( $object ) eq "Infoblox::Grid::DNS" ) {
         $object->dns64_groups( [ $group ] );
         $object->enable_dns64("true");
         $response = $session->modify( $object );
         print "Add DNS64 synthesis group to grid dns properties success.\n" if ( $response );
              }
     unless ($object) {
         die("Add DNS64 synthesis group to grid dns properties failed: ",
             $session->status_code() . ":" . $session->status_detail());
     }
      }

#Modify the DNS64 synthesis group object

 @result_array = $session->get( "object" => "Infoblox::Grid::DNS::DNS64Group" ,  name => "testgroup" );
 if ( defined @result_array  and scalar( @result_array ) > 0 ) {
     my $object = $result_array[0];
     if ( ref( $object ) eq "Infoblox::Grid::DNS::DNS64Group" ) {
         $object->clients(["2001::333/64", "!2001::1234"]);
         $response = $session->modify( $object );
         print "Modify DNS64 synthesis group success.\n" if ( $response );
              }
     unless ($object) {
         die("Modify Group failed: ",
             $session->status_code() . ":" . $session->status_detail());
     }
      }

#Remove a DNS64 synthesis group object

#First let's remove it from the grid configuration

 @result_array = $session->get( "object" => "Infoblox::Grid::DNS" ,  "grid" => "Infoblox" );
 if ( defined @result_array  and scalar( @result_array ) > 0 ) {
     my $object = $result_array[0];
     if ( ref( $object ) eq "Infoblox::Grid::DNS" ) {
         $object->dns64_groups( [ ] );
         $object->enable_dns64( "false" );
         $response = $session->modify( $object );
         print "Remove DNS64 synthesis group from the grid success.\n" if ( $response );
              }
     unless ($object) {
         die("Remove DNS64 synthesis group failed: ",
             $session->status_code() . ":" . $session->status_detail());
     }
      }

#And now remove the group

 @result_array = $session->get( "object" => "Infoblox::Grid::DNS::DNS64Group" ,  name => "testgroup" );
 if ( defined @result_array  and scalar( @result_array ) > 0 ) {
     my $object = $result_array[0];
     if ( ref( $object ) eq "Infoblox::Grid::DNS::DNS64Group" ) {
         $response = $session->remove( $object );
         print "Remove DNS64 synthesis group success.\n" if ( $response );
              }
     unless ($object) {
         die("Remove DNS64 synthesis group failed: ",
             $session->status_code() . ":" . $session->status_detail());
     }
      }
 ####PROGRAM ENDS####


AUTHOR

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


SEE ALSO

Infoblox::Session,Infoblox::Session->get(),Infoblox::Session->modify(),Infoblox::Session->search(),Infoblox::Session->remove()Infoblox::Grid::DNS, Infoblox::Grid::Member::DNS, Infoblox::DNS::View, Infoblox::Grid::NamedACL


COPYRIGHT

Copyright (c) 2017 Infoblox Inc.