Infoblox::DHCP::NetworkTemplate - DHCP Network Template object


NAME

Infoblox::DHCP::NetworkTemplate - DHCP Network Template object


DESCRIPTION

You can use a template to create networks in a quick and consistent way. Networks created from a network template inherit all the properties defined in the network template, except for the comment and netmask if they are defined in the network.


CONSTRUCTOR

 my $network_template = Infoblox::DHCP::NetworkTemplate->new(
        name                            => $string,                                                 #Required
        allow_any_netmask               => "true" | "false",                                        #Optional / Default is "false"
        authority                       => "true" | "false",                                        #Optional / Default is "false"
        auto_create_reversezone         => "true" | "false"                                         #Optional / Default is "false"
        bootfile                        => $filename | undef,                                       #Optional / Default is undefined
        bootserver                      => $ipv4addr | $fqdn | undef,                               #Optional / Default is undefined
        comment                         => $string,                                                 #Optional / Default is empty
        ddns_domainname                 => $string | undef,                                         #Optional / Default is undefined
        ddns_generate_hostname          => "true" | "false" | undef,                                #Optional / Default is undefined
        ddns_update_fixed_addresses     => "true" | "false" | undef,                                #Optional / Default is undefined
        ddns_server_always_updates      => "true" | "false",                                        #Optional / Default is "true"
        ddns_ttl                        => $num,                                                    #Optional / Default is 0
        ddns_use_option81               => "true" | "false" | undef,                                #Optional / Default is undefined
        deny_bootp                      => "true" | "false" | undef,                                #Optional / Default undefined
        email_list                      => [ "admin\@test.com",...],                                #Optional / Default is undefined
        enable_ddns                     => "true" | "false" | undef,                                #Optional / Default is undefined
        enable_dhcp_thresholds          => "true" | "false",                                        #Optional / Default is undefined
        enable_email_warnings           => "true" | "false",                                        #Optional / Default is undefined
        enable_snmp_warnings            => "true" | "false",                                        #Optional / Default is undefined
        extattrs                        => { $string => $extattr, ... },                            #Optional / Default is undefined
        extensible_attributes           => { $string => $string | $num, $string => [ $string | $num, ... ], ... }, #Required if 'rir_organization' attribute is defined
                                                                                                                   #Otherwise is optional
        fixed_address_templates         => [$FixedAddrTemplate1,$FixedAddrTemplate2,...]            #Optional / Default is empty
        high_water_mark                 => $number,                                                 #Optional / Default is "95"
        high_water_mark_reset           => $number,                                                 #Optional / Default is "95"
        ignore_dhcp_option_list_request => "true" | "false" | undef,                                #Optional / Default is undefined
        lease_scavenge_time             => $number,                                                 #Optional / Default is -1
        low_water_mark                  => $number,                                                 #Optional / Default is "0"
        low_water_mark_reset            => $number,                                                 #Optional / Default is "0"
        members                         => [$Member1,$Member2,...],                                 #Optional / Default is empty
        netmask                         => $netmask,                                                #Optional / Default is /8
        nextserver                      => $ipv4addr | $fqdn | undef,                               #Optional / Default is undefined
        options                         => [$Option1,$Option2,...]                                  #Optional / Default is empty
        override_ddns_ttl               => "true" | "false",                                        #Optional / Default value is "false"
        override_ddns_domainname        => "true" | "false",                                        #Optional / Default value is "false"
        override_lease_scavenge_time    => "true" | "false",                                        #Optional / Default value is "false"
        override_update_dns_on_lease_renewal  => "true" | "false",                                  #Optional / Default value is "false"
        pxe_lease_time                  => $num | undef,                                            #Optional / Default is undefined
        range_templates                 => [$RangeTemplate1,$RangeTemplate2,...],                   #Optional / Default is empty
        recycle_leases                  => "true" | "false" | undef,                                #Optional / Default is undefined
        rir_organization                => $rir_org,                                                #Optional / An Infoblox::Grid::RIR::Organization object
        rir_registration_action         => 'NONE' | 'CREATE',                                       #Optional / Default is 'NONE'
        rir_registration_status         => 'NOT_REGISTERED' | 'REGISTERED',                         #Optional / Default is 'NOT_REGISTERED'
        send_rir_request                => 'true' | 'false',                                        #Optional / Default is 'false'
        update_dns_on_lease_renewal     => "true" | "false",                                        #Optional / Default value is "false"
        ipam_trap_settings               => $ipam_trap,                                             #Optional / An Infoblox::Grid::SNMP::IPAMTrap object
        override_ipam_trap_settings      => "true" | "false",                                       #Optional / Default value is "false"
        ipam_threshold_settings          => $ipam_threshold,                                        #Optional / An Infoblox::Grid::SNMP::IPAMThreshold object
        override_ipam_threshold_settings => "true" | "false",                                       #Optional / Default value is "false"
        ipam_email_addresses             => [$email1, $email2, ...],                                #Optional / Default is an empty list
        override_ipam_email_addresses    => "true" | "false",                                       #Optional / Default value is "false"
        logic_filters                    => [ $filter_name | $filter_obj, ...], # Optional / Default is undefined
        override_logic_filters           => "true' | 'false",                   # Optional / Default value is "false"
          );

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 DHCP Network Template object.

