Infoblox::DHCP::FixedAddr - DHCP Fixed Address object.


NAME

Infoblox::DHCP::FixedAddr - DHCP Fixed Address object.


DESCRIPTION

A Fixed Address is a specific IP address that a DHCP server always assigns when a lease request comes from a particular MAC address of the client.


CONSTRUCTOR

 my $fixed_addr = Infoblox::DHCP::FixedAddr -> new(
       ipv4addr                        => $ipv4addr,                   #Required
       agent_circuit_id                => $circuit_id,                 #Optional / Default is undefined
       agent_remote_id                 => $remote_id,                  #Optional / Default is undefined
       always_update_dns               => "true" | "false",            #Optional / Default is "false"
       bootfile                        => $filename | undef,           #Optional / Default is undefined
       bootserver                      => $ipv4addr | $fqdn | undef,   #Optional / Default is undefined
       client_identifier_prepend_zero  => "true" | "false",            #Optional / Default is "false"
       comment                         => $string,                     #Optional / Default is empty
       configure_for_dhcp              => "true" | "false",            #Optional / Default is "false"
                                                                       # When both the IP address and MAC address are present, the default value is "true"
                                                                       # Applicable only when adding this fixed address to a host
       ddns_domainname                 => $string,                     #Optional / Default is empty
       ddns_hostname                   => $string,                     #Optional / Default is empty
       deny_bootp                      => "true" | "false" | undef,    #Optional / Default is undefined
       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
       ignore_dhcp_option_list_request => "true" | "false" | undef,    #Optional / Default is "false"
       last_discovered                 => $string,                     #Optional / Default is empty
       mac                             => $mac_addr,                   #Optional / Default is empty
       match_client                    => $string,                     #Optional / Default is "MAC"
                                                                       #Possible values are:
                                                                       # "MAC","CLIENT_IDENTIFIER","RESERVED",
                                                                       # "CIRCUIT_ID", "REMOTE_ID"
       member                          => $msmember,                   #Optional
       ms_options                      => [$msopt1, $msopt2, ...]      #Optional / Default is empty
       name                            => $name,                       #Optional
       network                         => $network,                    #Optional
       network_view                    => $NetworkView,                #Optional / Default is "default" network view
       nextserver                      => $ipv4addr | $fqdn | undef,   #Optional / Default is undefined
       options                         => [$option1, $option2, ...]    #Optional / Default is empty
       override_ddns_domainname        => "true" | "false",            #Optional / Default value is "false"
       pxe_lease_time                  => $time,                       #Optional / Default is empty
       template                        => $string,                     #Optional / Default is undefined
       cli_credentials                 => [$cli1, ...],                #Optional
       override_cli_credentials        => "true" | "false",            #Optional / Default is "false"
       reserved_interface              => $interface,                  #Optional
       device_type                     => $string,                     #Optional
       device_vendor                   => $string,                     #Optional
       device_location                 => $string,                     #Optional
       device_description              => $string,                     #Optional
       allow_telnet                    => "true" | "false",            #Optional / Default is "false"
       logic_filters                   => [ $filter_name | $filter_obj, ...], # Optional / Default is undefined
       override_logic_filters          => "true' | 'false",                   # Optional / Default value is "false"
 );

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


SESSION METHODS

This section describes all the methods in Infoblox::Session module that you can apply to a DHCP Fixed Address object.

Infoblox::Session->add( )

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

