Infoblox::DHCP::IPv6HostAddr - DHCP IPv6 Host Address object.
An IPv6 Host Address is an object used to specify IPv6 addresses in a DNS Host object.
my $host_addr = Infoblox::DHCP::IPv6HostAddr -> new( duid => $string, # Required address_type => "ADDRESS" | "PREFIX" | "BOTH", # Optional / Default is "ADDRESS" configure_for_dhcp => "true" | "false", # Optional / Default is "false" # When both the IP address and DUID are present, the default value is "true" # Applicable only when adding this host address to a host domain_name => $string, # Optional / Default is undefined domain_name_servers => "$ipv6addr1,$ipv6addr2,...", # Optional / Default is undefined ipv6addr => $ipv6addr, # Optional / one of ipv6addr or ipv6prefix is required ipv6prefix => $ipv6addr, # Optional / one of ipv6addr or ipv6prefix is required ipv6prefix_bits => $ipv6addr, # Optional / Required if ipv6prefix is specified match_client => $string, # Optional / Default is "DUID" # Possible values are: # "DUID", "RESERVED", options => [$option1, $option2, ...] # Optional / Default is empty override_domain_name => "true" | "false", # Optional / Default value is "false" override_domain_name_servers => "true" | "false", # Optional / Default value is "false" override_options => "true" | "false", # Optional / Default value is "false" override_preferred_lifetime => "true" | "false", # Optional / Default value is "false" override_valid_lifetime => "true" | "false", # Optional / Default value is "false" preferred_lifetime => $num, # Optional / Default is "27000" valid_lifetime => $num, # Optional / Default is 43200 use_for_ea_inheritance => "true" | "false", # Optional / Default value is "false" reserved_interface => $interface, # Optional );
This section describes all the methods in Infoblox::Session module that you can apply to a DHCP IPv6 Host Address object.
Use this function to specify the addresses associated with the Host record. See Infoblox::DNS::Host->ipv6addrs() for parameters and return values.
#Construct a Host Address object my $h1 = Infoblox::DHCP::HostAddr->new( duid => '0cc084d303010003', ipv6addr => '2001::4', );
# Configure an address in the Host record object $host->ipv6addrs([$h1]);
Use this method to retrieve all the matching objects from the Infoblox appliance. See Infoblox::Session->get() for parameters and return values.
'discover_now_status' will not be returned by default, use 'return_methods' to request it if needed.
Apply the following attributes to get a specific DHCP IPv6 Host Address object:
comment - Optional. User-specified comment for the host address. duid - Optional. DUID of the host address. ipv6addr - Optional. IPv6 address of the host address. network - Optional. Network address of the host address. network_view - Optional. Network view in which the host address is located. By default, all network views are searched. extensible_attributes - Optional. A hash reference containing extensible attributes.
discovered_duid - Optional. Discovered DHCPv6 UID. discovered_name - Optional. Discovered name. discoverer - Optional. Discoverer name. first_discovered - Optional. Time of the first discovery. last_discovered - Optional. Time of the last discovery. netbios - Optional. Discovered NetBIOS name. network_component_description - Optional. Discovered network component description. network_component_ip - Optional. Discovered network component IP address. network_component_name - Optional. Discovered network component name. network_component_port_description - Optional. Discovered network component port description. network_component_port_name - Optional. Discovered network component port name. network_component_port_number - Optional. Discovered network component port number. network_component_type - Optional. Discovered network component type. os - Optional. Discovered OS. port_duplex - Optional. Discovered port duplex settings. port_link_status - Optional. Discovered port link status. port_speed - Optional. Discovered port speed settings. port_status - Optional. Discovered port status settings. port_vlan_description - Optional. Discovered port VLAN description. port_vlan_name - Optional. Discovered port VLAN name. port_vlan_number - Optional. Discovered port VLAN number.
#Get DHCP IPv6 Host Address object through the session my @retrieved_objs = $session->get( object => "Infoblox::DHCP::IPv6HostAddr", duid => "0001", ); my @retrieved_objs = $session->get( object => "Infoblox::DHCP::IPv6HostAddr", ipv6addr => "2001::1", );
Use this method to modify a DHCP IPv6 Host Address object in the Infoblox appliance. See Infoblox::Session->modify() for parameters and return values.
#Use method to modify the preferred_lifetime $ipv6ha->preferred_lifetime("1234567"); #Submit modification my $response = $session->modify( $ipv6ha );
Use this method to search for DHCP IPv6 Host Address object and matching Host object with MAC address in the Infoblox appliance. See Infoblox::Session->search() for parameters and return values.
'discover_now_status' will not be returned by default, use 'return_methods' to request it if needed.
Apply the following attributes to search for a specific DHCP IPv6 Host Address object:
comment - Optional. User-specified comment for the host address. duid - Optional. DUID of the host address. ipv6addr - Optional. IPv6 address of the host address. network - Optional. Network address of the host address. network_view - Optional. Network view in which the host address is located. By default, all network views are searched.
discovered_duid - Optional. Discovered DHCPv6 UID. discovered_name - Optional. Discovered name (regular expression). discoverer - Optional. Discoverer name (regular expression). first_discovered - Optional. Time of the first discovery. last_discovered - Optional. Time of the last discovery. netbios - Optional. Discovered NetBIOS name (regular expression). network_component_description - Optional. Discovered network component description (regular expression). network_component_ip - Optional. Discovered network component IP address (regular expression). network_component_name - Optional. Discovered network component name (regular expression). network_component_port_description - Optional. Discovered network component port description (regular expression). network_component_port_name - Optional. Discovered network component port name (regular expression). network_component_port_number - Optional. Discovered network component port number. network_component_type - Optional. Discovered network component type (regular expression). os - Optional. Discovered OS (regular expression). port_duplex - Optional. Discovered port duplex settings. port_link_status - Optional. Discovered port link status. port_speed - Optional. Discovered port speed settings port_status - Optional. Discovered port status settings. port_vlan_description - Optional. Discovered port VLAN description (regular expression). port_vlan_name - Optional. Discovered port VLAN name (regular expression). port_vlan_number - Optional. Discovered port VLAN numbe.
# Search for all DHCP IPv6 Host Address objects that are specified in the network "2001::/24" in the "default" network view. my @retrieved_objs = $session->search( object => "Infoblox::DHCP::IPv6HostAddr", duid => "0001", );
This section describes all the methods that you can use to set and retrieve the attribute values of a DHCP IPv6 Host Address object.
Use this method to set or retrieve the address type of a DHCP IPv6 Host Address object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Valid values are "ADDRESS", "PREFIX", or "BOTH". When the address type is "ADDRESS", a value for the 'ipv6addr' member is required. When the address type is "PREFIX", values for 'ipv6prefix' and 'ipv6prefix_bits' are required. When the address type is "BOTH", values for 'ipv6addr', 'ipv6prefix', and 'ipv6prefix_bits' are all required.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get address_type my $address_type = $ipv6ha->address_type(); #Modify address_type $ipv6ha->address_type("PREFIX");
Use this method to set or retrieve the configure_for_dhcp flag of a DHCP IPv6 Host Address object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify "true" to set the configure_for_dhcp flag or "false" to deactivate/unset it. The default value is "false".
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get configure_for_dhcp my $configure_for_dhcp = $ipv6ha->configure_for_dhcp(); #Modify configure_for_dhcp $ipv6ha->configure_for_dhcp("true");
Use this method to retrieve the discovered data of a DHCP IPv6 Host Address object. This is a read-only attribute.
Omit the parameter to retrieve the attribute value.
None
The valid return value is an Infoblox::Grid::Discovery::Data object.
#Get discovered_data value my $discovered_data = $object->discovered_data();
Use this method to retrieve the discovered DHCPv6 UID (DUID) of a DHCP IPv6 Host Address object.
none
The method returns the discovered name.
#Get discovered_duid my $discovered_duid = $ipv6ha->discovered_duid();
Use this method to retrieve the discovered name of a DHCP IPv6 Host Address object.
none
The method returns the discovered name.
#Get discovered_name my $discovered_name = $ipv6ha->discovered_name();
Use this method to retrieve the discoverer of a DHCP IPv6 Host Address object.
none
The method returns the discoverer value.
#Get discoverer my $discoverer = $ipv6ha->discoverer();
Use this method to retrieve the current discovery status. This attribute is read-only.
'discover_now_status' will not be returned by default, use 'return_methods' to request it if needed.
None.
The method returns the attribute value that can be 'COMPLETE', 'FAILED', 'NONE', 'PENDING' or 'RUNNING'.
#Get discover_now_status my $discover_now_status = $ipv6ha->discover_now_status();
Use this method to set or retrieve the domain_name value of a DHCP IPv6 host address 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_domain_name method to "true". Setting the parameter to undefined causes the appliance to use the upper-level default and automatically resets the override_domain_name attribute to "false".
Note that when domain_name is set to a defined value and override_domain_name is set to "false", the last operation takes precedence. Thus the sequence $object->domain_name("testdomain"); $object->override_domain_name("false"); will set override_domain_name to "false", and the sequence $object->override_domain_name("false"); $object->domain_name("testdomain"); will set override_domain_name to "true".
The client's domain name in string format.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get domain_name my $domain_name = $host_addr->domain_name(); #Modify domain_name $host_addr->domain_name("test_domain.com");
Use this method to set or retrieve the domain_name_servers value of a DHCP IPv6 host address 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_domain_name_servers method to "true". Setting the parameter to undefined causes the appliance to use the upper-level default and automatically resets the override_domain_name_servers attribute to "false".
Note that when domain_name_servers is set to a defined value and override_domain_name_servers is set to "false", the last operation takes precedence. Thus the sequence $object->domain_name_servers("2001::1,2001::2"); $object->override_domain_name_servers("false"); will set override_domain_name_servers to "false", and the sequence $object->override_domain_name_servers("false"); $object->domain_name_servers("2001::1,2001::2"); will set in override_domain_name_servers to "true".
The comma-separated list of domain name server addresses in IPv6 address format.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get domain_name_servers my $domain_name_servers = $host_addr->domain_name_servers(); #Modify domain_name_servers $host_addr->domain_name_servers("2001::1,2001::2");
Use this method to set or retrieve the DHCPv6 Unique Identifier (DUID) of the IPv6 Host Address object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The DUID of the matching client in hexadecimal format.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get duid my $duid = $ipv6ha->duid(); #Modify duid $ipv6ha->duid("1c2edfaa");
Use this method to retrieve the date and time that the DHCP IPv6 Host Address object was first discovered.
none
The method returns the date and time that the DHCP IPv6 Host Address object was first discovered.
#Get first_discovered my $first_discovered = $ipv6ha->first_discovered();
Use this method to set or retrieve the the IPv6 address of the IPv6 Host Address object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
An IPv6 address is a 128-bit number represented as eight groups of four hexadecimal digits (i.e. two octets), with each group separated by a colon(:)
(example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334). Leading zeroes and groups of consecutive zeros within the value can be omitted to produce a more compact representation (example: 2001::1, ::1), and dotted-quad notations can be used to express IPv4-mapped IPv6 addresses (example: ::ffff:192.0.2.128).
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get ipv6addr my ipv6addr = $ipv6ha->ipv6addr(); #Modify ipv6addr $ipv6ha->ipv6addr("aaaa:1111:bbbb:2222:cccc:3333:dddd:5555");
Use this method to set or retrieve the IPv6 prefix of a DHCP IPv6 Host Address object. The prefix must belong to the list of global prefixes defined in the Infoblox::Grid::DHCP object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
IPv6 prefix from the list of global IPv6 prefixes.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails. ls.
If you did not specify a parameter, the method returns the attribute value.
#Get ipv6prefix my $ipv6prefix = $ipv6ha->ipv6prefix(); #Modify ipv6prefix $ipv6ha->ipv6prefix("2001::");
Use this method to set or retrieve the prefix bits for the DHCP IPv6 Host Address.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
An unsigned integer between 2 and 128.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get ipv6prefix_bits my $ipv6prefix_bits = $ipv6ha->ipv6prefix_bits(); #Modify ipv6prefix_bits $ipv6ha->ipv6prefix_bits(32);
Use this method to retrieve the time this object was last seen by a discovery job.
The default value for this field is empty.
N/A
The method returns the attribute value.
#Get last_discovered my $last_discovered = $ipv6ha->last_discovered();
Use this method to retrieve the time when the associated record was last queried. This is a read-only attribute.
None
The method returns the attribute value. The number of seconds that have elapsed since January 1st, 1970 UTC.
#Get last_queried my $last_queried = $ipv6ha->last_queried();
Use this method to set or retrieve the match_client value of a DHCP Host Address object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
match_client "DUID": The fixed IP address is leased to the matching DUID.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get match_client my $match_client = $ipv6ha->match_client(); #Modify match_client $ipv6ha->match_client("DUID");
Use this method to retrieve Microsoft Active Directory users related information. This is a read-only attribute.
None
The valid return value is an Infoblox::Grid::MSServer::AdUser::Data object.
#Get ms_ad_user_data my $ms_ad_user_data = $host_addr->ms_ad_user_data();
Use this method to set or retrieve the name of a DHCP IPv6 Host Address object. The same name can be used for multiple host addresses.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify a name in string format.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get the name my $name = $ipv6ha->name(); #Modify the name $ipv6ha->name("pop-server");
Use this method to retrieve the name in the NetBIOS reply that responded to a NetBIOS query.
The method returns the attribute value.
#Get NetBIOS my $netbios = $ipv6ha->netbios();
Use this method to retrieve the network value of a DHCP IPv6 Host Address object. This is a read-only attribute.
Omit the parameter to retrieve the attribute value.
None
The method returns the attribute value.
#Get network value my $value = $object->network();
Use this method to retrieve the description of the network device that is connected to the DHCP IPv6 Host Address object.
none
The method returns the network device description.
#Get network_component_description my $network_component_description = $ipv6ha->network_component_description();
Use this method to retrieve the IP address of the network device that is connected to the DHCP IPv6 Host Address object.
none
The method returns the IP address of the network device.
#Get network_component_ip my $network_component_ip = $ipv6ha->network_component_ip();
Use this method to retrieve the name of the network device that is connected to the DHCP IPv6 Host Address object.
none
The method returns the network device name.
#Get network_component_name my $network_component_name = $ipv6ha->network_component_name();
Use this method to retrieve the description of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the description of the port on the network device.
#Get network_component_port_description my $network_component_port_description = $ipv6ha->network_component_port_description();
Use this method to retrieve the name of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the name of the port on the network device.
#Get network_component_port_name my $network_component_port_name = $ipv6ha->network_component_port_name();
Use this method to retrieve the number of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the network device port number.
#Get network_component_port_number my $network_component_port_number = $ipv6ha->network_component_port_number();
Use this method to retrieve the type of the network device that is connected to the DHCP IPv6 Host Address object.
none
The method returns the network device type.
#Get network_component_type my $network_component_type = $ipv6ha->network_component_type();
Use this method to set or retrieve the options of a DHCP IPv6 Host Address 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_options method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_options attribute to "false".
Note that when the options method is set to a defined value and override_options is set to "false", the last operation takes precedence. Thus the sequence $object->options([ $opt ]); $object->override_options("false"); will set override_options to "false", and the sequence $object->override_options("false"); $object->options([ $opt ]); will set override_options to "true".
The valid value is an array reference that contains Infoblox::DHCP::Option object(s).
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get options my $options = $ipv6ha->options(); #Modify options my $option1 = Infoblox::DHCP::Option->new( name => "dhcp6.rapid-commit", value => "true" ); $ipv6ha->options([$option1);
Use this method to retrieve the operating system associated with this host address.
The method returns the attribute value.
#Get OS my $os = $ipv6ha->os();
The override_domain_name attribute controls whether the domain_name value in the DHCP IPv6 host address is used, instead of the upper-level default.
The override_domain_name attribute can be specified explicitly. It is also set implicitly when domain_name is set to a defined value.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Set the parameter to "true" to override the upper-level setting for domain_name. Set the parameter to "false" to inherit the upper-level setting for domain_name.
The default value of this parameter is "false".
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get override_domain_name my $override_domain_name=$ipv6ha->override_domain_name( ); #Modify override_domain_name $ipv6ha->override_domain_name("true");
The override_domain_name_servers attribute controls whether the domain_name_servers value in the DHCP IPv6 host address is used, instead of the upper-level default.
The override_domain_name_servers attribute can be specified explicitly. It is also set implicitly when domain_name_servers is set to a defined value.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Set the parameter to "true" to override the upper-level setting for domain_name_servers. Set the parameter to "false" to inherit the upper-level setting for domain_name_servers.
The default value of this parameter is "false".
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get override_domain_name_servers my $override_domain_name_servers=$ipv6ha->override_domain_name_servers( ); #Modify override_domain_name_servers $ipv6ha->override_domain_name_servers("true");
The override_options attribute controls whether the options in the DHCP IPv6 host address are used, instead of the upper-level default.
The override_options attribute can be specified explicitly. It is also set implicitly when options are set to defined values.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Set the parameter to "true" to override the upper-level setting for valid_lifetime. Set the parameter to "false" to inherit the upper-level setting for valid_lifetime.
The default value of this parameter is "false".
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get override_options my $override_options=$host_addr->override_options( ); #Modify override_options $host_addr->override_options("true");
The override_preferred_lifetime attribute controls whether the preferred_lifetime value in the DHCP IPv6 host address is used, instead of the upper-level default.
The override_preferred_lifetime attribute can be specified explicitly. It is also set implicitly when preferred_lifetime is set to a defined value.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Set the parameter to "true" to override the upper-level setting for valid_lifetime. Set the parameter to "false" to inherit the upper-level setting for valid_lifetime.
The default value of this parameter is "false".
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get override_preferred_lifetime my $override_preferred_lifetime=$host_addr->override_preferred_lifetime( ); #Modify override_preferred_lifetime $host_addr->override_preferred_lifetime("true");
The override_valid_lifetime attribute controls whether the valid_lifetime value in the DHCP IPv6 host address is used, instead of the upper-level default.
The override_valid_lifetime attribute can be specified explicitly. It is also set implicitly when valid_lifetime is set to a defined value.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Set the parameter to "true" to override the upper-level setting for valid_lifetime. Set the parameter to "false" to inherit the upper-level setting for valid_lifetime.
The default value of this parameter is "false".
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get override_valid_lifetime my $override_valid_lifetime=$host_addr->override_valid_lifetime( ); #Modify override_valid_lifetime $host_addr->override_valid_lifetime("true");
Use this method to retrieve the duplex setting of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the port duplex setting. The returned value, if any, is one of the following:
Full Half
#Get port_duplex my $port_duplex = $ipv6ha->port_duplex();
Use this method to retrieve the link status of the network device port that is connected to the DHCP IPv6 Host Address object.
none
This method returns the link status of the network device port. The returned value, if any, is one of the following:
Connected Not Connected Unknown
#Get port_link_status my $port_link_status = $ipv6ha->port_link_status();
Use this method to retrieve the speed of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the network device port speed. The returned value, if any, is one of the following:
10M 100M 1G 10G 100G Unknown
#Get port_speed my $port_speed = $ipv6ha->port_speed();
Use this method to retrieve the status of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the network device port status. The returned value, if any, is one of the following:
Up Down Unknown
#Get port_status my $port_status = $ipv6ha->port_status();
Use this method to retrieve the VLAN description of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the VLAN description of the network device port.
#Get port_vlan_description my $port_vlan_description = $ipv6ha->port_vlan_description();
Use this method to retrieve the VLAN name of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the network device port VLAN name.
#Get port_vlan_name my $port_vlan_name = $ipv6ha->port_vlan_name();
Use this method to retrieve the VLAN number of the network device port that is connected to the DHCP IPv6 Host Address object.
none
The method returns the port VLAN number.
#Get port_vlan_number my $port_vlan_number = $ipv6ha->port_vlan_number ();
Use this method to set or retrieve the preferred_lifetime value of a DHCP IPv6 Host Address 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_preferred_lifetime method to "true". Setting the parameter to undefined causes the appliance to use the upper-level default and automatically resets the override_preferred_lifetime attribute to "false".
Note that when preferred_lifetime is set to a defined value and override_preferred_lifetime is set to "false", the last operation takes precedence. Thus the sequence $object->preferred_lifetime(20000); $object->override_preferred_lifetime("false"); will set override_preferred_lifetime to "false", and the sequence $object->override_preferred_lifetime("false"); $object->preferred_lifetime(20000); will set override_preferred_lifetime to "true".
A 32-bit integer (valid range from 1 to 4294967295) that represents the lifetime, in seconds. The default value is 27000.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get preferred_lifetime my $preferred_lifetime = $ipv6ha->preferred_lifetime(); #Modify preferred_lifetime $ipv6ha->preferred_lifetime("369");
Use this method to set or retrieve the reserved discovery interface.
Valid value is an Infoblox::Grid::Discovery::DeviceInterface object.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get reserved_interface my $reserved_interface = $ipv6ha->reserved_interface(); #Modify reserved_interface $ipv6ha->reserved_interface($interface);
Use this method to set or retrieve the valid_lifetime value of a DHCP IPv6 Host Address object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
A 32-bit integer, from 1 to 4294967295, that represents the lifetime, in seconds. The default value is 43200.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get valid_lifetime my $valid_lifetime = $ipv6ha->valid_lifetime(); #Modify valid_lifetime $ipv6ha->valid_lifetime("36900");
Use this method to set or retrieve the flag that indicates if this host address is used for inheritable extensible attributes.
Specify "true" to enable the flag or "false" to disable it. The default value is "false".
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
If you did not specify a parameter, the method returns the attribute value.
#Get use_for_ea_inheritance my $use_for_ea_inheritance = $ipv6ha->use_for_ea_inheritance(); #Modify use_for_ea_inheritance $ipv6ha->use_for_ea_inheritance("true");
The following sample code demonstrates the different functions that can be applied to an object such as search and modify. This sample also includes error handling for the operations.
#Preparation prior to a DHCP IPv6 Host Address object insertion
#PROGRAM STARTS: Include all the modules that will be used, note the hostaddress option use strict; use Infoblox qw (:hostaddress);
#Create a session to the Infoblox appliance
my $session = Infoblox::Session->new( master => "192.168.1.2", #appliance host ip username => "admin", #appliance user login password => "infoblox" #appliance password );
unless ($session) { die("Construct session failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Session created successfully\n";
#Create an IPv6 network object my $network = Infoblox::DHCP::IPv6Network->new( "network" => "2001::/64", ); unless($network) { die("Construct IPv6 Network object failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "IPv6 Network object created successfully\n";
$session->add($network) or die("Add network failed: ", $session->status_code() . ":" . $session->status_detail()); print "Network added successfully\n";
#Create a zone object my $zone = Infoblox::DNS::Zone->new( name => "test.com", ); unless($zone) { die("Construct Zone object failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Zone object created successfully\n";
$session->add($zone) or die("Add zone failed: ", $session->status_code() . ":" . $session->status_detail()); print "Zone added successfully\n";
my $option1 = Infoblox::DHCP::Option->new( "name" => "dhcp6.fqdn", "value" => "mydomain.com" ); unless($option1) { die("Construct option1 object failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "option1 object created successfully\n";
my $option2 = Infoblox::DHCP::Option->new( "name" => "dhcp6.info-refresh-time", "value" => "1000", ); unless($option2) { die("Construct option2 object failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "option2 object created successfully\n";
#Create a DHCP IPv6 Host address object
#Create a DHCP IPv6 Host Address object my $host_addr = Infoblox::DHCP::IPv6HostAddr->new( "ipv6addr" => "2001::4", "duid" => "00:00:00:11:11:11", "domain_name" => "foo.com", "domain_name_servers" => "2002::1,2002::2", "preferred_lifetime" => 1234, "override_preferred_lifetime" => "true", "valid_lifetime" => 123456, "override_valid_lifetime" => "true", "options" => [ $option1 , $option2 ], ); unless($host_addr) { die("Construct IPv6 host address failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "DHCP IPv6 Host address object created successfully\n";
my $host = Infoblox::DNS::Host->new( name => "host.test.com", ipv6addrs => [$host_addr], );
unless($host) { die("Construct IPv6 host record failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); }
$session->add($host) or die("Add host failed: ", $session->status_code() . ":" . $session->status_detail()); print "Host added successfully\n";
#Get and modify a DHCP IPv6 Host Address object
#Get DHCP IPv6 Host Address object through the session my @retrieved_objs = $session->get( object => "Infoblox::DHCP::IPv6HostAddr", duid => "00:00:00:11:11:11", ); my $object = $retrieved_objs[0]; unless ($object) { die("Get IPv6 Host Address object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Get IPv6 Host Address object found at least 1 matching entry\n";
#Modify one of the attributes of the obtained IPv6 Host Address object $object->preferred_lifetime(1235);
#Apply the changes $session->modify($object) or die("Modify IPv6 Host Address object failed: ", $session->status_code() . ":" . $session->status_detail()); print "IPv6 Host Address object modified successfully \n";
#Verify that this was changed also when retrieving this via the host record my @retrieved_objs = $session->get( object => "Infoblox::DNS::Host", name => "host.test.com", ); my $object = $retrieved_objs[0]; unless ($object) { die("Get Host record failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Get host record object found at least 1 matching entry\n";
my $hostaddress = @{$object->ipv6addrs()}[0];
unless ($hostaddress->preferred_lifetime() == 1235) { die("The modification of host address has failed: ", $session->status_code() . ":" . $session->status_detail()); } print "The change to preferred lifetime has succeeded correctly\n";
#The host address retrieved this way can also be modified without submitting the full host record $hostaddress->preferred_lifetime(1111);
#Apply the changes $session->modify($hostaddress) or die("Modify IPv6 Host Address object failed: ", $session->status_code() . ":" . $session->status_detail()); print "IPv6 Host Address object modified successfully \n";
#Verify the change was submitted successfully @retrieved_objs = $session->get( object => "Infoblox::DHCP::IPv6HostAddr", duid => "00:00:00:11:11:11", ); $object = $retrieved_objs[0]; unless ($object) { die("Get IPv6 Host Address object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Get IPv6 Host Address object found at least 1 matching entry\n";
unless ($hostaddress->preferred_lifetime() == 1111) { die("The modification of host address has failed: ", $session->status_code() . ":" . $session->status_detail()); }
#Submit the Host object for removal $session->remove($host) or die("Remove Host object failed: ", $session->status_code() . ":" . $session->status_detail()); print "Host object removed successfully \n";
#Submit the Zone object for removal $session->remove($zone) or die("Remove Zone object failed: ", $session->status_code() . ":" . $session->status_detail()); print "Zone object removed successfully \n";
#Submit the Network object for removal $session->remove($network) or die("Remove Network object failed: ", $session->status_code() . ":" . $session->status_detail()); print "Network object removed successfully \n";
Infoblox Inc. http://www.infoblox.com/
Infoblox::DHCP::IPv6Network, Infoblox::DHCP::View, Infoblox::DHCP::IPv6Range, Infoblox::Session->get(), Infoblox::Session->modify(), Infoblox::Session->search(), Infoblox::Session, Infoblox::Grid::Discovery::Data, Infoblox::Grid::MSServer::AdUser::Data
Copyright (c) 2017 Infoblox Inc.