Skip to content

TemplateRouter

setGraphPointSequence(uids) Sets the sequence of graph points in a graph definition.

@type uids: [string]
@param uids: List of graph point UID's in desired order
@rtype: DirectResponse
@return: Success message
deleteDataPoint(uid) Delete a data point.

@type uid: string
@param uid: Unique ID of the data point to delete
@rtype: DirectResponse
@return: Success message
getDeviceClassTemplates(id) Get all templates by device class. This will return a tree where device
classes are nodes, and templates are leaves.

@type id: string
@param id: not used
@rtype: [dictionary]
@return: List of objects representing the templates in tree hierarchy
deleteTemplate(uid) Delete a template.

@type uid: string
@param uid: Unique ID of the template to delete
@rtype: DirectResponse
@return: Success message
addGraphDefinition(templateUid, graphDefinitionId) Add a new graph definition to a template.

@type templateUid: string
@param templateUid: Unique ID of the template to add graph definition to
@type graphDefinitionId: string
@param graphDefinitionId: ID of the new graph definition
@rtype: DirectResponse
@return: Success message
addTemplate(id, targetUid) Add a template to a device class.

@type id: string
@param id: Unique ID of the template to add
@type targetUid: string
@param targetUid: Unique ID of the device class to add template to
@rtype: DirectResponse
@return: B{Properties}:
- nodeConfig: (dictionary) Object representing the added template
setInfo() Set attributes on an object.
This method accepts any keyword argument for the property that you wish
to set. The only required property is "uid".

@type uid: string
@keyword uid: Unique identifier of an object
@rtype: DirectResponse
@return: B{Properties}:
- data: (dictionary) The modified object
getGraphDefinition(uid) Get a graph definition.

@type uid: string
@param uid: Unique ID of the graph definition to retrieve
@rtype: DirectResponse
@return: B{Properties}:
- data: (dictionary) Object representing a graph definition
getTemplates(id) Get all templates.

@type id: string
@param id: not used
@rtype: [dictionary]
@return: List of objects representing the templates in tree hierarchy
getGraphPoints(uid) Get a list of graph points for a graph definition.

@type uid: string
@param uid: Unique ID of a graph definition
@rtype: DirectResponse
@return: B{Properties}:
- data: ([dictionary]) List of objects representing graph points
gzip_b64(string) gzip an arbitrary string, base64 encode it, and return it
asyncGetTree(**additionalKeys, **id) Server side method for asynchronous tree calls. Retrieves
the immediate children of the node specified by "id"

NOTE: our convention on the UI side is if we are asking
for the root node then return the root and its children
otherwise just return the children

@type id: string
@param id: The uid of the node we are getting the children for
@rtype: [dictionary]
@return: Object representing the immediate children
getGraphInstructionTypes(**query) Get a list of available instruction types for graph points.

@type query: string
@param query: not used
@rtype: DirectResponse
@return: B{Properties}:
- data: ([dictionary]) List of objects representing instruction types
getDataPoints(uid, **query) Get a list of available data points for a template.

@type query: string
@param query: not used
@type uid: string
@param uid: Unique ID of a template
@rtype: DirectResponse
@return: B{Properties}:
- data: ([dictionary]) List of objects representing data points
removeThreshold(uid) Remove a threshold.

@type uid: string
@param uid: Unique identifier of threshold to remove
@rtype: DirectResponse
@return: Success message
addDataSource(templateUid, name, type) Add a new data source to a template.

@type templateUid: string
@param templateUid: Unique ID of the template to add data source to
@type name: string
@param name: ID of the new data source
@type type: string
@param type: Type of the new data source. From getDataSourceTypes()
@rtype: DirectResponse
@return: Success message
deleteGraphPoint(uid) Delete a graph point.

@type uid: string
@param uid: Unique ID of the graph point to delete
@rtype: DirectResponse
@return: Success message
getDataSourceDetails(uid) Get a data source's details.