Infoblox::Session->add( )

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

Example
     #Construct an object
     my $network_template = Infoblox::DHCP::NetworkTemplate->new(
            name              => "custom_network_template",
            allow_any_netmask => "true",
     );
     # Submit for adding network template
     my $response = $session->add( $network_template );

Infoblox::Session->get( )

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

Key References
     Apply the following attributes to get a specific DHCP Network template object:
      name - Required. The name of network template.
      extattrs     - Optional. A hash reference containing extensible attributes.
Example
      my  @result_array = $session->get(
           object  => "Infoblox::DHCP::NetworkTemplate" ,
           name    => "custom_network_template"
      );

Infoblox::Session->search( )

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

Key References
     Apply the following attributes to search for a specific DHCP Network Template object:
      name    - Optional. The name of the network template (regular
                expression).
      comment - Optional. The comment of the network template (regular
                expression).
      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  @result_array = $session->search(
           object  => "Infoblox::DHCP::NetworkTemplate" ,
           name    => "custom_network_template"
       comment => ".*",
      );
      # search all Network Templates with a given extensible attribute 'Site'
      my @retrieved_objs = $session->search(
        object => "Infoblox::DHCP::NetworkTemplate",
        extensible_attributes => { 'Site' => 'Santa Clara' });

Infoblox::Session->modify( )

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

Example
     #Use method to modify enable_ddns method.
     $object->enable_ddns("true");
     # Submit modification
     my $response = $session->modify( $object );

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 specifc object, first use get() or search() to retrieve the specific object, and then submit this object for removal.

Example
     # Get the object under the same name
     my  @result_array = $session->get(
           object => "Infoblox::DHCP::NetworkTemplate" ,
           name   => "custom_network_template"
                 );
     # find the desired object from retrieved list.
     my $desired_network_template = $result_array[0];
     # Submit for removal
     my $response = $session->remove( $desired_network_template );


METHODS

This section describes all the methods that can be used to configure and retrieve the attribute values of a DHCP Network template object

allow_any_netmask( )

Use this method to set or retrieve the allow_any_netmask parameter of a DHCP network template object. If you set this parameter to "true", then the template allows any netmask. A user must specify a netmask when creating a network using this template. If you set this parameter to false, you must specify the "netmask" property for the network template object.

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

Parameter

Specify "true" to set the allow_any_netmask parameter or specify "false" if you want to specify a particular netmask. 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 allow_any_netmask
     my $allow_any_netmask = $network_template->allow_any_netmask()
     # Modify allow_any_netmask
     $network_template->allow_any_netmask("true");

authority( )

Use this method to set or retrieve the authority flag of a DHCP network template object. This flag specifies if a DHCP server is authoritative for the network.

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

Parameter

Specify "true" to set the authority flag or "false" to deactivate/unset it. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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

auto_create_reversezone( )

Use this method to set or retrieve the auto_create_reversezone flag of a DHCP network template object. This flag indicates whether the appliance must automatically create the corresponding reverse zone.

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

Parameter

Specify "true" to create a reverse zone automatically or "false" to disable the automatic creation of a reverse zone.The default value for this field 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 auto_create_reversezone
     my $auto_create_reversezone = $network_template->auto_create_reversezone();
     # Modify auto_create_reversezone
     $network_template->auto_create_reversezone("true");

bootfile( )

Use this method to set or retrieve the bootfile attribute of a DHCP network template object. You can configure the DHCP server to support clients that use the boot file name option in their DHCPREQUEST messages. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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

This option is overridden independently from Infoblox::DHCP::NetworkTemplate->bootserver() and Infoblox::DHCP::NetworkTemplate->nextserver().

Parameter

The name, in string format, of the file that the client must download. The default value is undefined.

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 bootfile
     my $bootfile = $network_template->bootfile();
     # Modify bootfile
     $network_template->bootfile("bootfile1");
     #Un-override bootfile
     $network_template->bootfile(undef);

bootserver( )

Use this method to set or retrieve the boot server attribute of a DHCP network template object. You can specify the name of the boot server on which the boot file is stored. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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

This option is overridden independently from Infoblox::DHCP::NetworkTemplate->bootfile() and Infoblox::DHCP::NetworkTemplate->nextserver().

Parameter

The next server IP address or name in FQDN (Fully Qualified Domain Name) format. The FQDN consists of the host name followed by the domain name (example: abc.com). A next server name can have a maximum of 256 bytes. The default value is undefined.

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 bootserver
     my $bootserver = $network_template->bootserver();
     # Modify bootserver
     $network_template->bootserver("abc.domain.com");
     #Un-override bootserver
     $network_template->bootserver(undef);

comment( )

Use this method to set or retrieve a descriptive comment about a DHCP network template object.

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

Parameter

Enter a descriptive comment for the network template in string format with a maximum of 256 bytes.

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
     my $comment = $network_template->comment();
     # Modify comment
     $network_template->comment("add a network");

ddns_domainname( )

Use this method to set or retrieve the ddns_domainname value of a DHCP Network template object.

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

Setting this method to a defined value implicitly sets the override_ddns_domainname method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_ddns_domainname attribute to "false".