Example
 #Construct a DHCP Fixed Address object
 my $fixed_addr = Infoblox::DHCP::FixedAddr->new(
        "ipv4addr"                         => "10.0.0.5",
        "bootfile"                         => "bootfile",
        "bootserver"                       => "bootserver.com",
        "client_identifier_prepend_zero"   => "true",
        "comment"                          => "add fixed address 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"                          => "10.0.0.0/8",
        "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($fixed_addr)

Infoblox::Session->get( )

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

'discover_now_status' will not be returned by default, use 'return_methods' to request it if needed.

Key References
 Apply the following attributes to get a specific DHCP Fixed Address object:
  ipv4addr                - Optional. IPV4 address of the fixed address.
  mac                     - Optional. MAC address of the fixed address.
  dhcp_client_identifier  - Optional, DHCP option 61 client identifier.
  network                 - Optional. Network address of the fixed address.
  network_view            - Optional. Network view in which the fixed address 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.
  v_cluster               - Optional. Discovered VMware cluster name.
  v_datacenter            - Optional. Discovered VMware datacenter name.
  v_host                  - Optional. Discovered VMware server name.
  v_name                  - Optional. Discovered VMware host or virtual machine name.
  v_netadapter            - Optional. Discovered VMware physical network adapter name.
  v_switch                - Optional. Discovered VMware virtual switch name.
  v_type                  - Optional. Discovered VMware entity type (possible values: "VirtualMachine", "HostSystem", "VirtualCenter").
Examples
 #Get DHCP Fixed Address object through the session
 my @retrieved_objs = $session->get(
     object => "Infoblox::DHCP::FixedAddr",
     mac    => "11:11:11:11:11.11",
 );
 my @retrieved_objs = $session->get(
     object => "Infoblox::DHCP::FixedAddr",
     dhcp_client_identifier => "foo",
 );
 my @retrieved_objs = $session->get(
     object       => "Infoblox::DHCP::FixedAddr",
     ipv4addr     => "10.0.0.4",
     network_view => "default",
 );
 my @retrieved_objs = $session->get(
    object                => "Infoblox::DHCP::FixedAddr",
    extensible_attributes => { 'Site' => 'Santa Clara' });
  # get FixedAddr by v_type:
  my @retrieved_objs = $session->get(
    object    => 'Infoblox::DHCP::FixedAddr',
    v_type    => 'VirtualMachine');

Infoblox::Session->modify( )

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

Example
 #Use method to modify the pxe_lease_time
 $fixed_address->pxe_lease_time("1234");
 #Submit modification
 my $response = $session->modify( $fixed_address );

Infoblox::Session->remove( )

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

Example
 #Get DHCP Fixed Address object through the session
 my @retrieved_objs = $session->get(
     object       => "Infoblox::DHCP::FixedAddr",
     mac          => "11:11:11:11:11:11",
     network_view => "default"
 );
 #Find the desired object from the retrieved list.
 my $desired_fixed_addr = $retrieved_objs[0];
 #Submit for removal
 my $response = $session->remove( $desired_fixed_addr );

Infoblox::Session->search( )

Use this method to search for DHCP Fixed Address object and matching Host object with MAC address in the Infoblox appliance (see below). See Infoblox::Session->search() for parameters and return values.

Note that if the Infoblox library is invoked with the :hostaddress option, only DHCP Fixed Address objects are searched.

'discover_now_status' will not be returned by default, use 'return_methods' to request it if needed.

Key References
 Apply the following attributes to search for a specific DHCP Fixed Address object:
  name          - Optional. Name of the fixed address. If name is passed it implies no_hostaddresses
  ipv4addr      - Optional. IPV4 address of the fixed address (regular expression).
  mac           - Optional. MAC address of the fixed address (regular expression).
  network       - Optional. Network address of the fixed address.
  network_view  - Optional. Network view in which the fixed address 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.
  v_cluster     - Optional. Discovered VMware cluster name (regular expression).
  v_datacenter  - Optional. Discovered VMware datacenter name (regular expression).
  v_host        - Optional. Discovered VMware server name (regular expression).
  v_name        - Optional. Discovered VMware host or virtual machine name (regular expression).
  v_netadapter  - Optional. Discovered VMware physical network adapter name (regular expression).
  v_switch      - Optional. Discovered VMware virtual switch name (regular expression).
  v_type        - Optional. Discovered VMware entity type (possible values: "VirtualMachine", "HostSystem", "VirtualCenter").
  no_hostaddresses - Optional. If specified and set to "true", only Fixed Address objects will be returned by the search.

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

Examples
 # Search for all DHCP Fixed Address 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::FixedAddr",
     mac          => "11:11:11:11:11.*",
     network      => "10.0.0.0/8",
     network_view => "default"
 );
 # Search for all DHCP Fixed Address objects with "Santa Clara" for the "Site" extensible attribute
 my @retrieved_objs = $session->search(
     object                => "Infoblox::DHCP::FixedAddr",
     extensible_attributes => { 'Site' => 'Santa Clara' }
 );
 # search FixedAddr by v_datacenter:
 my @retrieved_objs = $session->search(
    object                 => 'Infoblox::DHCP::FixedAddr',
    v_datacenter => 'test.*');


METHODS

This section describes all the methods that you can use to set and retrieve the attribute values of a DHCP Fixed Address object.

allow_telnet( )

Use this method to set or retrieve the flag that enables copying SSH credential to TELNET.

Parameter

Specify 'true' to copy SSH credential to TELNET or 'false' to disable it. The default value is 'false'.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 # Get attribute value
 my $value = $fixed_addr->allow_telnet();
 # Modify attribute value
 $fixed_addr->allow_telnet('true');

bootfile( )

Use this method to set or retrieve the bootfile value of a DHCP Fixed Address object.

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

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

Parameter

The name of the file that the client must download. The default value is undefined.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get bootfile
 my $bootfile = $fixed_addr->bootfile();
 #Modify bootfile
 $fixed_addr->bootfile("boot_file");
 #Un-override bootfile
 $fixed_addr->bootfile(undef);

agent_circuit_id( )

Use this method to set or retrieve the agent circuit ID of a DHCP Fixed Address object.

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

Parameter

Use the agent_circuit_id to assign fixed addresses to DHCP clients from whom the member DHCP server receives DHCPDISCOVER and DHCPREQUEST messages that include option 82. To enable the member DHCP server to match the agent circuit ID, set the "match_client" field to "CIRCUIT_ID".

Returns

