Package Products :: Package Zuul :: Package routers :: Module device :: Class DeviceRouter
[hide private]
[frames] | no frames]

Class DeviceRouter

source code

ZenUtils.Ext.DirectRouter --+    
                            |    
                   TreeRouter --+
                                |
                               DeviceRouter

A JSON/ExtDirect interface to operations on devices

Instance Methods [hide private]
dictionary
addDeviceClassNode(self, type, contextUid, id, description=None, connectionInfo=None)
Adds a new device class organizer specified by the parameter id to the parent organizer specified by contextUid.
source code
dictionary
addLocationNode(self, type, contextUid, id, description=None, address=None)
Adds a new location organizer specified by the parameter id to the parent organizer specified by contextUid.
source code
 
_getFacade(self)
Abstract method for child classes to use to get their facade
source code
[dictionary]
getTree(self, id)
Returns the tree structure of an organizer hierarchy where the root node is the organizer identified by the id parameter.
source code
DirectResponse
getComponents(self, uid=None, meta_type=None, keys=None, start=0, limit=50, page=0, sort='name', dir='ASC', name=None)
Retrieves all of the components at a given UID.
source code
[dictionary]
getComponentTree(self, uid=None, id=None, sorting_dict=None)
Retrieves all of the components set up to be used in a tree.
source code
DirectResponse
findComponentIndex(self, componentUid, uid=None, meta_type=None, sort='name', dir='ASC', name=None, **kwargs)
Given a component uid and the component search criteria, this retrieves the position of the component in the results.
source code
DirectResponse
getForm(self, uid)
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.
source code
DirectResponse
getInfo(self, uid, keys=None)
Get the properties of a device or device organizer
source code
DirectResponse
setInfo(self, **data)
Set attributes on a device or device organizer.
source code
 
_getInfoData(self, info, keys) source code
DirectResponse
setProductInfo(self, uid, **data)
Sets the ProductInfo on a device.
source code
 
getDeviceUuidsByName(self, query="", start=0, limit=25, page=1, uuid=None)
Retrieves a list of device uuids.
source code
DirectResponse
getDeviceUids(self, uid)
Return a list of device uids underneath an organizer.
source code
DirectResponse
getDevices(self, uid=None, start=0, params=None, limit=50, sort='name', page=None, dir='ASC', keys=None)
Retrieves a list of devices.
source code
 