Note that when ddns_domainname is set to a defined value and override_dddns_domainname is set to "false", the last operation takes precedence. Thus the sequence $object->ddns_domainname("testdomain"); $object->override_ddns_domainname("false"); will set override_ddns_domainname to "false", and the sequence $object->override_ddns_domainname("false"); $object->ddns_domainname("testdomain"); will result in override_ddns_domainname="true".

Parameter

The dynamic DNS domain name 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
 #Get ddns_domainname
 my $ddns_domainname = $network_template->ddns_domainname();
 #Modify ddns_domainname
 $network_template->ddns_domainname("test_domain.com");

ddns_generate_hostname( )

Use this method to set or retrieve the ddns_generate_hostname flag of a DHCP network template object. Set this flag to allow only the DHCP server to generate a host name. This setting overrides the upper-level settings.

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

Parameter

Specify "true" to generate hostname or "false" to deactivate/unset it. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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 ddns_generate_hostname
     my $ddns_generate_hostname = $network_template->ddns_generate_hostname()
     # Modify ddns_generate_hostname
     $network_template->ddns_generate_hostname("true");
     #Un-override
     $network_template->ddns_generate_hostname(undef);

ddns_update_fixed_addresses( )

Use this method to set or retrieve the ddns_update_fixed_addresses flag of a DHCP network template object. By default, the DHCP server does not update DNS when it allocates a fixed address to a client. You can configure the DHCP server to update the A and PTR records of a client with a fixed address. When this feature is enabled and the DHCP server adds A and PTR records for a fixed address, the DHCP server never discards the records. This setting overrides the upper-level settings.

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

Parameter

Specify "true" to update DNS when it allocates a fixed address to a client or "false" to deactivate/unset it. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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 ddns_update_fixed_addresses
     my $ddns_update_fixed_addresses= $network_template->ddns_update_fixed_addresses()
     # Modify ddns_update_fixed_addresses
     $network_template->ddns_update_fixed_addresses("true");
     #Un-override
     $network_template->ddns_update_fixed_addresses(undef);

ddns_server_always_updates( )

Use this method to set or retrieve the ddns_server_always_updates flag of a DHCP network template object. Set this flag to allow the DHCP server only to update DNS, regardless of the requests from DHCP clients.

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

Parameter

Specify "true" to set this flag and allow the DHCP server only to update DNS or "false" to deactivate/unset the flag. The default value is true.

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

ddns_ttl( )

Use this method to set or retrieve the DNS update Time to Live (TTL) value of a DHCP network template object. The TTL value indicates the number of seconds the Infoblox appliance caches a DDNS update.

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

Setting this method to a defined value implicitly sets the override_ddns_ttl method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_ddns_ttl attribute to "false".

Note that when ddns_ttl is set to a defined value and override_dddns_ttl is set to "false", the last operation takes precedence. Thus the sequence $object->ddns_ttl(12); $object->override_ddns_ttl("false"); will set override_ddns_ttl to "false", and the sequence $object->override_ddns_ttl("false"); $object->ddns_ttl(12); will result in override_ddns_ttl="true".

Parameter

A 32-bit integer (range from 0 to 4294967295) that represents the duration, in seconds, that the update is cached. Zero indicates that the update should not be cached. The default value is 0.

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 DNS Update ttl
     my $dns_ttl = $network_template->ddns_ttl();
     #Modify DNS Update ttl
     $network_template->ddns_ttl(1200);

ddns_use_option81( )

Use this method to set or retrieve the ddns_use_option81 flag of a DHCP network template object. Enable this method to define the settings for option 81 at the network template level. This setting overrides the upper-level settings.

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

Parameter

Specify "true" to enable support for option 81 or "false" to disable support. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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 ddns_use_option81
     my $ddns_use_option81 = $network_template->ddns_use_option81()
     # Modify ddns_use_option81
     $network_template->ddns_use_option81("true");
     # un-override ddns_use_option81
     $network_template->ddns_use_option81(undef);

deny_bootp( )

Use this method to set or retrieve the deny_bootp flag of a DHCP Network object.

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

Parameter

Specify "true" to set the deny_bootp flag or "false" to deactivate/unset it. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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

email_list( )

Use this method to set or retrieve the e-mail lists to which the appliance sends threshold e-mail messages.

If you enter e-mail addresses in the email_list, then the appliance sends DHCP threshold alarms to the e-mail addresses.

Parameter

The valid value is an array reference that contains string 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 email_list
 my @email_list = $network_template->email_list();
 #Modify email_list
 $network_template->email_list( [ "admin\@test.com" ] );

enable_ddns( )

Use this method to set or retrieve the dynamic DNS updates flag of a DHCP network template object. The DHCP server can send DDNS updates to DNS servers in the same grid and to external DNS servers. This setting overrides the upper-level settings.

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

Parameter

Specify "true" to set the dynamic DNS updates flag or "false" to deactivate/unset it. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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 enable_ddns
     my $enable_ddns = $network_template->enable_ddns()
     # Modify enable_ddns
     $network_template->enable_ddns("true");
     # Un-override enable_ddns
     $network_template->enable_ddns(undef);

enable_dhcp_thresholds( )

Use this method to set or retrieve the DHCP thresholds of a network template object. These thresholds are the high and low watermarks. If DHCP range usage goes above or below these percentage values, the Infoblox appliance generates a syslog message and sends an SNMP notification.

Enable this flag to set DHCP threshold values.