If you specified a parameter, the method returns true when the modification succeeds and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get agent_circuit_id
 my $uid = $fixed_addr->agent_circuit_id();
 #Modify agent_circuit_id
 $fixed_addr->agent_circuit_id("foo");

agent_remote_id( )

Use this method to set or retrieve the agent remote ID of a DHCP Fixed Address object.

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

Parameter

Use the agent_remote_id to assign fixed addresses to DHCP clients from whom the member DHCP server receives DHCPDISCOVER and DHCPREQUEST messages that include option 82. To enable the member DHCP server to match the agent remote ID, set the "match_client" field to "REMOTE_ID".

Returns

If you specified a parameter, the method returns true when the modification succeeds and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get agent_remote_id
 my $uid = $fixed_addr->agent_remote_id();
 #Modify agent_remote_id
 $fixed_addr->agent_remote_id("foo");

always_update_dns( )

Use this method to set or retrieve the always_update_dns flag of a DHCP Fixed Address object.

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

This flag only applies if the fixed address is associated with a Microsoft (r) server. If it is set to "true", the DHCP server will always update DNS, regardless of the requests from the DHCP clients. If this flag is set to false, clients will be allowed to update DNS when they request it.

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get always_update_dns
 my $always_update_dns = $fixed_addr->always_update_dns();
 #Modify always_update_dns
 $fixed_addr->always_update_dns("false");

bootserver( )

Use this method to set or retrieve the bootserver of a DHCP Fixed Address object.

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

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

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get bootserver
 my $bootserver = $fixed_addr->bootserver();
 #Modify bootserver
 $fixed_addr->bootserver("bootserver2.com");
 #Un-override bootserver
 $fixed_addr->bootserver(undef);

client_identifier_prepend_zero( )

Use this method prepend "\000" to the dhcp-client-identifier of a fixed address.

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

Parameter

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 fixed addresses. 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".
Returns

If you specified a parameter, the method returns true when the modification succeeds and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get client_identifier_prepend_zero
 my $client_identifier_prepend_zero = $fixed_addr->client_identifier_prepend_zero();
 #Modify dhcp_client_identifier
 $fixed_addr->client_identifier_prepend_zero("true");

cli_credentials( )

Use this method to set or retrieve the discovery CLI credentials.

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

Note that when cli_credentials is set to a defined value and override_cli_credentials is set to "false", the last operation takes precedence. Thus the sequence $fixed_addr->cli_credentials([$cli]); $fixed_addr->override_cli_credentials("false"); will set override_cli_credentials to "false", and the sequence $fixed_addr->override_cli_credentials("false"); $fixed_addr->cli_credentials([$cli]); will result in override_cli_credentials="true".

Parameter

Valid value is an array reference that contains Infoblox::Grid::Discovery::CLICredential objects.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get cli_credentials
 my $cli_credentials = $fixed_addr->cli_credentials();
 #Modify cli_credentials
 $fixed_addr->cli_credentials([$cli1, $cli2]);

comment( )

Use this method to set or retrieve the descriptive comment of a DHCP Fixed Address object.

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

Parameter

Desired comment in string format with a maximum of 256 bytes.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get comment
 my $comment = $fixed_addr->comment();
 #Modify comment
 $fixed_addr->comment("Modified DHCP Fixed Address object comment");

configure_for_dhcp( )

Use this method to set or retrieve the configure_for_dhcp flag of a DHCP Fixed Address object.

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

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get configure_for_dhcp
 my $configure_for_dhcp = $fixed_addr->configure_for_dhcp();
 #Modify configure_for_dhcp
 $fixed_addr->configure_for_dhcp("true");

cloud_info( )

Use this method to retrieve cloud API related information for the Infoblox::DHCP::FixedAddr object.

Parameter

None

Returns

The method returns the attribute value.

Example
 # Get cloud_info
 my $cloud_info = $object->cloud_info();

ddns_domainname( )

Use this method to set or retrieve the DDNS domain name value of a DHCP Fixed 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_ddns_domainname method to "true". Setting the parameter to undefined causes the appliance to use the grid default and automatically resets the override_ddns_domainname attribute to "false".

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

Parameter

Specify the DDNS domain name.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get the DDNS domain name
 my $ddns_domainname = $fixed_addr->ddns_domainname();
 #Modify the DDNS domain name
 $fixed_addr->ddns_domainname("ddns.domain.com");

ddns_hostname( )

Use this method to set or retrieve the DDNS host name value of a DHCP Fixed Address object.

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

Parameter

Specify the DDNS host name.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get the DDNS host name
 my $ddns_hostname = $fixed_addr->ddns_hostname();
 #Modify the DDNS host name
 $fixed_addr->ddns_hostname("host.ddns.domain.com");

deny_bootp( )

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

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

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get deny_bootp
 my $deny_bootp = $fixed_addr->deny_bootp();
 #Modify deny_bootp
 $fixed_addr->deny_bootp("true");

device_description( )