@type uid: string
@param uid: Unique ID of a data source
@rtype: dictionary
@return: B{Properties}:
- record: (dictionary) Object representing the data source
- form: (dictionary) Object representing an ExtJS form for the data
source
addDataPoint(dataSourceUid, name) Add a new data point to a data source.

@type dataSourceUid: string
@param dataSourceUid: Unique ID of the data source to add data point to
@type name: string
@param name: ID of the new data point
@rtype: DirectResponse
@return: Success message
deleteGraphDefinition(uid) Delete a graph definition.

@type uid: string
@param uid: Unique ID of the graph definition to delete
@rtype: DirectResponse
@return: Success message
addThresholdToGraph(graphUid, thresholdUid) Add a threshold to a graph definition.

@type graphUid: string
@param graphUid: Unique ID of the graph definition to add threshold to
@type thresholdUid: string
@param thresholdUid: Unique ID of the threshold to add
@rtype: DirectResponse
@return: Success message
getGraphs(uid, **query) Get the graph definitions for a template.

@type uid: string
@param uid: Unique ID of a template
@type query: string
@param query: not used
@rtype: [dictionary]
@return: List of objects representing representing graphs
makeLocalRRDTemplate(uid, templateName) @type uid: string
@param uid: Identifer of the obj we wish to make the template local for
@type templateName: string
@param templateName: identifier of the template
setGraphDefinition() Set attributes on an graph definition.
This method accepts any keyword argument for the property that you wish
to set. Properties are enumerated via getGraphDefinition(). The only
required property is "uid".

@type uid: string
@keyword uid: Unique identifier of an object
@rtype: DirectResponse
@return: B{Properties}:
- data: (dictionary) The modified object
addDataSourcetoGraphDef(dataSourceUid, graphUid, **includeThresholds) Add all the datapoints in a datasource to the graph definition.

@type dataSourceUid: string
@param dataSourceUid: Unique ID of the data source to add to graph
@type graphUid: string
@param graphUid: Unique ID of the graph to add data source to
@type includeThresholds: boolean
@param includeThresholds: (optional) True to include related thresholds
(default: False)
@rtype: DirectResponse
@return: Success message
deleteNode() Deletes a node from the tree.

B{NOTE}: You can not delete a root node of a tree

@type uid: string
@param uid: Unique identifier of the node we wish to delete
@rtype: DirectResponse
@return: B{Properties}:
- msg: (string) Status message
addNode() Add a node to the existing tree underneath the node specified
by the context UID

@type type: string
@param type: Either 'class' or 'organizer'
@type contextUid: string
@param contextUid: Path to the node that will
be the new node's parent (ex. /zport/dmd/Devices)
@type id: string
@param id: Identifier of the new node, must be unique in the
parent context
@type description: string
@param description: (optional) Describes this new node (default: None)
@rtype: dictionary
@return: Marshaled form of the created node
objectExists(uid) @rtype: DirectResponse
@return:
- Properties:
- B{exists} - Returns true if we can find the object specified by the uid
addCustomToGraph(graphUid, customId, customType) Add a custom graph point to a graph definition.

@type graphUid: string
@param graphUid: Unique ID of the graph definition to add graph point to
@type customId: string
@param customId: ID of the new custom graph point
@type customType: string
@param customType: Type of the new graph point. From getGraphInstructionTypes()
@rtype: DirectResponse
@return: Success message
setGraphDefinitionSequence(uids) Sets the sequence of graph definitions.

@type uids: [string]
@param uids: List of graph definition UID's in desired order
@rtype: DirectResponse
@return: Success message
getDataPointDetails(uid) Get a data point's details.

@type uid: string
@param uid: Unique ID of a data point
@rtype: dictionary
@return: B{Properties}:
- record: (dictionary) Object representing the data point
- form: (dictionary) Object representing an ExtJS form for the data
point
getThresholdDetails(uid) Get a threshold's details.

@type uid: string
@param uid: Unique ID of a threshold
@rtype: dictionary
@return: B{Properties}:
- record: (dictionary) Object representing the threshold
- form: (dictionary) Object representing an ExtJS form for the threshold
getCollectorTemplate(id)
getThresholdTypes(**query) Get a list of available threshold types.

