Manual Reference Pages - ZENOSS::CONNECTOR (3)
Zenoss::Connector - Module responsible for establishing a connection to the Zenoss API
# Create a connection object
my $connection = Zenoss::Connector->new(
username => admin,
password => zenoss,
url => http://zenossinstance:8080,
# Pass the connection to the router
my $api = Zenoss::Router->new(
connector => $connection,
# Call some API methods
my $response = $api->device_getDevices();
# Print the JSON return
This module creates a connection to the Zenoss API, and tests the connectivity. Once a
Zenoss::Connector object has been established, it can be passed to Zenoss::Router
to process Zenoss API calls.
While this module can be used directly, it is recommended that Zenoss facilitates the
connection to the Zenoss::Router.
A croak will occur in the event a connection cannot be established.
Attributes can be set on object creation, see SYNOPSIS, or by calling $obj->attribute(value).
Attributes can be retrieved by calling $obj->attribute.
The username to log in with at the Zenos instance
The password to log in with at the Zenos instance
The url to be used in establishing a connection to the Zenoss instance. Note,
that ports in the http(s) url are not required unless theyre non-stanard. For
example the url can be set to:
Without having to specify :80 or :443. However, non-standard ports must be specified!
Zenoss by default uses :8080, so this must be specified on the url if your instance
The timeout value for processing transactions. Note, if you process a large request, IE
getting all historical events, its prudent to set this value to something higher than the
default of 120 seconds.
This attribute cannot be set. However, once the object is created this attribute can be
accessed to provide the full url, with credentials, to the Zenoss instance. For example,
Patrick Baker <email@example.com>
COPYRIGHT AND LICENSE
Copyright (C) 2010 by Patrick Baker <firstname.lastname@example.org>
This module is free software: you can redistribute it and/or modify
it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You can obtain the Artistic License 2.0 by either viewing the
LICENSE file provided with this distribution or by navigating
|perl v5.20.3 ||ZENOSS::CONNECTOR (3) ||2010-12-06 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.