Use this method to set or retrieve the description of the discovery device.

Parameter

The device description in string format.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get device_description
 my $device_description = $fixed_addr->device_description();
 #Modify device_description
 $fixed_addr->device_description('example');

device_location( )

Use this method to set or retrieve the location of the discovery device.

Parameter

The device location in string format.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get device_location
 my $device_location = $fixed_addr->device_location();
 #Modify device_location
 $fixed_addr->device_location('example');

device_type( )

Use this method to set or retrieve the type of the discovery device.

Parameter

The device type in string format.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get device_type
 my $device_type = $fixed_addr->device_type();
 #Modify device_type
 $fixed_addr->device_type('example');

device_vendor( )

Use this method to set or retrieve the vendor name of the discovery device.

Parameter

The device vendor name in string format.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get device_vendor
 my $device_vendor = $fixed_addr->device_vendor();
 #Modify device_vendor
 $fixed_addr->device_vendor('example');

dhcp_client_identifier( )

Use this method to set or retrieve the dhcp-client-identifier value of a DHCP Fixed Address object.

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

Parameter

Use the dhcp_client_identifier or uid to assign fixed addresses 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 fixed addresses to use the dhcp_client_identifier instead of the mac_address.

Returns

If you specified a parameter, the method returns true when the modification succeeds and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get dhcp_client_identifier
 my $uid = $fixed_addr->dhcp_client_identifier();
 #Modify dhcp_client_identifier
 $fixed_addr->dhcp_client_identifier("foo");
 or
 $fixed_addr->dhcp_client_identifier("1:11::11::11::11::11::12");

disable( )

Use this method to set or retrieve the disable flag of a DHCP Fixed Address object.

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

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get disable
 my $disable = $fixed_addr->disable();
 #Modify disable
 $fixed_addr->disable("true");

discover_now_status( )

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.

Parameter

None.

Returns

The method returns the attribute value that can be 'COMPLETE', 'FAILED', 'NONE', 'PENDING' or 'RUNNING'.

Example
 #Get discover_now_status
 my $discover_now_status = $fixed_addr->discover_now_status();

discovered_data( )

Use this method to retrieve the discovered data of a DHCP Fixed Address object. This is a read-only attribute.

Omit the parameter to retrieve the attribute value.

Parameter

None

Returns

The valid return value is an Infoblox::Grid::Discovery::Data object.

Example
 #Get discovered_data value
 my $discovered_data = $object->discovered_data();

discovered_mac( )

Use this method to retrieve the discovered MAC address of a DHCP Fixed Address object.

Parameter

none

Returns

The method returns the discovered MAC address.

Example
 #Get discovered_mac
 my $discovered_mac = $fixed_addr->discovered_mac();

discovered_name( )

Use this method to retrieve the discovered name of a DHCP Fixed Address object.

Parameter

none

Returns

The method returns the discovered name.

Example
 #Get discovered_name
 my $discovered_name = $fixed_addr->discovered_name();

discoverer( )

Use this method to retrieve the discoverer of a DHCP Fixed Address object.

Parameter

none

Returns

The method returns the discoverer value.

Example
 #Get discoverer
 my $discoverer = $fixed_addr->discoverer();

enable_ddns( )

Use this method to set or retrieve the enable_ddns flag of a DHCP Fixed Address object.

If enable_ddns value is specified as "true", then the A and PTR records corresponding to the Fixed Address 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.

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get enable_ddns
 my $enable_ddns = $fixed_addr->enable_ddns();
 #Modify enable_ddns
 $fixed_addr->enable_ddns("true");

extattrs( )

Use this method to set or retrieve the extensible attributes associated with a DHCP Fixed Address object.

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get extattrs
 my $ref_extattrs = $fixed_addr->extattrs();
 #Modify extattrs
 $fixed_addr->extattrs({ 'Site' => $extattr1, 'Administrator' => $extattr2 });

extensible_attributes( )

Use this method to set or retrieve the extensible attributes associated with a DHCP Fixed Address object

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

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get extensible attributes
 my $ref_extensible_attributes = $fixed_addr->extensible_attributes();
 #Modify extensible attributes
 $fixed_addr->extensible_attributes({ 'Site' => 'Santa Clara', 'Administrator' => [ 'Peter', 'Tom' ] });

first_discovered( )

Use this method to retrieve the date and time that the DHCP Fixed Address object was first discovered.

Parameter

none

Returns

The method returns the date and time that the DHCP Fixed Address object was first discovered.

Example
 #Get first_discovered
 my $first_discovered = $fixed_addr->first_discovered();

ignore_dhcp_option_list_request( )

Use this method to set or retrieve the ignore_dhcp_option_list_request flag of a DHCP Fixed address 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.

Parameter

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..

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 # Get ignore_dhcp_option_list_request
 my $ignore_dhcp_option_list_request = $fixed_addr->ignore_dhcp_option_list_request();
 # Un-override ignore_dhcp_option_list_request
 $fixed_addr->ignore_dhcp_option_list_request(undef);
 # Modify ignore_dhcp_option_list_request
 $fixed_addr->ignore_dhcp_option_list_request("true");