Parameter

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

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 enable_dhcp_thresholds
 my $enable_dhcp_thresholds = $network_template->enable_dhcp_thresholds();
 #Modify enable_dhcp_thresholds
 $network_template->enable_dhcp_thresholds("false");

enable_email_warnings( )

Use this method to send DHCP thresholds warnings through e-mail.

Enable this flag if you want the appliance to send DHCP threshold warnings to the "email_list" provided when DHCP threshold is enabled.

Parameter

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

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 enable_email_warnings
 my $enable_email_warnings = $network_template->enable_email_warnings();
 #Modify enable_email_warnings
 $network_template->enable_email_warnings("false");

enable_snmp_warnings( )

Use this method to send DHCP threshold warnings through SNMP.

If the flag is enabled, then the appliance sends DHCP threshold warnings through SNMP messages when DHCP threshold is enabled.

Parameter

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

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 enable_snmp_warnings
 my $enable_snmp_warnings = $network_template->enable_snmp_warnings();
 #Modify enable_snmp_warnings
 $network_template->enable_snmp_warnings("false");

extattrs( )

Use this method to set or retrieve the extensible attributes associated with a Network Template 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 = $network_template->extattrs();
 #Modify extattrs
 $network_template->extattrs({ 'Site' => $extattr1, 'Administrator' => $extattr2 });

extensible_attributes( )

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

fixed_address_templates( )

Use this method to set or retrieve the fixed address template assigned to this network template object. When you create a network based on a network template object with a fixed address template, the fixed addresses are created based on the associated fixed address template.

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

Parameter

The valid value is an array reference of Infoblox::DHCP::Template 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 fixed_address_templates
     my $fixed_address_templates = $network_template->fixed_address_templates();
     # Modify fixed_address_templates
     my $tmpl = Infoblox::DHCP::Template->new(
        name => "custom_fixed_address_template"
     );
     $network_template->fixed_address_templates([$tmpl]);

high_water_mark( )

Use this method to set the percentage value for DHCP range usage above which the Infoblox appliance generates a syslog message and sends a warning.

When the percent of allocated addresses in a DHCP range exceeds the high_water_mark, the appliance generates a syslog message and sends a warning.

Parameter

The valid value is 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
 #Get high_water_mark
 my $high_water_mark = $network_template->high_water_mark();
 #Modify high_water_mark
 $network_template->high_water_mark("80");

high_water_mark_reset( )

Use this method to set or retrieve the high_water_mark_reset value. If the percentage of allocated addresses drops below this value, the corresponding SNMP trap is reset.

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

Parameter

A number that specifies the percentage of allocated addresses. The range is from 1 to 100. The high watermark reset value must be lower than the high water mark value. The default value is 95.

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 high_water_mark_reset
 my $high_water_mark_reset = $network_template->high_water_mark_reset();
 #Modify high_water_mark_reset
 $network_template->high_water_mark_reset(70);

ignore_dhcp_option_list_request( )

Use this method to set or retrieve the ignore_dhcp_option_list_request flag of a DHCP network template object. Set this flag to ignore option lists requested by clients and return all defined options at the network template level.

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

Parameter

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

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 ignore_dhcp_option_list_request
     my $ignore_dhcp_option_list_request = $network_template->ignore_dhcp_option_list_request();
     # Modify ignore_dhcp_option_list_request
     $network_template->ignore_dhcp_option_list_request("false");
     # Un-override ignore_dhcp_option_list_request
     $network_template->ignore_dhcp_option_list_request(undef);

ipam_email_addresses( )

Use this method to set or retrieve a list of IPAM Utilization email addresses.

Setting this method to a defined value implicitly sets the override_ipam_email_addresses method to "true". Setting the parameter to undefined causes the appliance to use the default from the upper level and automatically resets the override_ipam_email_addresses attribute to "false".

Note that when ipam_email_addresses is set to a defined value and override_ipam_email_addresses is set to "false", the last operation takes precedence. Thus the sequence $object->ipam_email_addresses(['admin@infoblox.com']); $object->override_ipam_email_addresses("false"); will set override_ipam_email_addresses to "false", and the sequence $object->override_ipam_email_addresses("false"); $object->ipam_email_addresses(['admin@infoblox.com']); will result in override_ipam_email_addresses="true".

Parameter

Valid value is an array reference that contains email addresses 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
 #Get ipam_email_addresses
 my $ipam_email_addresses = $network_template->ipam_email_addresses();
 #Modify ipam_email_addresses
 $network_template->ipam_email_addresses($ipam_email_addresses);

ipam_trap_settings( )

Use this method to set or retrieve IPAM Utilization SNMP Trap settings.

Setting this method to a defined value implicitly sets the override_ipam_trap_settings method to "true". Setting the parameter to undefined causes the appliance to use the default from the upper level and automatically resets the override_ipam_trap_settings attribute to "false".

Note that when ipam_trap_settings is set to a defined value and override_ipam_trap_settings is set to "false", the last operation takes precedence. Thus the sequence $object->ipam_trap_settings($ipam_trap); $object->override_ipam_trap_settings("false"); will set override_ipam_trap_settings to "false", and the sequence $object->override_ipam_trap_settings("false"); $object->ipam_trap_settings($ipam_trap); will result in override_ipam_trap_settings="true".

Parameter

