Reply

An example of how to connect to the external Perl API

Employee
Employee
Posts: 1
2134     1

#Make sure the API version matches up with the one you have installed on your machine.

#The latest API PERL Module, along with tutorials and examples, is available in the GUI via the wrench icon at the top right->Network menu->API #Documentation.

use strict;
use warnings;
use NetMRI::API;

$ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;
# Connet to the NetMRI.
my $client = new NetMRI::API({ api_version => '2.9',
   username    => 'username', password    => 'password',
   url         => 'https://netmri_ipaddress_or_domain_man',
});

 

Thanks Adrian.

Adviser
Posts: 353
2135     1

Thanks Adrian.

Please note that specifying the API version protects you from having to change your scripts when an API call you are using changes behavior in a future release - if the version is specified, the server will maintain the same behavior (within some reasonable limits). The intent is to give you time to adapt to any changes in the API. See the "Backward Compatibility" section of the API developer's guide that can be found in the Additional Documentation section of the online help.

John

Showing results for 
Search instead for 
Did you mean: 

Recommended for You