ipv4addr( )

Use this method to set or retrieve the ipv4addr value of a DHCP Fixed Address object.

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

Parameter

An IPv4 address is a 32-bit number in dotted decimal notation. It consists of four 8-bit groups of decimal digits separated by decimal points (example: 192.168.1.2).

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get ipv4addr
 my $ipv4addr = $fixed_addr->ipv4addr();
 #Modify ipv4addr
 $fixed_addr->ipv4addr("10.0.0.5");

is_invalid_mac( )

Use this method to retrieve the flag used to indicate whether an invalid MAC address is used. This is a read-only attribute.

Parameter

None

Returns

The method returns the attribute value.

Example
 #Get is_invalid_mac value
 my $is_invalid_mac = $fixed_addr->is_invalid_mac();

last_discovered( )

Use this method to retrieve the time this object was last seen by a discovery job.

The default value for this field is empty.

Parameter

N/A

Returns

The method returns the attribute value.

Example
 #Get last_discovered
 my $last_discovered = $fixed_addr->last_discovered();

logic_filters( )

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

Filters are used to screen address assignments for the DHCP Fixed Address if the addresses are to be assigned to specific hosts.

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

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

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

Parameter

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

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

The default value of the parameter is undefined.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get logic_filters
 my $ref_logic_filters = $fixed_addr->logic_filters();
 #Modify logic_filters
 $fixed_addr->logic_filters(["filter_1","filter_2",$exl1]); #$exl1 is an Infoblox::DHCP::Filter::MAC, Infoblox::DHCP::Filter::NAC or Infoblox::DHCP::Filter::Option object.

mac( )

 Use this method to set or retrieve the MAC address value of a DHCP Fixed Address object.

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

Parameter

MAC Address of the DHCP Fixed address 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.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get mac
 my $mac = $fixed_addr->mac();
 #Modify mac
 $fixed_addr->mac("11::11::11::11::11::12");

match_client( )

Use this method to set or retrieve the match_client value of a DHCP Fixed Address object.

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

Parameter
    match_client "MAC": The fixed IP address is leased to the matching MAC address.
    match_client "CLIENT_IDENTIFIER": The fixed IP address is leased to the matching DHCP client identifier
    match_client "RESERVED": The fixed IP address is reserved for later use with a MAC address that only has zeros.
    match_client "CIRCUIT_ID": The fixed IP address is leased to the DHCP client with a matching circuit ID. Note that
                 the "agent_circuit_id" field must be set in this case.
    match_client "REMOTE_ID": The fixed IP address is leased to the DHCP client with a matching remote ID. Note that
                 the "agent_remote_id" field must be set in this case.
Returns
    If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.
    If you did not specify a parameter, the method returns the attribute value.
Example
 #Get match_client
 my $match_client = $fixed_addr->match_client();
 #Modify match_client
 $fixed_addr->match_client("CLIENT_IDENTIFIER");

member( )

Use this method to set or retrieve the Microsoft server associated with this fixed address.

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

Parameter

The valid value is a defined Infoblox::DHCP::MSServer object. The default value is empty.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get member
 my $ref_member = $dhcp_fixedaddr->member();
 #Modify member
 $dhcp_fixedaddr->member($member1); #$member1 is an Infoblox::DHCP::MSServer object

ms_ad_user_data( )

Use this method to retrieve Microsoft Active Directory users related information. This is a read-only attribute.

Parameter

None

Returns

The valid return value is an Infoblox::Grid::MSServer::AdUser::Data object.

Example
 #Get ms_ad_user_data
 my $ms_ad_user_data = $dhcp_fixedaddr->ms_ad_user_data();

name( )

 Use this method to set or retrieve the name of a DHCP Fixed Address object.

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

Parameter

A string specifying the name of the fixed address.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get name
 my $name = $fixed_addr->name();
 #Modify name
 $fixed_addr->name("fxname");

netbios( )

Use this method to retrieve the name in the NetBIOS reply that responded to a NetBIOS query.

Returns

The method returns the attribute value.

Example
 #Get netbios
 my $netbios = $fixed_addr->netbios();

ms_options( )

Use this method to set or retrieve the Microsoft server custom DHCP options associated with this DHCP fixed address.

Note: You can set only options that are specified in both the Microsoft server and NIOS option definitions. Options that are not common to both the Microsoft server and NIOS cannot be modified.

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

Parameter

Valid value is an array reference that contains defined Infoblox::DHCP::MSOption objects. The default value is empty.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get options
 my $ref_options = $dhcp_fixedaddr->ms_options();
 #Modify options
 $dhcp_fixedaddr->ms_options([$option12]); #$option12 is an Infoblox::DHCP::MSOption object

network( )

Use this method to retrieve the network value of a DHCP Fixed Address object.

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