Valid value is an Infoblox::Grid::SNMP::IPAMTrap object.

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 ipam_trap_settings
 my $ipam_trap_settings = $network_template->ipam_trap_settings();
 #Modify ipam_trap_settings
 $network_template->ipam_trap_settings($ipam_trap_settings);

ipam_threshold_settings( )

Use this method to set or retrieve IPAM Utilization SNMP Threshold settings.

Setting this method to a defined value implicitly sets the override_ipam_threshold_settings method to "true". Setting the parameter to undefined causes the appliance to use the default from the upper level and automatically resets the override_ipam_threshold_settings attribute to "false".

Note that when ipam_threshold_settings is set to a defined value and override_ipam_threshold_settings is set to "false", the last operation takes precedence. Thus the sequence $object->ipam_threshold_settings($ipam_threshold_settings); $object->override_ipam_trap_settings("false"); will set override_ipam_threshold_settings to "false", and the sequence $object->override_ipam_threshold_settings("false"); $object->ipam_threshold_settings($ipam_threshold_settings); will result in override_ipam_threshold_settings="true".

Parameter

Valid value is an Infoblox::Grid::SNMP::IPAMThreashold object.

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 ipam_threshold_settings
 my $ipam_threshold_settings = $network_template->ipam_threshold_settings();
 #Modify ipam_threshold_settings
 $network_template->ipam_threshold_settings($ipam_threshold_settings);

lease_scavenge_time( )

Use this method to set or retrieve the lease_scavenge_time value of a Network Template object.

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

Setting this method to a defined value implicitly sets the override_lease_scavenge_time method to "true". Setting the parameter to undefined causes the appliance to use the default from the upper level and automatically resets the override_lease_scavenge_time attribute to "false".

Note that when lease_scavenge_time is set to a defined value and override_lease_scavenge_time is set to "false", the last operation takes precedence. Thus the sequence $object->lease_scavenge_time(604800); $object->override_lease_scavenge_time("false"); will set override_lease_scavenge_time to "false", and the sequence $object->override_lease_scavenge_time("false"); $object->lease_scavenge_time(604800); will result in override_lease_scavenge_time="true".

Parameter

An integer that specifies the period of time, in seconds, that free and backup leases remain in the database before they are automatically deleted. To disable lease scavenging, set the parameter to -1. The minimum positive value must be greater than 86400 seconds (1 day). The default value of this parameter is -1, which means that lease scavenging is disabled.

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 lease_scavenge_time
 my $lease_scavenge = $network_template->lease_scavenge_time();
 #Modify lease_scavenge_time
 $network_template->lease_scavenge_time(30 * 24 * 60 * 60);

logic_filters( )

Use this method to set or retrieve all the logic (ordered) filters associated with the DHCP Network Template.

Filters are used to screen address assignments in the DHCP Network Template if the addresses are to be assigned to specific hosts.

Setting this method to a defined value implicitly sets the override_logic_filters method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_logic_filters attribute to "false".

Note that when logic_filters is set to a defined value and override_dlogic_filters is set to "false", the last operation takes precedence. Thus the sequence $object->logic_filters($filters); $object->override_logic_filters("false"); will set override_logic_filters to "false", and the sequence $object->override_logic_filters("false"); $object->logic_filters($filters); will result in override_logic_filters="true".

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

Parameter

The valid value is an array reference that contains either the Infoblox::DHCP::Filter::MAC, Infoblox::DHCP::Filter::NAC, Infoblox::DHCP::Filter::Option objects or the names of the corresponding filters. The filters in the list must satisfy the following conditions:

Filter name must be globally unique.
Filters without expressions must be at the end of the list.
The filters should not be disabled.

The default value of the parameter is undefined.

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 logic_filters
 my $ref_logic_filters = $network_template->logic_filters();
 #Modify logic_filters
 $network_template->logic_filters(["filter_1","filter_2",$exl1]); #$exl1 is an Infoblox::DHCP::Filter::MAC, Infoblox::DHCP::Filter::NAC or Infoblox::DHCP::Filter::Option object.

low_water_mark( )

Use this method to set the percentage value for DHCP range usage below which the Infoblox appliance generates a syslog message and sends a warning.

When the percent of allocated addresses in a DHCP range goes below the low_water_mark, the appliance generates a syslog message and sends a warning.

Parameter

The valid value is 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
 #Get low_water_mark
 my $low_water_mark = $network_template->low_water_mark();
 #Modify low_water_mark
 $network_template->low_water_mark("10");

low_water_mark_reset( )

Use this method to set or retrieve the low_water_mark_reset value. If the percentage of allocated addresses exceeds this value, a corresponding SNMP trap is reset.

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

Parameter

A number that specifies the percentage of allocated addresses. The range is from 1 to 100. The low watermark reset value must be higher than the low watermark value. The default low watermark reset number is 0.

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 low_water_mark_reset
 my $low_water_mark_reset = $network_template->low_water_mark_reset();
 #Modify low_water_mark_reset
 $network_template->low_water_mark_reset(10);

members( )

Use this method to set or retrieve the member or Microsoft (r) server that serves DHCP for the network created from the network template object.

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

Parameter

