Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

NetMRI_Easy.pm provides an interface to the NetMRI API from Perl scripts run on the NetMRI appliance. NetMRI_Easy.pm offers all of the features of infoblox_jobs.pm, with some safeguards and object-oriented interfaces that are unavailable when infoblox_jobs.pm is used.
NetMRI_Easy.pm is designed to be imported as a library into NetMRI and used by Perl scripts executed in the sandbox environment.
NetMRI_Easy.pm is also a compatibility layer, allowing the writing of Perl scripts that function unaltered with the newer 2.5 NetMRI Perl API, using scripts originally developed for the NetMRI Perl Core API 1.1. The following subsections describe the Perl functions encompassed by NetMRI_Easy.pm.

Constructor

The new NetMRI_Easy constructor options include the following:

my $easy = new NetMRI_Easy(api_version => 2, nios_api => 1, port => 'https');

or

my $easy = new NetMRI_Easy(api_version => 2, nios_api => 1, port => 443);

The Constructor for NetMRI_Easy takes a hash reference for options.

api_version => $version

Specifies which API version to use. See NetMRI::API for details.

nios_api => 1

Load the Infoblox API before connecting to the API. Using this option is the same as

use NetMRI::Util;

use_infoblox_api($main::nios_ipaddress);

NetMRI_Easy ensures that the Infoblox API is loaded before LWP::UserAgent. This is necessary because the Infoblox API requires a different version of LWP::UserAgent, and will fail if modules are loaded in the wrong order.

nios_ipaddress => $ip_address

IP address of the NIOS device to download the Infoblox API and connect to when using the nios_session method. This option is necessary when connecting to a NIOS that is not registered with NetMRI.

nios_username => $username

IP address of the NIOS device to download the Infoblox API and connect to when using the nios_session method. This option is necessary when connecting to a NIOS that is not registered with NetMRI.

nios_username => $username

Username to use when connecting to the NIOS device. This option is necessary when connecting to a NIOS appliance that is not registered with NetMRI or to connect with different credentials.

nios_password => $secret

Password to use when connecting to the NIOS device. This option is necessary when connecting to a NIOS appliance that has not been registered with NetMRI, or to connect with different credentials.

port => 443

or

port => 'https'

Connects the sandbox to NetMRI over port 443. If the port is not specified, the sandbox automatically connects to NetMRI over port 80.
  • No labels