Parameter

An network is a 32-bit number in dotted decimal notation. It consists of four 8-bit groups of decimal digits separated by decimal points followed by prefix (example: 1.0.0.0/8).

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get network
 my $network = $fixed_addr->network();

network_component_description( )

Use this method to retrieve the description of the network device that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the network device description.

Example
 #Get network_component_description
 my $network_component_description = $fixed_addr->network_component_description();

network_component_ip( )

Use this method to retrieve the IP address of the network device that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the IP address of the network device.

Example
 #Get network_component_ip
 my $network_component_ip = $fixed_addr->network_component_ip();

network_component_name( )

Use this method to retrieve the name of the network device that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the network device name.

Example
 #Get network_component_name
 my $network_component_name = $fixed_addr->network_component_name();

network_component_port_description( )

Use this method to retrieve the description of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the description of the port on the network device.

Example
 #Get network_component_port_description
 my $network_component_port_description = $fixed_addr->network_component_port_description();

network_component_port_name( )

Use this method to retrieve the name of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the name of the port on the network device.

Example
 #Get network_component_port_name
 my $network_component_port_name = $fixed_addr->network_component_port_name();

network_component_port_number( )

Use this method to retrieve the number of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the network device port number.

Example
 #Get network_component_port_number
 my $network_component_port_number = $fixed_addr->network_component_port_number();

network_component_type( )

Use this method to retrieve the type of the network device that is connected to DHCP Fixed Address object.

Parameter

none

Returns

The method returns the network device type.

Example
 #Get network_component_type
 my $network_component_type = $fixed_addr->network_component_type();

network_view( )

Use this method to set or retrieve the network view of the DHCP fixed address.

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 fixed address is in the default network view.

Parameter

Valid value is a defined Infoblox::DHCP::View object. The default network view value is the system-defined default network view object.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get network view
 my $nview = $fixed_addr->network_view();
 #Modify network view, with an Infoblox::DHCP::View object
 $fixed_addr->network_view($nview);

nextserver( )

Use this method to set or retrieve the nextserver value of a DHCP Fixed Address object.

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

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

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get nextserver
 my $nextserver = $fixed_addr->nextserver();
 #Modify nextserver
 $fixed_addr->nextserver("3.3.3.4");
 #Un-override nextserver
 $fixed_addr->nextserver(undef);

options( )

Use this method to set or retrieve the options of a DHCP Fixed Address 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.

Parameter

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.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get options
 my $options = $fixed_addr->options();
 #Modify options
 $fixed_addr->options([$option1, $option2]);

os( )

Use this method to retrieve the operating system associated with this fixed address.

Returns

The method returns the attribute value.

Example
 #Get os
 my $os = $fixed_addr->os();

override_ddns_domainname( )

The override_ddns_domainname attribute controls whether the ddns_domainname value in the DHCP Fixed Address is used, instead of the grid default.

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

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

Parameter

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

The default value of this parameter is "false".

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
    #Getting override_ddns_domainname
    my $override_ddns_domainname=$fixed_addr->override_ddns_domainname( );
    #Modifying override_ddns_domainname
    $fixed_addr->override_ddns_domainname("true");

override_cli_credentials( )

The override_cli_credentials attribute controls whether the cli_credentials value in the object is used, instead of the grid default.

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

Parameter

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

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 # Get attribute value
 my $value = $fixed_addr->override_cli_credentials();
 # Modify attribute value
 $fixed_addr->override_cli_credentials('true');

override_logic_filters( )

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

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

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

Parameter

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

The default value of this parameter is "false".

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Getting override_logic_filters
 my $override_logic_filters=$fixed_addr->override_logic_filters( );
 #Modifying override_logic_filters
 $fixed_addr->override_logic_filters("true");

port_duplex( )

Use this method to retrieve the duplex setting of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the port duplex setting. Returned values, if any, are one of the following:

  Full
  Half
Example
 #Get port_duplex
 my $port_duplex = $fixed_addr->port_duplex();

port_link_status( )

Use this method to retrieve the link status of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the network device port link status. Returned values, if any, are one of the following:

  Connected
  Not Connected
  Unknown
Example
 #Get port_link_status
 my $port_link_status = $fixed_addr->port_link_status();

port_speed( )

Use this method to retrieve the speed of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the network device port speed. Returned values, if any, are one of the following:

  10M
  100M
  1G
  10G
  100G
  Unknown
Example
 #Get port_speed
 my $port_speed = $fixed_addr->port_speed();

port_status( )

Use this method to retrieve the status of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the network device port status. Returned values, if any, are one of the following:

  Up
  Down
  Unknown
Example
 #Get port_status
 my $port_status = $fixed_addr->port_status();

port_vlan_description( )

Use this method to retrieve the VLAN description of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the VLAN description of the network device port.

Example
 #Get port_vlan_description
 my $port_vlan_description = $fixed_addr->port_vlan_description();

port_vlan_name( )