The valid value is an array reference that contains Infoblox::DHCP::Member or Infoblox::DHCP::MSServer 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
     my $member1 = Infoblox::DHCP::Member->new(
         name     => "infoblox.localdomain",
         ipv4addr => "192.168.1.2",
     );
     # Get members
     my $members = $network_template->members();
     # Modify members
     $network_template->members([$member1]);

name( )

Use this method to set or retrieve the description of the name of the DHCP network template.

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

Parameter

Name of the network template in string format with a maximum of 64 bytes.

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 = $network_template->name();
     #Modify name
     $network_template->name("custom_network_template");

netmask( )

Use this method to set or retrieve the netmask attribute of a DHCP network template object. If "allow_any_netmask" is set to "false", then this attribute must be specified.

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

Parameter

A valid subnet mask. The default value is "255.0.0.0".

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 netmask
     my $netmask = $network_template->netmask();
     #Set netmask
     $nework_template->allow_any_netmask( "false" );
     my $netmask = $network_template->netmask("255.0.0.0");

nextserver( )

Use this method to set or retrieve the nextserver attribute of a DHCP network template object. You can specify the name and/or IP address of the next server to which the host needs to connect in order to boot. This setting overrides the upper-level settings. The default value is undefined which indicates that this attribute inherits the upper-level setting.

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

This option is overridden independently from Infoblox::DHCP::NetworkTemplate->bootfile() and Infoblox::DHCP::NetworkTemplate->bootserver().

Parameter

The next server IP address or name in FQDN (Fully Qualified Domain Name) format. The FQDN consists of the host name followed by the domain name (example: abc.com). A next server name can have a maximum of 256 bytes. The default value is undefined.

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 nextserver
     my $nextserver = $network_template->nextserver();
     # Modify nextserver
     $network_template->nextserver("blue.domain.com");
     #Un-override nextserver
     $network_template->nextserver(undef);

options( )

Use this method to set or retrieve the options value of a network template object. DHCP options provide network configuration settings and various services available on the network for DHCP. This setting overrides the upper-level setting. The default value is undefined which indicates that this attribute inherit the upper-level setting.

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

Parameter

The valid value is an array reference that contains Infoblox::DHCP::Option 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 options
     my $options = $network_template->options();
     #Modify options
     my $option1 = Infoblox::DHCP::Option->new(
         name  => "lease-time",
         value => 50
     );
     $network_template->options([$option1]);

override_ddns_domainname( )

The override_ddns_domainname attribute controls whether the ddns_domainname value in the DHCP network template object is used, instead of the grid default.

The override_ddns_domainname attribute can be specified explicitly. It is also set implicitly when ddns_domainname is set to a defined value.

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

Parameter

Set the parameter to "true" to override the grid-level setting for ddns_domainname. Set the parameter to "false" to inherit the grid-level setting for ddns_domainname.

The default value of this parameter 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
    #Getting override_ddns_domainname
    my $override_ddns_domainname=$network_template->override_ddns_domainname( );
    #Modifying override_ddns_domainname
    $network_template->override_ddns_domainname("true");

override_ddns_ttl( )

The override_ddns_ttl attribute controls whether the ddns_ttl value in the DHCP network template object is used, instead of the grid default.

The override_ddns_ttl attribute can be specified explicitly. It is also set implicitly when ddns_ttl is set to a defined value.

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

Parameter

Set the parameter to "true" to override the grid-level setting for ddns_ttl. Set the parameter to "false" to inherit the grid-level setting for ddns_ttl.

The default value of this parameter 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
    #Getting override_ddns_ttl
    my $override_ddns_ttl=$network_template->override_ddns_ttl( );
    #Modifying override_ddns_ttl
    $network_template->override_ddns_ttl("true");

override_ipam_email_addresses( )

The override_ipam_email_addresses controls whether the ipam_email_addresses in the DHCP network template is used, instead of the upper-level default.

The override_ipam_email_addresses can be specified explicitly. It is also set implicitly when ipam_email_addresses is set to a defined value.

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

Parameter

Set the parameter to "true" to override the upper-level setting for ipam_email_addresses. Set the parameter to "false" to inherit the upper-level setting for ipam_email_addresses.

The default value of this parameter 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 attrubute value
    my $value=$network_template->override_ipam_email_addresses();
    #Modifying attribute value
    $network_template->override_ipam_email_addresses('true');

override_ipam_threshold_settings( )

The override_ipam_threshold_settings controls whether the ipam_threshold_settings in the DHCP network template is used, instead of the upper-level default.

The override_ipam_threshold_settings can be specified explicitly. It is also set implicitly when ipam_threshold_settings is set to a defined value.

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

Parameter

Set the parameter to "true" to override the upper-level setting for ipam_threshold_settings. Set the parameter to "false" to inherit the upper-level setting for ipam_threshold_settings.

The default value of this parameter 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 attrubute value
    my $value=$network_template->override_ipam_threshold_settings();
    #Modifying attribute value
    $network_template->override_ipam_threshold_settings('true');

override_ipam_trap_settings( )

The override_ipam_trap_settings controls whether the ipam_trap_settings in the DHCP network template is used, instead of the upper-level default.

The override_ipam_trap_settings can be specified explicitly. It is also set implicitly when ipam_trap_settings is set to a defined value.

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

Parameter

Set the parameter to "true" to override the upper-level setting for ipam_trap_settings. Set the parameter to "false" to inherit the upper-level setting for ipam_trap_settings.

