 |
|
| |
Zenoss::Router::Device(3) |
User Contributed Perl Documentation |
Zenoss::Router::Device(3) |
Zenoss::Router::Device - A JSON/ExtDirect interface to operations
on devices
use Zenoss;
my $api = Zenoss->connect(
{
username => 'zenoss username',
password => 'zenoss password',
url => 'http://zenossinstance:8080',
}
);
# Replace SOMEMETHOD with one of the available methods provided by this module
my $response = $api->device_SOMEMETHOD(
{
parameter1 => 'value',
parameter2 => 'value',
}
);
This module is NOT instantiated directly. To call methods from
this module create an instance of Zenoss. This document serves as a resource
of available Zenoss API calls to Zenoss.
The following is a list of available methods available for
interaction with the Zenoss API. Please take note of the argument
requirements, defaults and return content.
The documentation for this module was mostly taken from the Zenoss
JSON API docs. Keep in mind that their (Zenoss Monitoring System)
programming is based around python, so descriptions such as dictionaries
will be represented as hashes in Perl.
Adds a new location organizer specified by the parameter id to the
parent organizer specified by contextUid. contextUid must be a path to a
Location.
- ARGUMENTS
- type (string) - Node type (always 'organizer' in this case)
contextUid (string) - Path to the location organizer that will
be the new node's parent (ex. /zport/dmd/Devices/Locations)
id (string) - The identifier of the new node
description (string) - Describes the new location
address (string) - Physical address of the new location
- REQUIRED
ARGUMENTS
- type
contextUid
id
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- success: (bool) Success of node creation
nodeConfig: (dictionary) The new location's properties
Returns the tree structure of an organizer hierarchy where the
root node is the organizer identified by the id parameter.
- ARGUMENTS
- id (string) - Id of the root node of the tree to be returned
- REQUIRED
ARGUMENTS
- id
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- success: (bool) Success of node creation
Object representing the tree
Retrieves all of the components at a given UID. This method allows
for pagination.
- ARGUMENTS
- uid (string) - Unique identifier of the device whose components are being
retrieved
meta_type (string) - The meta type of the components to be
retrieved
keys (list) - List of keys to include in the returned
dictionary. If None then all keys will be returned
start (integer) - Offset to return the results from; used in
pagination
limit (integer) - Number of items to return; used in
pagination
sort (string) - Key on which to sort the return results;
dir (string) - Sort order; can be either 'ASC' or 'DESC'
name (regex) - Used to filter the results
- REQUIRED
ARGUMENTS
- uid
- DEFAULT
ARGUMENTS
- {start => 0, limit => 50, sort => 'name', dir => 'ASC'}
- RETURNS
- data: (dictionary) The components returned
totalCount: (integer) Number of items returned
hash: (string) Hashcheck of the current component state (to
check whether components have changed since last query)
Given a component uid and the component search criteria, this
retrieves the position of the component in the results.
- ARGUMENTS
- componentUid (string) - Unique identifier of the component whose index to
return
uid (string) - Unique identifier of the device queried for
components
meta_type (string) - The meta type of the components to
retrieve
sort (string) - Key on which to sort the return results
dir (string) - Sort order; can be either 'ASC' or 'DESC'
name (regex) - Used to filter the results
- REQUIRED
ARGUMENTS
- componentUid
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC'}
- RETURNS
- index: (integer) Index of the component
Given an object identifier, this returns all of the editable
fields on that object as well as their ExtJs xtype that one would use on a
client side form.
- ARGUMENTS
- uid (string) - Unique identifier of an object
- REQUIRED
ARGUMENTS
- uid
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- form: (dictionary) form fields for the object
Get the properties of a device or device organizer
- ARGUMENTS
- uid (string) - Unique identifier of an object
keys (list) - List of keys to include in the returned
dictionary. If None then all keys will be returned
- REQUIRED
ARGUMENTS
- uid
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- data: (dictionary) Object properties
disabled: (bool) If current user doesn't have permission to
use setInfo
Sets the ProductInfo on a device. This method has the following
valid keyword arguments:
- ARGUMENTS
- uid (string) - Unique identifier of a device
hwManufacturer (string) - Hardware manufacturer
hwProductName (string) - Hardware product name
osManufacturer (string) - Operating system manufacturer
osProductName (string) - Operating system product name
- REQUIRED
ARGUMENTS
- uid
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- Not documented
Retrieves a list of devices. This method supports pagination.
- ARGUMENTS
- uid (string) - Unique identifier of the organizer to get devices from
start (integer) - Offset to return the results from; used in
pagination
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
limit (integer) - Number of items to return; used in
pagination
sort (string) - Key on which to sort the return results
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- N/A
- DEFAULT
ARGUMENTS
- {start => 0, limit => 50, sort => 'name', dir => 'ASC'}
- RETURNS
- devices: (list) Dictionaries of device properties
totalCount: (integer) Number of devices returned
hash: (string) Hashcheck of the current device state (to check
whether devices have changed since last query)
Moves the devices specified by uids to the organizer specified by
'target'.
- ARGUMENTS
- uids ([string]) - List of device uids to move
target (string) - Uid of the organizer to move the devices
to
hashcheck (string) - Hashcheck for the devices (from
getDevices())
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
uid (string) - Organizer to use when using ranges to get
additional uids
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uids
target
hashcheck
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC'}
- RETURNS
- tree: ([dictionary]) Object representing the new device tree
exports: (integer) Number of devices moved
Push changes on device(s) configuration to collectors.
- ARGUMENTS
- uids ([string]) - List of device uids to push changes
hashcheck (string) - Hashcheck for the devices (from
getDevices())
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
uid (string) - Organizer to use when using ranges to get
additional uids
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uids
hashcheck
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC'}
- RETURNS
- Success message
Lock device(s) from changes.
- ARGUMENTS
- uids ([string]) - List of device uids to lock
hashcheck (string) - Hashcheck for the devices (from
getDevices())
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
updates (boolean) - True to lock device from updates
deletion (boolean) - True to lock device from deletion
sendEvent (boolean) - True to send an event when an action is
blocked by locking
uid (string) - Organizer to use when using ranges to get
additional uids
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uids
hashcheck
- DEFAULT
ARGUMENTS
- {updates => JSON::false, deletion => JSON::false, sendevent =>
JSON::false, sort => 'name', dir => 'ASC'}
- RETURNS
- Success or failure message
Reset IP address(es) of device(s) to the results of a DNS lookup
or a manually set address
- ARGUMENTS
- uids ([string]) - List of device uids with IP's to reset
hashcheck (string) - Hashcheck for the devices (from
getDevices())
uid (string) - Organizer to use when using ranges to get
additional uids
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
ip (string) - IP to set device to. Empty string causes DNS
lookup
- REQUIRED
ARGUMENTS
- uids
hashcheck
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC', ip => ''}
- RETURNS
- Success or failure message
Reset community string of device(s)
- ARGUMENTS
- uids ([string]) - List of device uids to reset
hashcheck (string) - Hashcheck for the devices (from
getDevices())
uid (string) - Organizer to use when using ranges to get
additional uids
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uids
hashcheck
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC'}
- RETURNS
- Success or failure message
Set the production state of device(s)
- ARGUMENTS
- uids ([string]) - List of device uids to set
prodState (integer) - Production state to set device(s)
to.
hashcheck (string) - Hashcheck for the devices (from
getDevices())
uid (string) - Organizer to use when using ranges to get
additional uids
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass,
or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uids
prodState
hashcheck
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC'}
- RETURNS
- Success or failure message
Set device(s) priority.
- ARGUMENTS
- uids ([string]) - List of device uids to set
priority (integer) - Priority to set device(s) to.
hashcheck (string) - Hashcheck for the devices (from
getDevices())
uid (string) - Organizer to use when using ranges to get
additional uids
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uids
priority
hashcheck
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC'}
- RETURNS
- Success or failure message
Set device(s) collector.
- ARGUMENTS
- uids ([string]) - List of device uids to set
collector (string) - Collector to set devices to
hashcheck (string) - Hashcheck for the devices (from
getDevices())
uid (string) - Organizer to use when using ranges to get
additional uids
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass,
or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uids
collector
hashcheck
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC'}
- RETURNS
- Success or failure message
Set the monitoring flag for component(s)
- ARGUMENTS
- uids ([string]) - List of component uids to set
hashcheck (string) - Hashcheck for the components (from
getComponents())
monitor (boolean) - True to monitor component
uid (string) - Device to use when using ranges to get
additional uids
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
meta_type (string) - The meta type of the components to
retrieve
start (integer) - Offset to return the results from; used in
pagination
limit (integer) - Number of items to return; used in
pagination
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
name (string) - Component name to search for when loading
ranges
- REQUIRED
ARGUMENTS
- uids
hashcheck
- DEFAULT
ARGUMENTS
- {monitor => JSON::false, start => 0, limit => 50, sort =>
'name', dir => 'ASC'}
- RETURNS
- Success or failure message
Lock component(s) from changes.
- ARGUMENTS
- uids ([string]) - List of component uids to lock
hashcheck (string) - Hashcheck for the components (from
getComponents())
uid (string) - Device to use when using ranges to get
additional uids
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
updates (boolean) - True to lock component from updates
deletion (boolean) - True to lock component from deletion
sendEvent (boolean) - True to send an event when an action is
blocked by locking
meta_type (string) - The meta type of the components to
retrieve
start (integer) - Offset to return the results from; used in
pagination
limit (integer) - Number of items to return; used in
pagination
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
name (string) - Component name to search for when loading
ranges
- REQUIRED
ARGUMENTS
- uids
hashcheck
- DEFAULT
ARGUMENTS
- {updates => JSON::false, deletion => JSON::false, sendEvent =>
JSON::false, start => 0, limit => 50, sort => 'name', dir =>
'ASC'}
- RETURNS
- Success or failure message
Delete device component(s).
- ARGUMENTS
- uids ([string]) - List of component uids to delete
hashcheck (string) - Hashcheck for the components (from
getComponents())
uid (string) - Device to use when using ranges to get
additional uids
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
meta_type (string) - The meta type of the components to
retrieve
start (integer) - Offset to return the results from; used in
pagination
limit (integer) - Number of items to return; used in
pagination
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
name (string) - Component name to search for when loading
ranges
- REQUIRED
ARGUMENTS
- uids
hashcheck
- DEFAULT
ARGUMENTS
- {start => 0, limit => 50, sort => 'name', dir => 'ASC'}
- RETURNS
- Success or failure message
Remove/delete device(s).
- ARGUMENTS
- uids ([string]) - List of device uids to remove
hashcheck (string) - Hashcheck for the devices (from
getDevices())
action (string) - Action to take. 'remove' to remove devices
from organizer uid, and 'delete' to delete the device from Zenoss.
uid (string) - Organizer to use when using ranges to get
additional uids and/or to remove device
ranges ([integer]) - List of two integers that are the min/max
values of a range of uids to include
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uids
hashcheck
- DEFAULT
ARGUMENTS
- {action => 'remove', sort => 'name', dir => 'ASC'}
- RETURNS
- devtree: ([dictionary]) Object representing the new device tree
grptree: ([dictionary]) Object representing the new group
tree
systree: ([dictionary]) Object representing the new system
tree
loctree: ([dictionary]) Object representing the new location
tree
Get a range of device uids.
- ARGUMENTS
- ranges ([integer]) - List of two integers that are the min/max values of a
range of uids
hashcheck (string) - Hashcheck for the devices (from
getDevices())
uid (string) - Organizer to use to get uids
params (dictionary) - Key-value pair of filters for this
search. Can be one of the following: name, ipAddress, deviceClass, or
productionState
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- ranges
hashcheck
- DEFAULT
ARGUMENTS
- {sort => 'name', dir => 'ASC'}
- RETURNS
- A list of device uids
Get a range of component uids.
- ARGUMENTS
- ranges ([integer]) - List of two integers that are the min/max values of a
range of uids
hashcheck (string) - not used
uid (string) - Device to use to get uids
types ([string]) - The types of components to retrieve
meta_type (string) - The meta type of the components to
retrieve
start (integer) - Offset to return the results from; used in
pagination
limit (integer) - Number of items to return; used in
pagination
sort (string) - Key on which to sort the return result
dir (string) - Sort order; can be either 'ASC' or 'DESC'
name (string) - Component name to search for when loading
ranges
- REQUIRED
ARGUMENTS
- ranges
hashcheck
- DEFAULT
ARGUMENTS
- {start => 0, sort => 'name', dir => 'ASC'}
- RETURNS
- A list of component uids
Get a list of all hardware product names from a manufacturer.
- ARGUMENTS
- manufacturer (string) - Manufacturer name
- REQUIRED
ARGUMENTS
- N/A
- DEFAULT
ARGUMENTS
- {manufacturer => ''}
- RETURNS
- productNames: ([dictionary]) List of hardware product names
totalCount: (integer) Total number of hardware product
names
Get a list of all OS product names from a manufacturer.
- ARGUMENTS
- manufacturer (string) - Manufacturer name
- REQUIRED
ARGUMENTS
- N/A
- DEFAULT
ARGUMENTS
- {manufacturer => ''}
- RETURNS
- productNames: ([dictionary]) List of OS product names
totalCount: (integer) Total number of OS product names
Add a device.
- ARGUMENTS
- deviceName (string) - Name or IP of the new device
deviceClass (string) - The device class to add new device
to
title (string) - The title of the new device
snmpCommunity (string) - A specific community string to use
for this device.
snmpPort (integer) - SNMP port on new device
model (boolean) - True to model device at add time
collector (string) - Collector to use for new device
rackSlot (string) - Rack slot description
productionState (integer) - Production state of the new
device
comments (string) - Comments on this device
hwManufacturer (string) - Hardware manufacturer name
hwProductName (string) - Hardware product name
osManufacturer (string) - OS manufacturer name
osProductName (string) - OS product name
priority (integer) - Priority of this device
tag (string) - Tag number of this device
serialNumber (string) - Serial number of this device
- REQUIRED
ARGUMENTS
- deviceName
deviceClass
- DEFAULT
ARGUMENTS
- {snmpCommunity => '', snmpPort => '161', collector =>
'localhost', rackSlot => 0, productionState => 1000, comments =>
'', hwManufacturer => '', hwProductName => '', osManufacturer =>
'', osProductName => '', priority => 3, tag => '', serialNumber
=> ''}
- RETURNS
- jobId: (string) ID of the add device job
Bind an unbound template or unbind a bound template from a
device.
- ARGUMENTS
- uid (string) - Device uid to bind/unbind template
templateUid (string) - Template uid to bind/unbind
- REQUIRED
ARGUMENTS
- uid
templateUid
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- Success message
Returns the url and title for each graph for the object passed
in.
- ARGUMENTS
- uid (string) - uid of the device
drange (unknown) - I assume this is some type of date range,
but the API doesnt document how to specify.
- REQUIRED
ARGUMENTS
- uid
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- data: ([dictionary]) List of objects representing urls / titles for each
graph
Given a uid this method returns meta data about when it was
modified.
- ARGUMENTS
- id (string) - uid of a device
types (dictionary) - Not sure what this really is. Python code
says it sorts by this?
- REQUIRED
ARGUMENTS
- id
- DEFAULT
ARGUMENTS
- {types => JSON::null}
- RETURNS
- data: ([dictionary]) List of device modifications
Returns the definition and values of all the zen properties for
this context
- ARGUMENTS
- uid (string) - Unique identifier of the device
start (integer) - Offset to return the results from; used in
pagination
params (dictionary) - Key-value pair of filters for this
search
limit (integer) - Number of items to return; used in
pagination
sort (string) - Key on which to sort the return results
dir (string) - Sort order; can be either 'ASC' or 'DESC'
- REQUIRED
ARGUMENTS
- uid
- DEFAULT
ARGUMENTS
- {start => 0, dir => 'ASC'}
- RETURNS
- data: ([dictionary]) List of zProperties
totalCount: (integer) Total number of properties
Returns information about a zProperty for a given context,
including its value
- ARGUMENTS
- uid (string) - Unique identifier of the device
zProperty (string) - Name of the zProperty
- REQUIRED
ARGUMENTS
- uid
zProperty
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- data: ([dictionary]) zProperty information/data
Removes the local instance of the each property in properties.
Note that the property will only be deleted if a hasProperty is true
- ARGUMENTS
- uid (string) - Unique identifier of the device
zProperty (string) - Name of the zProperty
- REQUIRED
ARGUMENTS
- uid
zProperty
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- data: ([dictionary]) zProperty information/data
Sets the zProperty value
- ARGUMENTS
- uid (string) - Unique identifier of the device
zProperty (string) - Name of the zProperty
value (type) - Value to set the zProperty to
- REQUIRED
ARGUMENTS
- uid
zProperty
value
- DEFAULT
ARGUMENTS
- N/A
- RETURNS
- data: ([dictionary]) zProperty information/data response
Patrick Baker <patricksbaker@gmail.com>
Copyright (C) 2010 by Patrick Baker
<patricksbaker@gmail.com>
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 to
<http://opensource.org/licenses/artistic-license-2.0.php>.
Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc.
|