Use this method to retrieve the VLAN name of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the network device port VLAN name.

Example
 #Get port_vlan_name
 my $port_vlan_name = $fixed_addr->port_vlan_name();

port_vlan_number( )

Use this method to retrieve the VLAN number of the network device port that is connected to the DHCP Fixed Address object.

Parameter

none

Returns

The method returns the port VLAN number.

Example
 #Get port_vlan_number
 my $port_vlan_number = $fixed_addr->port_vlan_number();

pxe_lease_time( )

Use this method to set or retrieve the pxe_lease_time value of a DHCP Fixed Address object.

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

Parameter

Enter appropriate values in the Days, Hours, Mins and Secs fields. User 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.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get pxe_lease_time
 my $pxe_lease_time = $fixed_addr->pxe_lease_time();
 #Modify pxe_lease_time
 $fixed_addr->pxe_lease_time("369");

reserved_interface( )

Use this method to set or retrieve the reserved discovery interface.

Parameter

Valid value is an Infoblox::Grid::Discovery::DeviceInterface object.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get reserved_interface
 my $reserved_interface = $fixed_addr->reserved_interface();
 #Modify reserved_interface
 $fixed_addr->reserved_interface($interface);

template( )

Use this method to set or retrieve the fixed address template name for a DHCP Fixed Address object.

Template is the name of a DHCP Fixed Address template which will be used to create the DHCP Fixed Address.

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

Parameter

The valid name in sting format.

Returns

If you specified a parameter, 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 Fixed Address and cannot be used during object modify or returned during object get.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get template
 my $template = $fixed_addr->template();
 #Modify template
 $fixed_addr->template("Template_Name");

v_cluster( )

Use this method to retrieve the name of the VMware cluster associated with the DHCP Fixed Address object. This method is read-only.

Parameter

none

Returns

This method returns a string that contains the VMware cluster name. The default value is an empty string.

Example
 #Get v_cluster
 my $v_cluster = $fixed_addr->v_cluster();

v_datacenter( )

Use this method to retrieve the name of the VMware datacenter associated with the DHCP Fixed Address object. This method is read-only.

Parameter

none

Returns

This method returns a string that contains the VMware datacenter name. The default value is an empty string.

Example
 #Get v_datacenter
 my $v_datacenter = $fixed_addr->v_datacenter();

v_host( )

Use this method to retrieve the name of the VMware host associated with the DHCP Fixed Address object. This method is read-only.

Parameter

none

Returns

This method returns a string that contains the VMware host name. The default value is an empty string.

Example
 #Get v_host
 my $v_host = $fixed_addr->v_host();

v_name( )

Use this method to retrieve the name of the VMware entity associated with the DHCP Fixed Address object. This method is read-only.

Parameter

none

Returns

This method returns a string that contains the VMware entity name. The default value is an empty string.

Example
 #Get v_name
 my $v_name = $fixed_addr->v_name();

v_netadapter( )

Use this method to retrieve the name of the physical network adapter through which the VMware entity is connected to the appliance. This method is read-only.

Parameter

none

Returns

This method returns a string that contains the network adapter name. The default value is an empty string.

Example
 #Get v_netadapter
 my $v_netadapter = $fixed_addr->v_netadapter();

v_switch( )

Use this method to retrieve the name of the virtual switch through which the VMware entity is connected to the appliance. This method is read-only.

Parameter

none

Returns

This method returns a string that contains the virtual switch name. The default value is an empty string.

Example
 #Get v_switch
 my $v_switch = $fixed_addr->v_switch();

v_type( )

Use this method to retrieve the type of VMware entity associated with the DHCP Fixed Address object. This method is read-only.

Parameter

none

Returns

This method returns a string that contains the VMware entity type. The default value is an empty string. The returned value, if any, can be one of the following:

 VirtualMachine
 HostSystem
 VirtualCenter
Example
 #Get v_type
 my $v_type = $fixed_addr->v_type();