The default value of this parameter 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 attrubute value
    my $value=$network_template->override_ipam_trap_settings();
    #Modifying attribute value
    $network_template->override_ipam_trap_settings('true');

override_lease_scavenge_time( )

The override_lease_scavenge_time attribute controls whether the lease_scavenge_time value in the network template is used, instead of the upper-level default.

The override_lease_scavenge_time attribute can be specified explicitly. It is also set implicitly when lease_scavenge_time is set to a defined value.

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

Parameter

Set the parameter to "true" to override the upper-level setting for lease_scavenge_time. Set the parameter to "false" to inherit the setting for lease_scavenge_time from the upper level.

The default value of this parameter 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
    #Getting override_lease_scavenge_time
    my $override_lease_scavenge_time=$network_template->override_lease_scavenge_time( );
    #Modifying override_lease_scavenge_time
    $network_template->override_lease_scavenge_time("true");

override_logic_filters( )

The override_logic_filters attribute controls whether the logic_filters value of the DHCP Network Template is used, instead of the Grid default.

The override_logic_filters attribute can be specified explicitly. It is also set implicitly when logic_filters is set to a defined value.

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

Parameter

Set the parameter to "true" to override the Grid-level setting for logic_filters. Set the parameter to "false" to inherit the Grid-level setting for logic_filters.

The default value of this parameter 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
 #Getting override_logic_filters
 my $override_logic_filters=$network_template->override_logic_filters( );
 #Modifying override_logic_filters
 $network_template->override_logic_filters("true");

override_update_dns_on_lease_renewal( )

The override_update_dns_on_lease_renewal attribute controls whether the update_dns_on_lease_renewal value in the DHCP network template object is used, instead of the grid default.

The override_update_dns_on_lease_renewal attribute can be specified explicitly. It is also set implicitly when update_dns_on_lease_renewal is set to a defined value.

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

Parameter

Set the parameter to "true" to override the grid-level setting for update_dns_on_lease_renewal. Set the parameter to "false" to inherit the grid-level setting for update_dns_on_lease_renewal.

The default value of this parameter 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
    #Getting override_update_dns_on_lease_renewal
    my $override_update_dns_on_lease_renewal=$network_template->override_update_dns_on_lease_renewal( );
    #Modifying override_update_dns_on_lease_renewal
    $network_template->override_update_dns_on_lease_renewal("true");

pxe_lease_time( )

Use this method to set or retrieve the PXE lease time value of a DHCP network template object. Some hosts use PXE (Preboot Execution Environment) to boot remotely from a server. To better manage your IP resources, set a different lease time for PXE boot requests. You can configure the DHCP server to allocate an IP address with a shorter lease time to hosts that send PXE boot requests, so IP addresses are not leased longer than necessary. This setting overrides the upper-level settings. The default value is undefined, which indicates that this attribute inherits the upper-level setting.

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

Parameter

A 32-bit integer (range from 0 to 4294967295) that represents the duration, in seconds, that the update is cached. Zero indicates that the update should not be cached. The default value is undefined

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 PXE Lease Time
     my $pxe_lease_time = $network_template->pxe_lease_time();
     #Modify PXE Lease Time
     $network_template->pxe_lease_time(1100);
     #Un-override PXE Lease Time
     $network_template->pxe_lease_time(undef);

range_templates( )

Use this method to set or retrieve the IP address range template assigned to this network template object. When you create a network based on a network template object with a range template, the IP address ranges are created based on the associated IP address range template.

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

Parameter

The valid value is an array reference of Infoblox::DHCP::Template 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 range_templates
     my $range_templates = $network_template->range_templates();
     #Modify range_templates
     my $tmpl = Infoblox::DHCP::Template->new(
        name => "custom_range_template"
     );
     $network_template->range_templates([ $tmpl ]);

update_dns_on_lease_renewal( )

The update_dns_on_lease_renewal attribute controls whether the DHCP server updates DNS when a DHCP lease is renewed.

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

Setting this method to a defined value implicitly sets the override_update_dns_on_lease_renewal method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_update_dns_on_lease_renewal attribute to "false".

Note that when update_dns_on_lease_renewal is set to a defined value and override_update_dns_on_lease_renewal is set to "false", the last operation takes precedence. Thus the sequence $object->update_dns_on_lease_renewal("true"); $object->override_update_dns_on_lease_renewal("false"); will set override_update_dns_on_lease_renewal to "false", and the sequence $object->override_update_dns_on_lease_renewal("false"); $object->update_dns_on_lease_renewal("true"); will result in override_update_dns_on_lease_renewal="true".

Parameter

Specify "true" to set the update_dns_on_lease_renewal flag or "false" to deactivate/unset it.

The default value of this parameter 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 update_dns_on_lease_renewal
    my $update_dns_on_lease_renewal=$network_template->update_dns_on_lease_renewal( );
    #Modify update_dns_on_lease_renewal
    $network_template->update_dns_on_lease_renewal("true");

recycle_leases( )

Use this method to set or retrieve the recycle_leases flag at the network template level.

If the flag is enabled, the leases are kept in the recycle bin until one week after expiration. When the flag is disabled, the leases are irrecoverably deleted.

Parameter