renameDevice(self, uid, newId)
Set the device specified by the uid,"uid" to have the the id "newId" This will raise an exception if it fails.
source code
DirectResponse
moveDevices(self, uids, target, hashcheck=None, ranges=(), uid=None, params=None, sort='name', dir='ASC', asynchronous=True)
Moves the devices specified by uids to the organizer specified by 'target'.
source code
DirectResponse
pushChanges(self, uids, hashcheck, ranges=(), uid=None, params=None, sort='name', dir='ASC')
Push changes on device(s) configuration to collectors.
source code
DirectResponse
lockDevices(self, uids, hashcheck, ranges=(), updates=False, deletion=False, sendEvent=False, uid=None, params=None, sort='name', dir='ASC')
Lock device(s) from changes.
source code
DirectResponse
resetIp(self, uids, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC', ip='')
Reset IP address(es) of device(s) to the results of a DNS lookup or a manually set address
source code
DirectResponse
resetCommunity(self, uids, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC')
Reset SNMP community string(s) on device(s)
source code
DirectResponse
setProductionState(self, uids, prodState, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC')
Set the production state of device(s).
source code
DirectResponse
setPriority(self, uids, priority, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC')
Set device(s) priority.
source code
 
moveCollectorDevices(self, srcCollectors, dstCollector, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC', moveData=False, asynchronous=True)
Move all devices under one or more collectors to another collector
source code
DirectResponse
setCollector(self, uids, collector, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC', moveData=False, asynchronous=True)
Set device(s) collector.
source code
DirectResponse
setComponentsMonitored(self, uids, hashcheck, monitor=False, uid=None, ranges=(), meta_type=None, keys=None, start=0, limit=50, sort='name', dir='ASC', name=None)
Set the monitoring flag for component(s)
source code
DirectResponse
lockComponents(self, uids, hashcheck, uid=None, ranges=(), updates=False, deletion=False, sendEvent=False, meta_type=None, keys=None, start=0, limit=50, sort='name', dir='ASC', name=None)
Lock component(s) from changes.
source code
DirectResponse
deleteComponents(self, uids, hashcheck, uid=None, ranges=(), meta_type=None, keys=None, start=0, limit=50, sort='name', dir='ASC', name=None)
Delete device component(s).
source code
DirectResponse
removeDevices(self, uids, hashcheck, action="remove", uid=None, ranges=(), params=None, sort='name', dir='ASC', deleteEvents=False, deletePerf=False)
Remove/delete device(s).
source code
 
getGraphDefs(self, uid, drange=None)
Returns the url and title for each graph for the object passed in.
source code
[string]
loadRanges(self, ranges, hashcheck, uid=None, params=None, sort='name', dir='ASC')
Get a range of device uids.
source code
[string]
loadComponentRanges(self, ranges, hashcheck, uid=None, types=(), meta_type=(), start=0, limit=None, sort='name', dir='ASC', name=None)
Get a range of component uids.
source code
[dictionary]
getUserCommands(self, uid)
Get a list of user commands for a device uid.
source code
[dictionary]
getProductionStates(self, **kwargs)
Get a list of available production states.
source code
[dictionary]
getPriorities(self, **kwargs)
Get a list of available device priorities.
source code
[string]
getCollectors(self)
Get a list of available collectors.
source code
DirectResponse
getDeviceClasses(self, **data)
Get a list of all device classes.
source code
DirectResponse
getSystems(self, **data)
Get a list of all systems.
source code
DirectResponse
getGroups(self, **data)
Get a list of all groups.
source code
DirectResponse
getLocations(self, **data)
Get a list of all locations.
source code
DirectResponse
getManufacturerNames(self, **data)
Get a list of all manufacturer names.
source code
DirectResponse
getHardwareProductNames(self, manufacturer='', **data)
Get a list of all hardware product names from a manufacturer.
source code
DirectResponse
getOSProductNames(self, manufacturer='', **data)
Get a list of all OS product names from a manufacturer.
source code
DirectResponse
addDevice(self, deviceName, deviceClass, title=None, snmpCommunity="", snmpPort=161, manageIp="", model=False, collector='localhost', rackSlot=0, locationPath="", systemPaths=[], groupPaths=[], productionState=1000, comments="", hwManufacturer="", hwProductName="", osManufacturer="", osProductName="", priority=3, tag="", serialNumber="", zCommandUsername="", zCommandPassword="", zWinUser="", zWinPassword="", zProperties={}, cProperties={})
Add a device.
source code
DirectResponse
remodel(self, deviceUid)
Submit a job to have a device remodeled.
source code
DirectResponse
addLocalTemplate(self, deviceUid, templateId)
Adds a local template on a device.
source code
DirectResponse
removeLocalTemplate(self, deviceUid, templateUid)
Removes a locally defined template on a device.
source code
DirectResponse
getLocalTemplates(self, query, uid)
Get a list of locally defined templates on a device.
source code
DirectResponse
getTemplates(self, id)
Get a list of available templates for a device.
source code
DirectResponse
getUnboundTemplates(self, uid)
Get a list of unbound templates for a device.
source code
DirectResponse
getBoundTemplates(self, uid)
Get a list of bound templates for a device.
source code
DirectResponse
setBoundTemplates(self, uid, templateIds)
Set a list of templates as bound to a device.
source code
DirectResponse
resetBoundTemplates(self, uid)
Remove all bound templates from a device.
source code
DirectResponse
bindOrUnbindTemplate(self, uid, templateUid)
Bind an unbound template or unbind a bound template from a device.
source code
DirectResponse
getOverridableTemplates(self, query, uid)
Get a list of available templates on a device that can be overridden.
source code
DirectResponse
clearGeocodeCache(self)
Clear the Google Maps geocode cache.
source code
List of Dictionaries
getConnectionInfo(self, uid)
Returns the zproperty information about those zproperties which comprise the credentials
source code
 
getModelerPluginDocStrings(self, uid)
Given a uid returns the documentation for all the modeler plugins.
source code
 
addIpRouteEntry(self, uid, dest='', routemask='', nexthopid='', interface='', routeproto='', routetype='', userCreated=True)
Adds an Ip Route Entry to this device
source code
 
addIpInterface(self, uid, newId, userCreated=True)
Adds an Ip Interface
source code
 
addOSProcess(self, uid, newClassName, example, userCreated=True)
Adds an os processes
source code
 
addFileSystem(self, uid, newId, userCreated=True)
Adds an Ip Interface
source code
 
addIpService(self, uid, newClassName, protocol, userCreated=True)
Adds an Ip Service
source code
 
addWinService(self, uid, newClassName, userCreated=True)
Adds an Ip Service
source code
 
getSoftware(self, uid, keys=None) source code
 
getOverriddenObjectsList(self, uid, propname, relName)
returns a list of Overridden Objects and properties for this context
source code
 
getOverriddenObjectsParent(self, uid, propname='')
returns the base of the Overridden Objects
source code
 
getOverriddenZprops(self, uid, all=True, pfilt='')
returns a list of zProperty values for the overridden objects
source code
 
getGraphDefintionsForComponents(self, uid) source code
 
getComponentGraphs(self, uid, meta_type, graphId, allOnSame=False)
Returns the graph denoted by graphId for every component in device (uid) with the meta_type meta_type
source code
 
getDevTypes(self, uid, filter=None)
Returns a list of devtypes for the wizard
source code

Inherited from TreeRouter: addNode, asyncGetTree, deleteNode, gunzip_b64, gzip_b64, moveOrganizer, objectExists

Inherited from TreeRouter (private): _canDeleteUid

Method Details [hide private]

addDeviceClassNode(self, type, contextUid, id, description=None, connectionInfo=None)

source code 

Adds a new device class organizer specified by the parameter id to the parent organizer specified by contextUid.

contextUid must be a path to a DeviceClass.

Parameters:
  • 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/)
  • id (string) - The identifier of the new node
  • description (string) - (optional) Describes the new device class
  • connectionInfo (list) - (optional) List of zproperties that constitute credentials for this device classs
Returns: dictionary
Properties:
  • success: (bool) Success of node creation
  • nodeConfig: (dictionary) The new device class's properties
Decorators:
  • @serviceConnectionError
  • @contextRequire("Manage DMD", 'contextUid')

addLocationNode(self, type, contextUid, id, description=None, address=None)

source code 

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.

Parameters:
  • 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) - (optional) Describes the new location
  • address (string) - (optional) Physical address of the new location
Returns: dictionary
Properties:
  • success: (bool) Success of node creation
  • nodeConfig: (dictionary) The new location's properties
Decorators:
  • @serviceConnectionError
  • @contextRequire("Manage DMD", 'contextUid')

_getFacade(self)

source code 

Abstract method for child classes to use to get their facade

Overrides: TreeRouter._getFacade
(inherited documentation)

getTree(self, id)

source code 

Returns the tree structure of an organizer hierarchy where the root node is the organizer identified by the id parameter.

Parameters:
  • id (string) - Id of the root node of the tree to be returned
Returns: [dictionary]
Object representing the tree
Decorators:
  • @serviceConnectionError

getComponents(self, uid=None, meta_type=None, keys=None, start=0, limit=50, page=0, sort='name', dir='ASC', name=None)

source code 

Retrieves all of the components at a given UID. This method allows for pagination.

Parameters:
  • uid (string) - Unique identifier of the device whose components are being retrieved
  • meta_type (string) - (optional) The meta type of the components to be retrieved (default: None)
  • keys (list) - (optional) List of keys to include in the returned dictionary. If None then all keys will be returned (default: None)
  • start (integer) - (optional) Offset to return the results from; used in pagination (default: 0)
  • limit (integer) - (optional) Number of items to return; used in pagination (default: 50)
  • sort (string) - (optional) Key on which to sort the return results; (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
  • name (regex) - (optional) Used to filter the results (default: None)
Returns: DirectResponse
Properties:
  • 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)
Decorators:
  • @serviceConnectionError

getComponentTree(self, uid=None, id=None, sorting_dict=None)

source code 

Retrieves all of the components set up to be used in a tree.

Parameters:
  • uid (string) - Unique identifier of the root of the tree to retrieve
  • id (string) - not used
Returns: [dictionary]
Component properties in tree form

findComponentIndex(self, componentUid, uid=None, meta_type=None, sort='name', dir='ASC', name=None, **kwargs)

source code 

Given a component uid and the component search criteria, this retrieves the position of the component in the results.

Parameters:
  • componentUid (string) - Unique identifier of the component whose index to return
  • uid (string) - Unique identifier of the device queried for components
  • meta_type (string) - (optional) The meta type of the components to retrieve (default: None)
  • sort (string) - (optional) Key on which to sort the return results (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
  • name (regex) - (optional) Used to filter the results (default: None)
Returns: DirectResponse
Properties:
  • index: (integer) Index of the component

getForm(self, uid)

source code 

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.

Parameters:
  • uid (string) - Unique identifier of an object
Returns: DirectResponse
Properties
  • form: (dictionary) form fields for the object
Decorators:
  • @serviceConnectionError

getInfo(self, uid, keys=None)

source code 

Get the properties of a device or device organizer

Parameters:
  • uid (string) - Unique identifier of an object
  • keys (list) - (optional) List of keys to include in the returned dictionary. If None then all keys will be returned (default: None)
Returns: DirectResponse
Properties
  • data: (dictionary) Object properties
  • disabled: (bool) If current user doesn't have permission to use setInfo
Decorators:
  • @serviceConnectionError

setInfo(self, **data)

source code 

Set attributes on a device or device organizer. This method accepts any keyword argument for the property that you wish to set. The only required property is "uid".

Parameters:
  • uid (string) - Unique identifier of an object
Returns: DirectResponse
Decorators:
  • @serviceConnectionError

setProductInfo(self, uid, **data)

source code 

Sets the ProductInfo on a device. This method has the following valid keyword arguments:

Parameters:
  • 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
Returns: DirectResponse
Decorators:
  • @require('Manage Device')

getDeviceUuidsByName(self, query="", start=0, limit=25, page=1, uuid=None)

source code 

Retrieves a list of device uuids. For use in combos. If uuid is set, ensures that it is included in the returned list.

getDeviceUids(self, uid)

source code 

Return a list of device uids underneath an organizer. This includes all the devices belonging to an child organizers.

Parameters:
  • uid (string) - Unique identifier of the organizer to get devices from
Returns: DirectResponse
Properties:
  • devices: (list) device uids

getDevices(self, uid=None, start=0, params=None, limit=50, sort='name', page=None, dir='ASC', keys=None)

source code 

Retrieves a list of devices. This method supports pagination.

Parameters:
  • uid (string) - Unique identifier of the organizer to get devices from
  • start (integer) - (optional) Offset to return the results from; used in pagination (default: 0)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • limit (integer) - (optional) Number of items to return; used in pagination (default: 50)
  • sort (string) - (optional) Key on which to sort the return results (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: DirectResponse
Properties:
  • 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)
Decorators:
  • @serviceConnectionError

renameDevice(self, uid, newId)

source code 

Set the device specified by the uid,"uid" to have the the id "newId" This will raise an exception if it fails.

Parameters:
  • uid (string) - The unique id of the device we are renaming
  • newId (string) - string of the new id

moveDevices(self, uids, target, hashcheck=None, ranges=(), uid=None, params=None, sort='name', dir='ASC', asynchronous=True)

source code 

Moves the devices specified by uids to the organizer specified by 'target'.

Parameters:
  • 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]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • uid (string) - (optional) Organizer to use when using ranges to get additional uids (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: DirectResponse
Properties:
  • tree: ([dictionary]) Object representing the new device tree
  • exports: (integer) Number of devices moved

pushChanges(self, uids, hashcheck, ranges=(), uid=None, params=None, sort='name', dir='ASC')

source code 

Push changes on device(s) configuration to collectors.

Parameters:
  • uids ([string]) - List of device uids to push changes
  • hashcheck (string) - Hashcheck for the devices (from getDevices())
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • uid (string) - (optional) Organizer to use when using ranges to get additional uids (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage Device')

lockDevices(self, uids, hashcheck, ranges=(), updates=False, deletion=False, sendEvent=False, uid=None, params=None, sort='name', dir='ASC')

source code 

Lock device(s) from changes.

Parameters:
  • uids ([string]) - List of device uids to lock
  • hashcheck (string) - Hashcheck for the devices (from getDevices())
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • updates (boolean) - (optional) True to lock device from updates (default: False)
  • deletion (boolean) - (optional) True to lock device from deletion (default: False)
  • sendEvent (boolean) - (optional) True to send an event when an action is blocked by locking (default: False)
  • uid (string) - (optional) Organizer to use when using ranges to get additional uids (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: DirectResponse
Success or failure message

resetIp(self, uids, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC', ip='')

source code 

Reset IP address(es) of device(s) to the results of a DNS lookup or a manually set address

Parameters:
  • uids ([string]) - List of device uids with IP's to reset
  • hashcheck (string) - Hashcheck for the devices (from getDevices())
  • uid (string) - (optional) Organizer to use when using ranges to get additional uids (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
  • ip (string) - (optional) IP to set device to. Empty string causes DNS lookup (default: '')
Returns: DirectResponse
Success or failure message

resetCommunity(self, uids, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC')

source code 

Reset SNMP community string(s) on device(s)

Parameters:
  • uids ([string]) - List of device uids to reset
  • hashcheck (string) - Hashcheck for the devices (from getDevices())
  • uid (string) - (optional) Organizer to use when using ranges to get additional uids (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: DirectResponse
Success or failure message
Decorators:
  • @require('Manage Device')

setProductionState(self, uids, prodState, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC')

source code 

Set the production state of device(s).

Parameters:
  • 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) - (optional) Organizer to use when using ranges to get additional uids (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: DirectResponse
Success or failure message

setPriority(self, uids, priority, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC')

source code 

Set device(s) priority.

Parameters:
  • 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) - (optional) Organizer to use when using ranges to get additional uids (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: DirectResponse
Success or failure message

moveCollectorDevices(self, srcCollectors, dstCollector, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC', moveData=False, asynchronous=True)

source code 

Move all devices under one or more collectors to another collector

The signature is exactly the same as setCollector(), except that the 'uids' parameter is replaced with 'srcCollectors'

Parameters:
  • srcCollectors (list of strings) - The collectors to move all devices from

setCollector(self, uids, collector, hashcheck, uid=None, ranges=(), params=None, sort='name', dir='ASC', moveData=False, asynchronous=True)

source code 

Set device(s) collector.

Parameters:
  • 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) - (optional) Organizer to use when using ranges to get additional uids (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: DirectResponse
Success or failure message

setComponentsMonitored(self, uids, hashcheck, monitor=False, uid=None, ranges=(), meta_type=None, keys=None, start=0, limit=50, sort='name', dir='ASC', name=None)

source code 

Set the monitoring flag for component(s)

Parameters:
  • uids ([string]) - List of component uids to set
  • hashcheck (string) - Hashcheck for the components (from getComponents())
  • monitor (boolean) - (optional) True to monitor component (default: False)
  • uid (string) - (optional) Device to use when using ranges to get additional uids (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • meta_type (string) - (optional) The meta type of the components to retrieve (default: None)
  • keys ([string]) - not used
  • start (integer) - (optional) Offset to return the results from; used in pagination (default: 0)
  • limit (integer) - (optional) Number of items to return; used in pagination (default: 50)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
  • name (string) - (optional) Component name to search for when loading ranges (default: None)
Returns: DirectResponse
Success or failure message

lockComponents(self, uids, hashcheck, uid=None, ranges=(), updates=False, deletion=False, sendEvent=False, meta_type=None, keys=None, start=0, limit=50, sort='name', dir='ASC', name=None)

source code 

Lock component(s) from changes.

Parameters:
  • uids ([string]) - List of component uids to lock
  • hashcheck (string) - Hashcheck for the components (from getComponents())
  • uid (string) - (optional) Device to use when using ranges to get additional uids (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • updates (boolean) - (optional) True to lock component from updates (default: False)
  • deletion (boolean) - (optional) True to lock component from deletion (default: False)
  • sendEvent (boolean) - (optional) True to send an event when an action is blocked by locking (default: False)
  • meta_type (string) - (optional) The meta type of the components to retrieve (default: None)
  • keys ([string]) - not used
  • start (integer) - (optional) Offset to return the results from; used in pagination (default: 0)
  • limit (integer) - (optional) Number of items to return; used in pagination (default: 50)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
  • name (string) - (optional) Component name to search for when loading ranges (default: None)
Returns: DirectResponse
Success or failure message

deleteComponents(self, uids, hashcheck, uid=None, ranges=(), meta_type=None, keys=None, start=0, limit=50, sort='name', dir='ASC', name=None)

source code 

Delete device component(s).

Parameters:
  • uids ([string]) - List of component uids to delete
  • hashcheck (string) - Hashcheck for the components (from getComponents())
  • uid (string) - (optional) Device to use when using ranges to get additional uids (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • meta_type (string) - (optional) The meta type of the components to retrieve (default: None)
  • keys ([string]) - not used
  • start (integer) - (optional) Offset to return the results from; used in pagination (default: 0)
  • limit (integer) - (optional) Number of items to return; used in pagination (default: 50)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
  • name (string) - (optional) Component name to search for when loading ranges (default: None)
Returns: DirectResponse
Success or failure message

removeDevices(self, uids, hashcheck, action="remove", uid=None, ranges=(), params=None, sort='name', dir='ASC', deleteEvents=False, deletePerf=False)

source code 

Remove/delete device(s).

Parameters:
  • 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) - (optional) Organizer to use when using ranges to get additional uids and/or to remove device (default: None)
  • ranges ([integer]) - (optional) List of two integers that are the min/max values of a range of uids to include (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
  • deleteEvents (bool) - will remove all the events for the devices as well
  • deletePerf (bool) - will remove all the perf data for the devices
Returns: DirectResponse
Properties:
  • 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

getGraphDefs(self, uid, drange=None)

source code 

Returns the url and title for each graph for the object passed in.

Parameters:
  • uid (string) - unique identifier of an object
Decorators:
  • @serviceConnectionError

loadRanges(self, ranges, hashcheck, uid=None, params=None, sort='name', dir='ASC')

source code 

Get a range of device uids.

Parameters:
  • 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) - (optional) Organizer to use to get uids (default: None)
  • params (dictionary) - (optional) Key-value pair of filters for this search. Can be one of the following: name, ipAddress, deviceClass, or productionState (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
Returns: [string]
A list of device uids

loadComponentRanges(self, ranges, hashcheck, uid=None, types=(), meta_type=(), start=0, limit=None, sort='name', dir='ASC', name=None)

source code 

Get a range of component uids.

Parameters:
  • ranges ([integer]) - List of two integers that are the min/max values of a range of uids
  • hashcheck (string) - not used
  • uid (string) - (optional) Device to use to get uids (default: None)
  • types ([string]) - (optional) The types of components to retrieve (default: None)
  • meta_type (string) - (optional) The meta type of the components to retrieve (default: None)
  • start (integer) - (optional) Offset to return the results from; used in pagination (default: 0)
  • limit (integer) - (optional) Number of items to return; used in pagination (default: None)
  • sort (string) - (optional) Key on which to sort the return result (default: 'name')
  • dir (string) - (optional) Sort order; can be either 'ASC' or 'DESC' (default: 'ASC')
  • name (string) - (optional) Component name to search for when loading ranges (default: None)
Returns: [string]
A list of component uids

getUserCommands(self, uid)

source code 

Get a list of user commands for a device uid.

Parameters:
  • uid (string) - Device to use to get user commands
Returns: [dictionary]
List of objects representing user commands
Decorators:
  • @serviceConnectionError

getProductionStates(self, **kwargs)

source code 

Get a list of available production states.

Returns: [dictionary]
List of name/value pairs of available production states

getPriorities(self, **kwargs)

source code 

Get a list of available device priorities.

Returns: [dictionary]
List of name/value pairs of available device priorities

getCollectors(self)

source code 

Get a list of available collectors.

Returns: [string]
List of collectors

getDeviceClasses(self, **data)

source code 

Get a list of all device classes.

Returns: DirectResponse
Properties:
  • deviceClasses: ([dictionary]) List of device classes
  • totalCount: (integer) Total number of device classes

getSystems(self, **data)

source code 

Get a list of all systems.

Returns: DirectResponse
Properties:
  • systems: ([dictionary]) List of systems
  • totalCount: (integer) Total number of systems

getGroups(self, **data)

source code 

Get a list of all groups.

Returns: DirectResponse
Properties:
  • systems: ([dictionary]) List of groups
  • totalCount: (integer) Total number of groups

getLocations(self, **data)

source code 

Get a list of all locations.

Returns: DirectResponse
Properties:
  • systems: ([dictionary]) List of locations
  • totalCount: (integer) Total number of locations

getManufacturerNames(self, **data)

source code 

Get a list of all manufacturer names.

Returns: DirectResponse
Properties:
  • manufacturers: ([dictionary]) List of manufacturer names
  • totalCount: (integer) Total number of manufacturer names

getHardwareProductNames(self, manufacturer='', **data)

source code 

Get a list of all hardware product names from a manufacturer.

Parameters:
  • manufacturer (string) - Manufacturer name
Returns: DirectResponse
Properties:
  • productNames: ([dictionary]) List of hardware product names
  • totalCount: (integer) Total number of hardware product names

getOSProductNames(self, manufacturer='', **data)

source code 

Get a list of all OS product names from a manufacturer.

Parameters:
  • manufacturer (string) - Manufacturer name
Returns: DirectResponse
Properties:
  • productNames: ([dictionary]) List of OS product names
  • totalCount: (integer) Total number of OS product names

addDevice(self, deviceName, deviceClass, title=None, snmpCommunity="", snmpPort=161, manageIp="", model=False, collector='localhost', rackSlot=0, locationPath="", systemPaths=[], groupPaths=[], productionState=1000, comments="", hwManufacturer="", hwProductName="", osManufacturer="", osProductName="", priority=3, tag="", serialNumber="", zCommandUsername="", zCommandPassword="", zWinUser="", zWinPassword="", zProperties={}, cProperties={})

source code 

Add a device.

Parameters:
  • deviceName (string) - Name or IP of the new device
  • deviceClass (string) - The device class to add new device to
  • title (string) - (optional) The title of the new device (default: '')
  • snmpCommunity (string) - (optional) A specific community string to use for this device. (default: '')
  • snmpPort (integer) - (optional) SNMP port on new device (default: 161)
  • manageIp (string) - (optional) Management IP address on new device (default: empty/derive from DNS)
  • locationPath (string) - (optional) Organizer path of the location for this device
  • systemPaths (List (strings)) - (optional) List of organizer paths for the device
  • groupPaths (List (strings)) - (optional) List of organizer paths for the device
  • model (boolean) - (optional) True to model device at add time (default: False)
  • collector (string) - (optional) Collector to use for new device (default: localhost)
  • rackSlot (string) - (optional) Rack slot description (default: '')
  • productionState (integer) - (optional) Production state of the new device (default: 1000)
  • comments (string) - (optional) Comments on this device (default: '')
  • hwManufacturer (string) - (optional) Hardware manufacturer name (default: '')
  • hwProductName (string) - (optional) Hardware product name (default: '')
  • osManufacturer (string) - (optional) OS manufacturer name (default: '')
  • osProductName (string) - (optional) OS product name (default: '')
  • priority (integer) - (optional) Priority of this device (default: 3)
  • tag (string) - (optional) Tag number of this device (default: '')
  • serialNumber (string) - (optional) Serial number of this device (default: '')
  • zWinUser - (optional) Username for WMI (default: '')
  • zWinPassword - (optional) Password for WMI (default: '')
  • zCommandPassword (string)
  • zCommandUsername (string)
Returns: DirectResponse
Properties:
  • jobId: (string) ID of the add device job

remodel(self, deviceUid)

source code 

Submit a job to have a device remodeled.

Parameters:
  • deviceUid (string) - Device uid to have local template
Returns: DirectResponse
Properties:
  • jobId: (string) ID of the add device job
Decorators:
  • @require('Manage Device')

addLocalTemplate(self, deviceUid, templateId)

source code 

Adds a local template on a device.

Parameters:
  • deviceUid (string) - Device uid to have local template
  • templateId (string) - Name of the new template
Returns: DirectResponse
Success message
Decorators:
  • @require('Edit Local Templates')

removeLocalTemplate(self, deviceUid, templateUid)

source code 

Removes a locally defined template on a device.

Parameters:
  • deviceUid (string) - Device uid that has local template
  • templateUid (string) - Name of the template to remove
Returns: DirectResponse
Success message
Decorators:
  • @require('Edit Local Templates')

getLocalTemplates(self, query, uid)

source code 

Get a list of locally defined templates on a device.

Parameters:
  • query (string) - not used
  • uid (string) - Device uid to query for templates
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects representing local templates

getTemplates(self, id)

source code 

Get a list of available templates for a device.

Parameters:
  • id (string) - Device uid to query for templates
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects representing templates
Decorators:
  • @serviceConnectionError

getUnboundTemplates(self, uid)

source code 

Get a list of unbound templates for a device.

Parameters:
  • uid (string) - Device uid to query for templates
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects representing templates
Decorators:
  • @serviceConnectionError

getBoundTemplates(self, uid)

source code 

Get a list of bound templates for a device.

Parameters:
  • uid (string) - Device uid to query for templates
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects representing templates
Decorators:
  • @serviceConnectionError

setBoundTemplates(self, uid, templateIds)

source code 

Set a list of templates as bound to a device.

Parameters:
  • uid (string) - Device uid to bind templates to
  • templateIds ([string]) - List of template uids to bind to device
Returns: DirectResponse
Success message
Decorators:
  • @require('Edit Local Templates')

resetBoundTemplates(self, uid)

source code 

Remove all bound templates from a device.

Parameters:
  • uid (string) - Device uid to remove bound templates from
Returns: DirectResponse
Success message
Decorators:
  • @require('Edit Local Templates')

bindOrUnbindTemplate(self, uid, templateUid)

source code 

Bind an unbound template or unbind a bound template from a device.

Parameters:
  • uid (string) - Device uid to bind/unbind template
  • templateUid (string) - Template uid to bind/unbind
Returns: DirectResponse
Success message
Decorators:
  • @require('Edit Local Templates')

getOverridableTemplates(self, query, uid)

source code 

Get a list of available templates on a device that can be overridden.

Parameters:
  • query (string) - not used
  • uid (string) - Device to query for overridable templates
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects representing templates

clearGeocodeCache(self)

source code 

Clear the Google Maps geocode cache.

Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getConnectionInfo(self, uid)

source code 

Returns the zproperty information about those zproperties which comprise the credentials

Returns: List of Dictionaries
Properties:
  • path: (string) where the property is defined
  • type: (string) type of zproperty it is
  • options: (Array) available options for the zproperty
  • value (Array) value of the zproperty
  • valueAsString (string)

getModelerPluginDocStrings(self, uid)

source code 

Given a uid returns the documentation for all the modeler plugins.

Decorators:
  • @serviceConnectionError