Infoblox::DHCP::RoamingHost - DHCP Roaming Host object.
A Roaming Host is a specific host that a DHCP server always assigns when a lease request comes from a particular MAC address of the client.
my $roaming_host = Infoblox::DHCP::RoamingHost -> new( name => $string, #Required address_type => "ipv4" | "ipv6" | "both", #Optional / Default is "ipv4" bootfile => $filename, #Optional / Default is empty bootserver => $ipv4addr, #Optional / Default is empty client_identifier_prepend_zero => "true" | "false", #Optional / Default is "false" comment => $string, #Optional / Default is empty ddns_domainname => $string, #Optional / Default is empty ddns_hostname => $string, #Optional / Default is empty deny_bootp => "true" | "false", #Optional / Default is "false" dhcp_client_identifier => $string, #Optional / Default is empty disable => "true" | "false", #Optional / Default is "false" enable_ddns => "true" | "false", #Optional / Default is "false" extattrs => { $string => $extattr, ... }, #Optional / Default is undefined extensible_attributes => { $string => $string | $num, $string => [ $string | $num, ... ], ... }, #Optional / Default is undefined force_roaming_hostname => "true" | "false", #Optional / Default is "false" ignore_dhcp_option_list_request => "true" | "false" | undef, #Optional / Default is "false" ipv6_ddns_domainname => $string, #Optional / Default is undefined ipv6_ddns_hostname => $string, #Optional / Default is empty ipv6_domain_name_servers => $string, #Optional / Default is undefined ipv6_domain_name => $string, #Optional / Default is undefined ipv6_duid => $duid, #Optional / Default is undefined ipv6_enable_ddns => "true" | "false" | undef, #Optional / Default is undefined ipv6_force_roaming_hostname => "true" | "false", #Optional / Default is "false" ipv6_match_option => "duid" | undef, #Optional / Default is undefined ipv6_options => [$option1, $option2,...], #Optional / Default is undefined ipv6_template => $string, #Optional / Default is undefined last_discovered => $string, #Optional / Default is empty mac => $mac_addr, #Optional / Default is empty match_client => "MAC" | "CLIENT_IDENTIFIER", #Optional / Default is "MAC" network_view => $NetworkView, #Optional / Default is "default" network view nextserver => $ipv4addr, #Optional / Default is empty options => [$option1, $option2, ...], #Optional / Default is undefined override_ddns_domainname => "true" | "false", #Optional / Default value is "false" override_ipv6_ddns_domainname => "true" | "false", #Optional / Default is "false" override_ipv6_domain_name_servers => "true" | "false", #Optional / Default is "false" override_ipv6_domain_name => "true" | "false", #Optional / Default is "false" override_ipv6_enable_ddns => "true" | "false", #Optional / Default is "false" override_ipv6_options => "true" | "false", #Optional / Default is "false" override_preferred_lifetime => "true" | "false", #Optional / Default is "false" override_valid_lifetime => "true" | "false", #Optional / Default is "false" preferred_lifetime => $num, #Optional / Default is 27000 pxe_lease_time => $time, #Optional / Default is empty template => $string, #Optional / Default is undefined valid_lifetime => $num, #Optional / Default is 43200 );
You cannot set both extattrs and extensible_attributes attributes at the same time.
This section describes all the methods in Infoblox::Session module that you can apply to a DHCP Roaming Host object.
Use this method to add a DHCP Roaming Host object to the Infoblox appliance. See Infoblox::Session->add() for parameters and return values.
#Construct a DHCP Roaming Host object my $roaming_host = Infoblox::DHCP::RoamingHost->new( "name" => "JohnSmith", "bootfile" => "bootfile", "bootserver" => "bootserver.com", "client_identifier_prepend_zero" => "true", "comment" => "add roaming host using uid", "ddns_domainname" => "ddns.domain.com", "ddns_hostname" => "ddns.host.domain.com", "deny_bootp" => "false", "dhcp_client_identifier" => "foo", "disable" => "false", "enable_ddns" => "false", "match_client" => "MAC", "network_view" => $nview, "nextserver" => "3.3.3.3", "options" => [ $option1, $option2, $option3, $option4, $option5, $option6 ], "pxe_lease_time" => "3600", );
#Submit for addition my $response = $session->add($roaming_host)
Use this method to retrieve all the matching objects from the Infoblox appliance. See Infoblox::Session->get() for parameters and return values.
Apply the following attributes to get a specific DHCP Roaming Host object:
name - Optional. The roaming host name. mac - Optional. MAC address of the roaming host. dhcp_client_identifier - Optional, DHCP option 61 client identifier. network_view - Optional. Network view in which the roaming host is located. By default, all network views are searched. extattrs - Optional. A hash reference containing extensible attributes. extensible_attributes - Optional. A hash reference containing extensible attributes.
#Get DHCP Roaming Host object through the session my @retrieved_objs = $session->get( object => "Infoblox::DHCP::RoamingHost", mac => "11:11:11:11:11.11", ); my @retrieved_objs = $session->get( object => "Infoblox::DHCP::RoamingHost", dhcp_client_identifier => "foo", ); my @retrieved_objs = $session->get( object => "Infoblox::DHCP::RoamingHost", name => "JohnSmith", network_view => "default", );
my @retrieved_objs = $session->get( object => "Infoblox::DHCP::RoamingHost", extensible_attributes => { 'Site' => 'Santa Clara' });
Use this method to modify a DHCP Roaming Host object in the Infoblox appliance. See Infoblox::Session->modify() for parameters and return values.
#Use method to modify the pxe_lease_time $roaming_host->pxe_lease_time("1234"); #Submit modification my $response = $session->modify( $roaming_host );
Use this method to remove a DHCP Roaming Host object from the Infoblox appliance. See Infoblox::Session->remove() for parameters and return values.
To remove a specific object, first use get()
or search()
to retrieve the specific DHCP Roaming Host, and then submit this object for removal.
#Get DHCP Roaming Host object through the session my @retrieved_objs = $session->get( object => "Infoblox::DHCP::RoamingHost", mac => "11:11:11:11:11:11", network_view => "default" ); #Find the desired object from the retrieved list. my $desired_roaming_host = $retrieved_objs[0]; #Submit for removal my $response = $session->remove( $desired_roaming_host );
Use this method to search for DHCP Roaming Host object and matching Host object with MAC address in the Infoblox appliance. See Infoblox::Session->search() for parameters and return values.
Apply the following attributes to search for a specific DHCP Roaming Host object:
name - Optional. The roaming host name (regular expression). mac - Optional. MAC address of the roaming host (regular expression). network_view - Optional. Network view in which the roaming host is located. By default, all network views are searched. 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.
# Search for all DHCP Roaming Host objects that are specified in the network "10.0.0.0/8" in the "default" network view. my @retrieved_objs = $session->search( object => "Infoblox::DHCP::RoamingHost", mac => "11:11:11:11:11.*", network_view => "default" );
# Search for all DHCP Roaming Host objects with "Santa Clara" for the "Site" extensible attribute my @retrieved_objs = $session->search( object => "Infoblox::DHCP::RoamingHost", extensible_attributes => { 'Site' => 'Santa Clara' } );
This section describes all the methods that you can use to set and retrieve the attribute values of a DHCP Roaming Host object.
Use this method to set or retrieve the address_type field.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The possible values for address_type are the following: ipv4 - Roaming hosts are set up for IPv4 addresses only. ipv6 - Roaming hosts are set up for IPv6 addresses only. both - Both types of addresses are set up.
The default value of the parameter is "ipv4".
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 = $roaminghost->address_type(); #Modify address_type $roaminghost->address_type("both");
Use this method to set or retrieve the bootfile value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The name of the file the client must download.
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 bootfile my $bootfile = $roaming_host->bootfile(); #Modify bootfile $roaming_host->bootfile("boot_file");
Use this method to set or retrieve the bootserver of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The name of the server on which the boot file is stored.
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 bootserver my $bootserver = $roaming_host->bootserver(); #Modify bootserver $roaming_host->bootserver("bootserver2.com");
Use this method to prepend "\000" to the dhcp-client-identifier of a roaming host.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
When you set the client_identifier_prepend_zero parameter to "true", it prefixes a 0 (zero) to the DHCP client identifier whenever option 61 is used to assign roaming hosts. The following is an excerpt from "man dhcp-options":
Please be aware that some DHCP clients, when configured with client identifiers that are ASCII text, will prepend a zero to the ASCII text. So you may need to write: option dhcp-client-identifier "\000foo"; rather than: option dhcp-client-identifier "foo";
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 client_identifier_prepend_zero my $client_identifier_prepend_zero = $roaming_host->client_identifier_prepend_zero(); #Modify dhcp_client_identifier $roaming_host->client_identifier_prepend_zero("true");
Use this method to set or retrieve the descriptive comment of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Desired comment in string format with a maximum of 256 bytes.
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 comment my $comment = $roaming_host->comment(); #Modify comment $roaming_host->comment("Modified DHCP Roaming Host object comment");
Use this method to set or retrieve the DDNS domain name value of a DHCP Roaming Host 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".
Specify the DDNS domain name.
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 DDNS domain name my $ddns_domainname = $roaming_host->ddns_domainname(); #Modify the DDNS domain name $roaming_host->ddns_domainname("ddns.domain.com");
Use this method to set or retrieve the DDNS host name value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify the DDNS host name.
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 DDNS host name my $ddns_hostname = $roaming_host->ddns_hostname(); #Modify the DDNS host name $roaming_host->ddns_hostname("host.ddns.domain.com");
Use this method to set or retrieve the deny_bootp flag of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify "true" to set the deny_bootp 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 deny_bootp my $deny_bootp = $roaming_host->deny_bootp(); #Modify deny_bootp $roaming_host->deny_bootp("true");
Use this method to set or retrieve the dhcp-client-identifier value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Use the dhcp_client_identifier or uid to assign roaming hosts if the DHCP clients send option 61. A DHCP client identifier can be a string or a MAC address. Set the "match_client" field to "CLIENT_IDENTIFIER" for roaming hosts to use the dhcp_client_identifier instead of the mac_address.
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 dhcp_client_identifier my $uid = $roaming_host->dhcp_client_identifier(); #Modify dhcp_client_identifier $roaming_host->dhcp_client_identifier("foo"); or $roaming_host->dhcp_client_identifier("1:11::11::11::11::11::12");
Use this method to set or retrieve the disable flag of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify "true" to set the disable 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 disable my $disable = $roaming_host->disable(); #Modify disable $roaming_host->disable("true");
Use this method to retrieve the discovered name of a DHCP Roaming Host object.
none
The method returns the discovered name.
#Get discovered_name my $discovered_name = $roaming_host->discovered_name();
Use this method to retrieve the discoverer of a DHCP Roaming Host object.
none
The method returns the discoverer value.
#Get discoverer my $discoverer = $roaming_host->discoverer();
Use this method to set or retrieve the enable_ddns flag of a DHCP Roaming Host object.
If enable_ddns value is specified as "true", then the A and PTR records corresponding to the Roaming Host object will be placed on the DNS server.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify "true" to set the enable_ddns 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 enable_ddns my $enable_ddns = $roaming_host->enable_ddns(); #Modify enable_ddns $roaming_host->enable_ddns("true");
Use this method to set or retrieve the extensible attributes associated with a DHCP Roaming Host object.
Valid value is a hash reference containing the names of extensible attributes and their associated values ( Infoblox::Grid::Extattr objects ).
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 extattrs my $ref_extattrs = $roaming_host->extattrs(); #Modify extattrs $roaming_host->extattrs({ 'Site' => $extattr1, 'Administrator' => $extattr2 });
Use this method to set or retrieve the extensible attributes associated with a DHCP Roaming Host object
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
For valid values for extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Extensible Attribute Values.
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 extensible attributes my $ref_extensible_attributes = $roaming_host->extensible_attributes(); #Modify extensible attributes $roaming_host->extensible_attributes({ 'Site' => 'Santa Clara', 'Administrator' => [ 'Peter', 'Tom' ] });
Use this method to retrieve the date and time that the DHCP Roaming Host object was first discovered.
none
The method returns the date and time that the DHCP Roaming Host object was first discovered.
#Get first_discovered my $first_discovered = $roaming_host->first_discovered();
Use this method to set or retrieve the force_roaming_hostname flag of a DHCP Roaming Host object.
If the force_roaming_hostname value is "true", then the roaming host name is used as the ddns_hostname.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify "true" to set the force_roaming_hostname 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 force_roaming_hostname my $force_roaming_hostname = $roaming_host->force_roaming_hostname(); #Modify force_roaming_hostname $roaming_host->force_roaming_hostname("true");
Use this method to set or retrieve the ignore_dhcp_option_list_request flag of a DHCP roaming host object. If this flag is set to false all the defined DHCP options will be returned to the client.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify "true" to set the ignore_dhcp_option_list_request flag or "false" to deactivate/unset it. The default value is false which indicates that this attribute inherit the member level setting..
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 ignore_dhcp_option_list_request my $ignore_dhcp_option_list_request = $roaming_host->ignore_dhcp_option_list_request(); # Un-override ignore_dhcp_option_list_request $roaming_host->ignore_dhcp_option_list_request(undef); # Modify ignore_dhcp_option_list_request $roaming_host->ignore_dhcp_option_list_request("true");
Use this method to retrieve the ipv6_client_hostname of a DHCP Roaming Host object. This method specifies the host name that the DHCP client sends to the Infoblox appliance using DHCP option 12. The method is read-only.
N/A
The method returns the attribute value.
#Get ipv6_client_hostname my $ipv6_client_hostname = $roaming_host->ipv6_client_hostname();
Use this method to set or retrieve the IPv6 DDNS domain name value for the roaming host.
Setting this method to a defined value implicitly sets the override_ipv6_ddns_domainname method to "true". Setting the parameter to undefined causes the appliance to use the upper-level default and automatically resets the override_ipv6_ddns_domainname attribute to "false".
Note that when ipv6_ddns_domainname is set to a defined value and override_ipv6_ddns_domainname is set to "false", the last operation takes precedence. Thus the sequence $object->ipv6_ddns_domainname("testdomain"); $object->override_ipv6_ddns_domainname("false"); will set override_ipv6_ddns_domainname to "false", and the sequence $object->override_ipv6_ddns_domainname("false"); $object->ipv6_ddns_domainname("testdomain"); will result in override_ipv6_ddns_domainname="true".
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The DDNS domain name in FQDN (Fully Qualified Domain Name) 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 ipv6_ddns_domainname my $ipv6_ddns_domainname = $roaming_host->ipv6_ddns_domainname(); #Modify ipv6_ddns_domainname $roaming_host->ipv6_ddns_domainname("domain.com");
Use this method to set or retrieve the IPv6 DDNS host name value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify the IPv6 DDNS host name.
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 IPv6 DDNS host name my $ipv6_ddns_hostname = $roaming_host->ipv6_ddns_hostname(); #Modify the IPv6 DDNS host name $roaming_host->ipv6_ddns_hostname("host.ddns.domain.com");
Use this method to set or retrieve the ipv6_domain_name value of a DHCP Roaming Host 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_ipv6_domain_name method to "true". Setting the parameter to undefined causes the appliance to use the upper level default and automatically resets the override_ipv6_domain_name attribute to "false".
Note that when ipv6_domain_name is set to a defined value and override_ipv6_domain_name is set to "false", the last operation takes precedence. Thus the sequence $object->ipv6_domain_name("testdomain"); $object->override_ipv6_domain_name("false"); will set override_ipv6_domain_name to "false", and the sequence $object->override_ipv6_domain_name("false"); $object->ipv6_domain_name("testdomain"); will result in override_ipv6_domain_name="true".
The name, in string format, of the client's domain for resolving names in DNS.
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 ipv6_domain_name my $ipv6_domain_name = $roaming_host->ipv6_domain_name(); #Modify ipv6_domain_name $roaming_host->ipv6_domain_name("test_domain.com");
Use this method to set or retrieve the ipv6_domain_name_servers value of a DHCP Roaming Host 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_ipv6_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_ipv6_domain_name_servers attribute to "false".
Note that when ipv6_domain_name_servers is set to a defined value and override_ipv6_domain_name_servers is set to "false", the last operation takes precedence. Thus the sequence $object->ipv6_domain_name_servers("2001::1,2001::2"); $object->override_ipv6_domain_name_servers("false"); will set override_ipv6_domain_name_servers to "false", and the sequence $object->override_ipv6_domain_name_servers("false"); $object->ipv6_domain_name_servers("2001::1,2001::2"); will result in override_ipv6_domain_name_servers="true".
The IPv6 addresses of the DNS servers.
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 ipv6_domain_name_servers my $ipv6_domain_name_servers = $roaming_host->ipv6_domain_name_servers(); #Modify ipv6_domain_name_servers $roaming_host->ipv6_domain_name_servers("2001::1,2001::2");
Use this method to set or retrieve the DHCPv6 Unique Identifier (DUID) of the Roaming Host 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 ipv6_duid my $ipv6_duid = $roaming_host->ipv6_duid(); #Modify ipv6_duid $roaming_host->ipv6_duid("1c2edfaa");
Use this method to set or retrieve the ipv6_enable_ddns flag for the roaming host. Set this flag to enable DHCPv6 dynamic DNS updates.
Setting this method to a defined value implicitly sets the override_ipv6_enable_ddns method to "true". Setting the parameter to undefined causes the appliance to use the upper-level default and automatically resets the override_ipv6_enable_ddns attribute to "false".
Note that when ipv6_enable_ddns is set to a defined value and override_ipv6_enable_ddns is set to "false", the last operation takes precedence. Thus the sequence $object->ipv6_enable_ddns("false"); $object->override_ipv6_enable_ddns("false"); will set override_ipv6_enable_ddns to "false", and the sequence $object->override_ipv6_enable_ddns("false"); $object->ipv6_enable_ddns("false"); will result in override_ipv6_enable_ddns="true".
Specify "true" to enable this feature 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 ipv6_enable_ddns my $ipv6_enable_ddns = $roaming_host->ipv6_enable_ddns(); #Modify ipv6_enable_ddns $roaming_host->ipv6_enable_ddns("true");
Use this method to set or retrieve the ipv6_force_roaming_hostname flag of a DHCP Roaming Host object.
If the ipv6_force_roaming_hostname value is "true", then the roaming host name is used as the ddns_hostname. This flag applies to IPv6 roaming hosts.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Specify "true" to set the ipv6_force_roaming_hostname 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 ipv6_force_roaming_hostname my $ipv6_force_roaming_hostname = $roaming_host->ipv6_force_roaming_hostname(); #Modify ipv6_force_roaming_hostname $roaming_host->ipv6_force_roaming_hostname("true");
Use this method to set or retrieve the ipv6_match_option value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
This field specifies the identification method for an IPv6 or mixed IPv4/IPv6 roaming host. Currently, the only supported value for this field is "duid", which corresponds to identification by DHCPv6 unique ID. The default value of this parameter is undefined.
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 ipv6_match_option my $ipv6_match_option = $roaming_host->ipv6_match_option(); #Modify ipv6_match_option $roaming_host->ipv6_match_option("duid");
Use this method to set or retrieve the IPv6 options of a DHCP Roaming Host object.
Setting this method to a defined value implicitly sets the override_ipv6_options method to "true". Setting the parameter to undefined causes the appliance to use the upper-level default and automatically resets the override_ipv6_options attribute to "false".
Note that when ipv6_options is set to a defined value and override_ipv6_options is set to "false", the last operation takes precedence. Thus the sequence $object->ipv6_options([$option1]); $object->override_ipv6_options("false"); will set override_ipv6_options to "false", and the sequence $object->override_ipv6_options("false"); $object->ipv6_options([$option1]); will result in override_ipv6_options="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 ipv6_options my $ipv6_options = $roaming_host->ipv6_options(); #Modify ipv6_options my $option1 = Infoblox::DHCP::Option->new( name => "dhcp6.info-refresh-time", value => "1000" ); $roaming_host->ipv6_options([$option1]);
Use this method to set or retrieve the fixed address ipv6_template name for a DHCP Roaming Host object.
Specify the IPv6 fixed address template that is used to create the DHCP roaming host.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The IPv6 fixed address template name in sting format.
If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
The ipv6_template parameter can be used only to add a new DHCP roaming host. It cannot be used to modify an object or return an object during a get operation.
If you did not specify a parameter, the method returns the attribute value.
#Get ipv6_template my $ipv6_template = $roaming_host->ipv6_template(); #Modify ipv6_template $roaming_host->ipv6_template("Template_Name");
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 = $roaming_host->last_discovered();
Use this method to set or retrieve the MAC address value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
MAC Address of the DHCP roaming host object. Format for the hexadecimal strings for MAC addresses and vendor prefixes with colons or dashes. Both of the following formats are acceptable: 11:11:11:11:11:11 and 11-11-11-11-11-11.
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 mac my $mac = $roaming_host->mac(); #Modify mac $roaming_host->mac("11::11::11::11::11::12");
Use this method to set or retrieve the match_client value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
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 = $roaming_host->match_client(); #Modify match_client $roaming_host->match_client("CLIENT_IDENTIFIER");
Use this method to set or retrieve the roaming host name associated with the DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
NOTE: To enable using roaming hosts, you must allow roaming hosts at the grid level by setting $griddhcp->enable_roaming_hosts("true");
Desired roaming host name in string format with a maximum of 64 bytes.
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 roaming host name my $roaming_host_name = $roaming_host->name(); #Modify roaming host name $roaming_host->name("JimmyJaz");
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 = $roaming_host->netbios();
Use this method to retrieve the description of the network device that is connected to the DHCP Roaming Host object.
none
The method returns the network device description.
#Get network_component_description my $network_component_description = $roaming_host->network_component_description();
Use this method to retrieve the IP address of the network device that is connected to the DHCP Roaming Host object.
none
The method returns the IP address of the network device.
#Get network_component_ip my $network_component_ip = $roaming_host->network_component_ip();
Use this method to retrieve the name of the network device that is connected to the DHCP Roaming Host object.
none
The method returns the network device name.
#Get network_component_name my $network_component_name = $roaming_host->network_component_name();
Use this method to retrieve the description of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the description of the port on the network device.
#Get network_component_port_description my $network_component_port_description = $roaming_host->network_component_port_description();
Use this method to retrieve the name of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the name of the port on the network device.
#Get network_component_port_name my $network_component_port_name = $roaming_host->network_component_port_name();
Use this method to retrieve the number of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the network device port number.
#Get network_component_port_number my $network_component_port_number = $roaming_host->network_component_port_number();
Use this method to retrieve the type of the network device that is connected to DHCP Roaming Host object.
none
The method returns the network device type.
#Get network_component_type my $network_component_type = $roaming_host->network_component_type();
Use this method to set or retrieve the network view of the DHCP roaming host
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
The default value is the "default" network view, which means the roaming host is in the default network view.
Valid value is a defined Infoblox::DHCP::View object. The default network view value is the system-defined default network view 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 network view my $nview = $roaming_host->network_view(); #Modify network view, with an Infoblox::DHCP::View object $roaming_host->network_view($nview);
Use this method to set or retrieve the nextserver value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
IP address of the boot file server on which the boot file is stored.
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 nextserver my $nextserver = $roaming_host->nextserver(); #Modify nextserver $roaming_host->nextserver("3.3.3.4");
Use this method to set or retrieve the options of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
See Infoblox::DHCP::Option for parameters and methods available for this object.
Options describe network configuration settings and various services available on the network. These options occur as variable-length fields at the end of DHCP messages.
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 = $roaming_host->options(); #Modify options $roaming_host->options([$option1, $option2]);
Use this method to retrieve the operating system associated with this roaming host.
The method returns the attribute value.
#Get os my $os = $roaming_host->os();
The override_ddns_domainname attribute controls whether the ddns_domainname value in the DHCP Roaming Host 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.
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".
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.
#Getting override_ddns_domainname my $override_ddns_domainname=$roaming_host->override_ddns_domainname( ); #Modifying override_ddns_domainname $roaming_host->override_ddns_domainname("true");
The override_ipv6_ddns_domainname attribute controls whether the ddns_domainname value in the DHCP Roaming Host object is used, instead of the upper-level default.
The override_ipv6_ddns_domainname attribute can be specified explicitly. It is also set implicitly when ipv6_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.
Set the parameter to "true" to override the upper-level setting for ddns_domainname. Set the parameter to "false" to inherit the upper-level setting for ipv6_ddns_domainname.
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.
#Getting override_ipv6_ddns_domainname my $override_ipv6_ddns_domainname=$roaming_host->override_ipv6_ddns_domainname( ); #Modifying override_ipv6_ddns_domainname $roaming_host->override_ipv6_ddns_domainname("true");
Use this method to set or retrieve the override_ipv6_domain_name value of a DHCP Roaming Host object.
The override_ipv6_domain_name attribute can be specified explicitly. It is also set implicitly when ipv6_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 ipv6_domain_name. Set the parameter to "false" to inherit the upper-level setting for ipv6_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_ipv6_domain_name my $override_ipv6_domain_name = $roaming_host->override_ipv6_domain_name(); #Modify override_ipv6_domain_name $roaming_host->override_ipv6_domain_name("test_domain.com");
Use this method to set or retrieve the override_ipv6_domain_name_servers value of a DHCP Roaming Host object.
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 ipv6_domain_name_servers. Set the parameter to "false" to inherit the upper-level setting for ipv6_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_ipv6_domain_name_servers my $override_ipv6_domain_name_servers = $roaming_host->override_ipv6_domain_name_servers(); #Modify override_ipv6_domain_name_servers $roaming_host->override_ipv6_domain_name_servers("true");
The override_ipv6_enable_ddns attribute controls whether the ipv6_enable_ddns value in the DHCP Roaming Host object is used, instead of the upper-level default.
The override_ipv6_enable_ddns attribute can be specified explicitly. It is also set implicitly when ipv6_enable_ddns 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 ipv6_enable_ddns. Set the parameter to "false" to inherit the upper-level setting for ipv6_enable_ddns.
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.
#Getting override_ipv6_enable_ddns my $override_ipv6_enable_ddns=$roaming_host->override_ipv6_enable_ddns( ); #Modifying override_ipv6_enable_ddns $roaming_host->override_ipv6_enable_ddns("true");
The override_ipv6_options attribute controls whether the ipv6_options value in the DHCP Roaming Host object is used, instead of the upper-level default.
The override_ipv6_options attribute can be specified explicitly. It is also set implicitly when ipv6_options 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 ipv6_options. Set the parameter to "false" to inherit the upper-level setting for ipv6_options.
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.
#Getting override_ipv6_options my $override_ipv6_options=$roaming_host->override_ipv6_options( ); #Modifying override_ipv6_options $roaming_host->override_ipv6_options("true");
The override_preferred_lifetime attribute controls whether the preferred_lifetime value in the DHCP Roaming Host object 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 grid-level setting for preferred_lifetime. Set the parameter to "false" to inherit the upper-level setting for preferred_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.
#Getting override_preferred_lifetime my $override_preferred_lifetime=$roaming_host->override_preferred_lifetime( ); #Modifying override_preferred_lifetime $roaming_host->override_preferred_lifetime("true");
The override_valid_lifetime attribute controls whether the valid_lifetime value in the DHCP Roaming Host object 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 grid-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.
#Getting override_valid_lifetime my $override_valid_lifetime=$roaming_host->override_valid_lifetime( ); #Modifying override_valid_lifetime $roaming_host->override_valid_lifetime("true");
Use this method to retrieve the duplex setting of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the port duplex setting. Returned values, if any, are one of the following:
#Get port_duplex my $port_duplex = $roaming_host->port_duplex();
Use this method to retrieve the link status of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the network device port link status. Returned values, if any, are one of the following: Connected Not Connected Unknown
#Get port_link_status my $port_link_status = $roaming_host->port_link_status();
Use this method to retrieve the speed of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the network device port speed. Returned values, if any, are one of the following:
#Get port_speed my $port_speed = $roaming_host->port_speed();
Use this method to retrieve the status of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the network device port status. Returned values, if any, are one of the following:
#Get port_status my $port_status = $roaming_host->port_status();
Use this method to retrieve the VLAN description of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the VLAN description of the network device port.
#Get port_vlan_description my $port_vlan_description = $roaming_host->port_vlan_description();
Use this method to retrieve the VLAN name of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the network device port VLAN name.
#Get port_vlan_name my $port_vlan_name = $roaming_host->port_vlan_name();
Use this method to retrieve the VLAN number of the network device port that is connected to the DHCP Roaming Host object.
none
The method returns the port VLAN number.
#Get port_vlan_number my $port_vlan_number = $roaming_host->port_vlan_number();
Use this method to set or retrieve the preferred lifetime of the roaming host.
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 result in override_preferred_lifetime="true".
Preferred lifetime value in seconds. The default value is 27000. Note that the preferred lifetime cannot be greater than the valid lifetime.
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 = $roaming_host->preferred_lifetime(); #Modify preferred_lifetime $roaming_host->preferred_lifetime(12345);
Use this method to set or retrieve the pxe_lease_time value of a DHCP Roaming Host object.
Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.
Enter appropriate values in the Days, Hours, Mins and Secs fields. Users can specify the duration of time it takes a host to connect to a boot server, such as a TFTP server, and download the file it needs to boot.
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 pxe_lease_time my $pxe_lease_time = $roaming_host->pxe_lease_time(); #Modify pxe_lease_time $roaming_host->pxe_lease_time("369");
Use this method to set the fixed address template name for a DHCP Roaming Host object.
Template is the name of a DHCP Fixed Address template which will be used to create the DHCP Roaming Host.
The valid name in string format.
The method returns true when the modification succeeds, and returns false when the operation fails.
The template parameter can be used to only add a new DHCP Roaming Host and cannot be used during object modify or returned during object get.
#Add RoamingHost with template my $roaming_host = Infoblox::DHCP::RoamingHost->new( "name" => "JohnSmith", "template" => "Template_Name", ); #Submit for addition my $response = $session->add($roaming_host)
Use this method to set or retrieve the preferred lifetime of the roaming host.
Setting this method to a defined value implicitly sets the override_valid_lifetime method to "true". Setting the parameter to undefined causes the appliance to use the upper-level default and automatically resets the override_valid_lifetime attribute to "false".
Note that when valid_lifetime is set to a defined value and override_valid_lifetime is set to "false", the last operation takes precedence. Thus the sequence $object->valid_lifetime(20000); $object->override_valid_lifetime("false"); will set override_valid_lifetime to "false", and the sequence $object->override_valid_lifetime("false"); $object->valid_lifetime(20000); will result in override_valid_lifetime="true".
Valid lifetime value 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 = $roaming_host->valid_lifetime(); #Modify valid_lifetime $roaming_host->valid_lifetime(12345);
The following sample code demonstrates the different functions that can be applied to an object such as add, search, modify, and remove. This sample also includes error handling for the operations.
#Preparation prior to a DHCP Fixed Address object insertion
#PROGRAM STARTS: Include all the modules that will be used use strict; use Infoblox;
#Create a session to the Infoblox appliance
my $session = Infoblox::Session->new( master => "192.168.1.2", #appliance host ip username => "admin", #appliance user login password => "infoblox" #appliance password );
unless ($session) { die("Construct session failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "Session created successfully\n";
#Modify Grid DHCP object to enable support of the Roaming Hosts
my $grid_dhcp=$session->get( object => "Infoblox::Grid::DHCP", name=>"Infoblox" ); unless ($grid_dhcp) { die("Get Grid DHCP object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Get Grid DHCP object found at least 1 matching entry\n";
my $save_grid_rh_status=$grid_dhcp->enable_roaming_hosts(); $grid_dhcp->enable_roaming_hosts("true"); unless($session->modify($grid_dhcp)) { die("Modifying Grid DHCP object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Roaming Hosts enabled at Grid level successfuly\n";
#Adding DHCP options my $option1 = Infoblox::DHCP::Option->new( "name" => "lease-time", "value" => "50" );
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( "type" => "routers", "ipv4addrs" => ["10.0.0.1","10.0.0.255"], );
unless($option2) { die("Construct option2 object failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "option2 object created successfully\n";
#Create a DHCP Roaming Host object
#Create a DHCP Roaming Host object my $roaming_host = Infoblox::DHCP::RoamingHost->new( "name" => "JohnSmith", "mac" => "00:00:00:11:11:11", "comment" => "add roaming host", "enable_ddns" => "true", "pxe_lease_time" => "3600", "bootserver" => "someserver.com", "nextserver" => "3.3.3.3", "bootfile" => "bootfile.com", "options" => [ $option1 , $option2 ], ); unless($roaming_host) { die("Construct roaming host failed: ", Infoblox::status_code() . ":" . Infoblox::status_detail()); } print "DHCP Roaming Host object created successfully\n";
#Verify if the DHCP Roaming Host exists in the Infoblox appliance my $object = $session->get(object => "Infoblox::DHCP::RoamingHost", mac => "00:00:00:11:11:11"); unless ($object) { print "roaming host does not exist on server, safe to add the roaming host\n"; $session->add($roaming_host) or die("Add roaming host failed: ", $session->status_code() . ":" . $session->status_detail()); } print "DHCP Roaming Host added successfully\n";
#Search for a specific DHCP Roaming Host object
#Search for all DHCP Roaming Host objects with a given mac address my @retrieved_objs = $session->search( object => "Infoblox::DHCP::RoamingHost", mac => "00:00:00:11:11.*", ); my $object = $retrieved_objs[0];
unless ($object) { die("Search for Roaming Host object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Search Roaming Host object found at least 1 matching entry\n";
#Get and modify a DHCP Roaming Host object
#Get DHCP Roaming Host object through the session my @retrieved_objs = $session->get( object => "Infoblox::DHCP::RoamingHost", mac => "00:00:00:11:11:11", ); my $object = $retrieved_objs[0]; unless ($object) { die("Get Roaming Host object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Get Roaming Host object found at least 1 matching entry\n";
#Modify one of the attributes of the obtained Roaming Host object $object->pxe_lease_time("1234");
#Apply the changes $session->modify($object) or die("Modify Roaming Host object failed: ", $session->status_code() . ":" . $session->status_detail()); print "Roaming Host object modified successfully \n";
#Remove a Roaming Host object
#Get Roaming Host object through the session my @retrieved_objs = $session->get( object => "Infoblox::DHCP::RoamingHost", mac => "00:00:00:11:11:11", ); my $object = $retrieved_objs[0]; unless ($object) { die("Get Roaming Host object failed: ", $session->status_code() . ":" . $session->status_detail()); } print "Get Roaming Host object found at least 1 matching entry\n";
#Submit the object for removal $session->remove($object) or die("Remove Roaming Host object failed: ", $session->status_code() . ":" . $session->status_detail()); print "Roaming Host object removed successfully \n";
#Restore Grid DHCP $grid_dhcp->enable_roaming_hosts($save_grid_rh_status); print "Grid DHCP setting restored successfully\n" if($session->modify($grid_dhcp));
####PROGRAM ENDS####
Infoblox Inc. http://www.infoblox.com/
Infoblox::Session->add(), Infoblox::Session->get(), Infoblox::Session->modify(), Infoblox::Session->remove(), Infoblox::Session->search(), Infoblox::Session, Infoblox::Grid::MSServer::AdUser::Data
Copyright (c) 2017 Infoblox Inc.