SAMPLE CODE

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";
 #Create a network object
 my $network = Infoblox::DHCP::Network->new(
                                            "network" => "10.0.0.0/8",
                                           );
 unless($network) {
      die("Construct Network object failed: ",
            Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Network object created successfully\n";
 $session->add($network)
     or die("Add network failed: ",
            $session->status_code() . ":" . $session->status_detail());
 print "Network added successfully\n";
 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 Fixed address object

 #Create a DHCP Fixed Address object
 my $fixed_addr = Infoblox::DHCP::FixedAddr->new(
     "ipv4addr"       => "10.0.0.6",
     "mac"            => "00:00:00:11:11:11",
     "network"        => "10.0.0.0/8",
     "comment"        => "add fixed address",
     "enable_ddns"    => "true",
     "pxe_lease_time" => "3600",
     "bootserver"     => "someserver.com",
     "nextserver"     => "3.3.3.3",
     "bootfile"       => "bootfile.com",
     "options"        => [ $option1 ,  $option2 ],
 );
 unless($fixed_addr) {
      die("Construct fixed address failed: ",
            Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "DHCP Fixed address object created successfully\n";
 #Verify if the DHCP Fixed Address exists in the Infoblox appliance
 my $object = $session->get(
        object => "Infoblox::DHCP::FixedAddr",
        mac    => "00:00:00:11:11:11"
 );
 unless ($object) {
    print "fixed address does not exist on server, safe to add the fixed address\n";
    $session->add($fixed_addr)
       or die("Add fixed address failed: ",
              $session->status_code() . ":" . $session->status_detail());
 }
 print "DHCP Fixed address added successfully\n";

#Create a DHCP Fixed Address object using a template

 #Create a DHCP Fixed Address template object
 my $fixed_addr_template = Infoblox::DHCP::FixedAddrTemplate->new(
     "name"                  => "custom_fa_template",
     "offset"                => "10",
     "number_of_addresses"   => "1",
     "comment"               => "add fixed address template",
     "enable_ddns"           => "TRUE",
 );
 unless($fixed_addr_template) {
      die("Construct fixed address failed: ",
            Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "DHCP Fixed address template object created successfully\n";
 $session->add($fixed_addr_template)
       or die("Add fixed address template failed: ",
              $session->status_code() . ":" . $session->status_detail());
 }
 print "DHCP Fixed address template added successfully\n";
 #Create a DHCP Fixed Address object
 my $fixed_addr = Infoblox::DHCP::FixedAddr->new(
     "network"        => "10.0.0.0/8",
     "ipv4addr"       => "10.0.0.7",
     "match_client"   => "RESERVED",
     "template"       => "custom_fa_template"
 );
 unless($fixed_addr) {
      die("Construct fixed address failed: ",
            Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "DHCP Fixed address object created successfully\n";
 $session->add($fixed_addr)
       or die("Add fixed address failed: ",
              $session->status_code() . ":" . $session->status_detail());
 }
 print "DHCP Fixed address added successfully\n";

#Search for a specific DHCP Fixed Address object

 #Search for all DHCP Fixed address objects under the network 10.0.0.0/8
 my @retrieved_objs = $session->search(
     object  => "Infoblox::DHCP::FixedAddr",
     mac     => "00:00:00:11:11.*",
     network => "10.0.0.0/8" );
 my $object = $retrieved_objs[0];
 unless ($object) {
        die("Search for Fixed Address object failed: ",
                $session->status_code() . ":" . $session->status_detail());
 }
 print "Search Fixed Address object found at least 1 matching entry\n";

#Get and modify a DHCP Fixed Address object

 #Get DHCP Fixed Address object through the session
 my @retrieved_objs = $session->get(
     object => "Infoblox::DHCP::FixedAddr",
     mac    => "00:00:00:11:11:11",
 );
 my $object = $retrieved_objs[0];
 unless ($object) {
     die("Get Fixed Address object failed: ",
         $session->status_code() . ":" . $session->status_detail());
 }
 print "Get Fixed Address object found at least 1 matching entry\n";
 #Modify one of the attributes of the obtained Fixed Address object
 $object->pxe_lease_time("1234");
 #Un-override bootfile
 $object->bootfile(undef);
 #Un-override bootserver
 $object->bootserver(undef);
 #Un-override nextserver
 $object->nextserver(undef);
 #Apply the changes
 $session->modify($object)
     or die("Modify Fixed Address object failed: ",
            $session->status_code() . ":" . $session->status_detail());
 print "Fixed Address object modified successfully \n";

#Remove a Fixed Address object

 #Get Fixed Address object through the session
 my @retrieved_objs = $session->get(
     object => "Infoblox::DHCP::FixedAddr",
     mac    => "00:00:00:11:11:11",
 );
 my $object = $retrieved_objs[0];
 unless ($object) {
     die("Get Fixed Address object failed: ",
         $session->status_code() . ":" . $session->status_detail());
 }
 print "Get Fixed Address object found at least 1 matching entry\n";
 #Submit the object for removal
 $session->remove($object)
     or die("Remove Fixed Address object failed: ",
         $session->status_code() . ":" . $session->status_detail());
 print "Fixed Address 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";
 #Submit the Fixed Address Template object for removal
 $session->remove($fixed_addr_template)
     or die("Remove Fixed Address Template object failed: ",
         $session->status_code() . ":" . $session->status_detail());
 print "Fixed Address Template object removed successfully \n";
 ####PROGRAM ENDS####


AUTHOR

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


SEE ALSO

Infoblox::DHCP::Network, Infoblox::DHCP::View, Infoblox::DHCP::Range, Infoblox::DHCP::Lease, Infoblox::Session->add(), Infoblox::Session->get(), Infoblox::Session->modify(), Infoblox::Session->remove(), Infoblox::Session->search(), Infoblox::Session, Infoblox::DHCP::FixedAddrTemplate, Infoblox::Grid::Discovery::Data


COPYRIGHT

Copyright (c) 2017 Infoblox Inc.