Specify "true" to enable the recycle_leases flag or "false" to disable it. The default value is undefined, which indicates that this attribute inherit the upper-level setting.

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 recycle_leases
 my $recycle_leases = $network_template->recycle_leases();
 #Modify recycle_leases
 $network_template->recycle_leases("false");

rir( )

Use this method to retrieve the name of the Regional Internet Registry (RIR) that allocated this address space. This is a read-only attribute.

Parameter

None

Returns

The method returns the attribute value that can be 'RIPE' or 'NONE'.

Example
 #Get rir
 my $rir = $network_template->rir();

rir_organization( )

Use this method to set or retrieve the Regional Internet Registry (RIR) organization object.

Parameter

An Infoblox::Grid::RIR::Organization object.

You must enable support for RIR/SWIP at the Grid level before you can set attribute values. See Infoblox::Grid->enable_rir_swip() method.

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 rir_organization
 my $rir_organization = $network_template->rir_organization();
 #Modify rir_organization
 $network_template->rir_organization($rir_org);

rir_registration_action( )

Use this method to set or retrieve the registration action of Regional Internet Registry (RIR).

Parameter

Valid values are 'NONE', 'CREATE'.

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 rir_registration_action
 my $rir_registration_action = $network_template->rir_registration_action();
 #Modify rir_registration_action
 $network_template->rir_registration_action('CREATE');

rir_registration_status( )

Use this method to set or retrieve the registration status of Regional Internet Registry (RIR).

Parameter

The registration status of Regional Internet Registry (RIR), which can be 'REGISTERED' or 'NOT_REGISTERED'.

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 rir_registration_status
 my $rir_registration_status = $network_template->rir_registration_status();
 #Modify rir_registration_status
 $network_template->rir_registration_status('NOT_REGISTERED');

send_rir_request( )

Use this method to set or retrieve the flag that indicates whether the appliance should send an API or email request for Regional Internet Registry (RIR).

Parameter

Specify "true" to set the send_rir_request flag or "false" to unset it.

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


SAMPLE CODE

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

#Preparation prior to a DHCP network template insertion

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

#Add network template object

 #Create a DHCP Network template object
 my $network_template = Infoblox::DHCP::NetworkTemplate->new(
                                  name                    => "custom_network_template",
                                  netmask                 => "255.0.0.0",
                                  comment                 => "add network template",
                                  members                 => [ $memberdhcp ],
                                  authority               => "true",
                                  enable_ddns             => "true",
                                  pxe_lease_time          => "3600",
                                  bootserver              => "someserver.com",
                                  nextserver              => "3.3.3.3",
                                  bootfile                => "bootfile.com",
                                  auto_create_reversezone => "true",
                                  );
 my $response = $session->add($network_template)
        or die("Add Network template failed: ",
              $session->status_code() . ":" . $session->status_detail());
 print "Network template added successfully\n";

#Get and modify a network template attribute

 #Get Network template through the session
 my  @retrieved_objs = $session->get(
            object => "Infoblox::DHCP::NetworkTemplate",
            name   => "custom_network_template"
         );
 my $object = $retrieved_objs[0];
 unless ($object) {
     die("Get Network template object failed: ",
         $session->status_code() . ":" . $session->status_detail());
 }
 print "Get Network template found at least 1 matching entry\n";

#Search a network template attribute

 #Search Network template through the session
 my  @retrieved_objs = $session->search(
            object => "Infoblox::DHCP::NetworkTemplate",
            name   => "custom_network_template"
         );
 my $object = $retrieved_objs[0];
 unless ($object) {
     die("Search Network template object failed: ",
         $session->status_code() . ":" . $session->status_detail());
 }
 print "Search Network template found at least 1 matching entry\n";
 #Modify attributes of the specified Network Template
 $object->enable_ddns("true"); #Apply the changes
 #Un-override bootfile
 $object->bootfile(undef);
 #Un-override bootserver
 $object->bootserver(undef);
 #Un-override nextserver
 $object->nextserver(undef);
 $session->modify($object)
     or die("Modify Network template attribute failed: ",
            $session->status_code() . ":" . $session->status_detail());
 print "Network template object modified successfully \n";

#Remove a network template object

 #Get Network Template object through the session
  my @retrieved_objs = $session->get(
            object  => "Infoblox::DHCP::NetworkTemplate",
            name    => "custom_network_template"
        );
    my $object = $retrieved_objs[0];
    unless ($object) {
     die("Get Network Template object failed: ",
         $session->status_code() . ":" . $session->status_detail());
     }
 print "Get Network Template object found at least 1 matching entry\n";
 #Submit the object for removal
 $session->remove($object)
     or die("Remove Network Template failed: ",
         $session->status_code() . ":" . $session->status_detail());
 print "Network Template removed successfully \n";
 ####PROGRAM ENDS####


AUTHOR

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


SEE ALSO

Infoblox::Session, Infoblox::DHCP::Member, Infoblox::DHCP::Option, Infoblox::DHCP::Network, Infoblox::DHCP::RangeTemplate, Infoblox::DHCP::FixedAddrTemplate, Infoblox::DHCP::Template, Infoblox::Session->get(), Infoblox::Session->search(), Infoblox::Session->add(), Infoblox::Session->remove(), Infoblox::Session->modify()


COPYRIGHT

Copyright (c) 2017 Infoblox Inc.