@type query: string
@param query: not used
@rtype: [dictionary]
@return: List of objects representing threshold types
addThreshold() Add a threshold.

@type uid: string
@keyword uid: Unique identifier of template to add threshold to
@type thresholdType: string
@keyword thresholdType: Type of the new threshold. From getThresholdTypes()
@type thresholdId: string
@keyword thresholdId: ID of the new threshold
@type dataPoints: [string]
@keyword dataPoints: List of data points to select for this threshold
@rtype: DirectResponse
@return: Success message
getDataSourceTypes(query) Get a list of available data source types.

@type query: string
@param query: not used
@rtype: [dictionary]
@return: List of objects representing data source types
getObjTemplates(uid) @type uid: string
@param uid: Identifier for the object we want templates on, must descend from MetricMixin
@rtype: DirectResponse
@return: List of templates
getAddTemplateTargets(**query) Get a list of available device classes where new templates can be added.

@type query: string
@param query: not used
@rtype: DirectResponse
@return: B{Properties}:
- data: ([dictionary]) List of objects containing an available device
class UID and a human-readable label for that class
getInfo(uid) Get the properties of an object.

@type uid: string
@param uid: Unique identifier of an object
@rtype: DirectResponse
@return: B{Properties}
- data: (dictionary) Object properties
- form: (dictionary) Object representing an ExtJS form for the object
getThresholds(uid, **query) Get the thresholds for a template.

@type uid: string
@param uid: Unique ID of a template
@type query: string
@param query: not used
@rtype: [dictionary]
@return: List of objects representing representing thresholds
getDataSources(uid) Get the data sources for a template.

@type id: string
@param id: Unique ID of a template
@rtype: [dictionary]
@return: List of objects representing representing data sources
removeLocalRRDTemplate(uid, templateName) @type uid: string
@param uid: Identifer of the obj we wish to remove the local template
@type templateName: string
@param templateName: identifier of the local template
addDataPointToGraph(dataPointUid, graphUid, **includeThresholds) Add a data point to a graph.

@type dataPointUid: string
@param dataPointUid: Unique ID of the data point to add to graph
@type graphUid: string
@param graphUid: Unique ID of the graph to add data point to
@type includeThresholds: boolean
@param includeThresholds: (optional) True to include related thresholds
(default: False)
@rtype: DirectResponse
@return: Success message
deleteDataSource(uid) Delete a data source.

@type uid: string
@param uid: Unique ID of the data source to delete
@rtype: DirectResponse
@return: Success message
gunzip_b64(string) Base 64 decode a string, then gunzip it and return the result as JSON.
The input to this method should be gzipped, base 64 encoded JSON. Base
64 encoded strings are allowed to have up to 2 '='s of padding. The zenoss
Ext router eats these, so there is some logic to try padding them back into
the string should initial decoding fail.
getDataPointsRPNValues(maxval, thuid, selecteddps, minval)
getCopyTargets(uid, **query) Get a list of available device classes to copy a template to.

@type uid: string
@param uid: Unique ID of the template to copy
@type query: string
@param query: (optional) Filter the returned targets' names based on this
parameter (default: '')
@rtype: DirectResponse
@return: B{Properties}:
- data: ([dictionary]) List of objects containing an available device
class UID and a human-readable label for that class
moveOrganizer(targetUid, organizerUid) Move the organizer uid to be underneath the organizer
specified by the targetUid.

@type targetUid: string
@param targetUid: New parent of the organizer
@type organizerUid: string
@param organizerUid: The organizer to move
@rtype: DirectResponse
@return: B{Properties}:
- data: (dictionary) Moved organizer
copyTemplate(uid, targetUid) Copy a template to a device or device class.

@type uid: string
@param uid: Unique ID of the template to copy
@type targetUid: string
@param targetUid: Unique ID of the device or device class to bind to template
@rtype: DirectResponse
@return: Success message