Package Products :: Package Zuul :: Package routers :: Module template :: Class TemplateRouter
[hide private]
[frames] | no frames]

Class TemplateRouter

source code

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

A JSON/ExtDirect interface to operations on templates

Instance Methods [hide private]
 
_getFacade(self)
Abstract method for child classes to use to get their facade
source code
[dictionary]
getTemplates(self, id)
Get all templates.
source code
[dictionary]
getDeviceClassTemplates(self, id)
Get all templates by device class.
source code
DirectResponse
getAddTemplateTargets(self, query=None)
Get a list of available device classes where new templates can be added.
source code
DirectResponse
addTemplate(self, id, targetUid)
Add a template to a device class.
source code
DirectResponse
deleteTemplate(self, uid)
Delete a template.
source code
DirectResponse
getObjTemplates(self, uid)
Returns: List of templates
source code
 
makeLocalRRDTemplate(self, uid, templateName) source code
 
removeLocalRRDTemplate(self, uid, templateName) source code
[dictionary]
getThresholds(self, uid, query='')
Get the thresholds for a template.
source code
dictionary
getThresholdDetails(self, uid)
Get a threshold's details.
source code
DirectResponse
getDataPoints(self, uid, query='')
Get a list of available data points for a template.
source code
DirectResponse
addDataPoint(self, dataSourceUid, name)
Add a new data point to a data source.
source code
DirectResponse
addDataSource(self, templateUid, name, type)
Add a new data source to a template.
source code
[dictionary]
getDataSources(self, uid)
Get the data sources for a template.
source code
dictionary
getDataSourceDetails(self, uid)
Get a data source's details.
source code
dictionary
getDataPointDetails(self, uid)
Get a data point's details.
source code
DirectResponse
setInfo(self, **data)
Set attributes on an object.
source code
 
_getInfoData(self, obj, keys) source code
DirectResponse
addThreshold(self, **data)
Add a threshold.
source code
DirectResponse
removeThreshold(self, uid)
Remove a threshold.
source code
[dictionary]
getThresholdTypes(self, query=None)
Get a list of available threshold types.
source code
[dictionary]
getDataSourceTypes(self, query)
Get a list of available data source types.
source code
[dictionary]
getGraphs(self, uid, query=None)
Get the graph definitions for a template.
source code
DirectResponse
addDataPointToGraph(self, dataPointUid, graphUid, includeThresholds=False)
Add a data point to a graph.
source code
DirectResponse
addDataSourcetoGraphDef(self, dataSourceUid, graphUid, includeThresholds=False)
Add all the datapoints in a datasource to the graph definition.
source code
DirectResponse
getCopyTargets(self, uid, query='')
Get a list of available device classes to copy a template to.
source code
DirectResponse
copyTemplate(self, uid, targetUid)
Copy a template to a device or device class.
source code
DirectResponse
addGraphDefinition(self, templateUid, graphDefinitionId)
Add a new graph definition to a template.
source code
DirectResponse
deleteDataSource(self, uid)
Delete a data source.
source code
DirectResponse
deleteDataPoint(self, uid)
Delete a data point.
source code
DirectResponse
deleteGraphDefinition(self, uid)
Delete a graph definition.
source code
DirectResponse
deleteGraphPoint(self, uid)
Delete a graph point.
source code
DirectResponse
getGraphPoints(self, uid)
Get a list of graph points for a graph definition.
source code
DirectResponse
getInfo(self, uid)
Get the properties of an object.
source code
DirectResponse
addThresholdToGraph(self, graphUid, thresholdUid)
Add a threshold to a graph definition.
source code
DirectResponse
addCustomToGraph(self, graphUid, customId, customType)
Add a custom graph point to a graph definition.
source code
DirectResponse
getGraphInstructionTypes(self, query='')
Get a list of available instruction types for graph points.
source code
DirectResponse
setGraphPointSequence(self, uids)
Sets the sequence of graph points in a graph definition.
source code
DirectResponse
getGraphDefinition(self, uid)
Get a graph definition.
source code
DirectResponse
setGraphDefinition(self, **data)
Set attributes on an graph definition.
source code
DirectResponse
setGraphDefinitionSequence(self, uids)
Sets the sequence of graph definitions.
source code
 
getCollectorTemplate(self, id) source code

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

Inherited from TreeRouter (private): _canDeleteUid

Method Details [hide private]

_getFacade(self)

source code 

Abstract method for child classes to use to get their facade

Overrides: TreeRouter._getFacade
(inherited documentation)

getTemplates(self, id)

source code 

Get all templates.

Parameters:
  • id (string) - not used
Returns: [dictionary]
List of objects representing the templates in tree hierarchy

getDeviceClassTemplates(self, id)

source code 

Get all templates by device class. This will return a tree where device classes are nodes, and templates are leaves.

Parameters:
  • id (string) - not used
Returns: [dictionary]
List of objects representing the templates in tree hierarchy

getAddTemplateTargets(self, query=None)

source code 

Get a list of available device classes where new templates can be added.

Parameters:
  • query (string) - not used
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects containing an available device class UID and a human-readable label for that class

addTemplate(self, id, targetUid)

source code 

Add a template to a device class.

Parameters:
  • id (string) - Unique ID of the template to add
  • targetUid (string) - Unique ID of the device class to add template to
Returns: DirectResponse
Properties:
  • nodeConfig: (dictionary) Object representing the added template
Decorators:
  • @require('Manage DMD')

deleteTemplate(self, uid)

source code 

Delete a template.

Parameters:
  • uid (string) - Unique ID of the template to delete
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getObjTemplates(self, uid)

source code 
Parameters:
  • uid (string) - Identifier for the object we want templates on, must descend from MetricMixin
Returns: DirectResponse
List of templates
Decorators:
  • @require('View')

makeLocalRRDTemplate(self, uid, templateName)

source code 
Parameters:
  • uid (string) - Identifer of the obj we wish to make the template local for
  • templateName (string) - identifier of the template
Decorators:
  • @require('Manage DMD')

removeLocalRRDTemplate(self, uid, templateName)

source code 
Parameters:
  • uid (string) - Identifer of the obj we wish to remove the local template
  • templateName (string) - identifier of the local template
Decorators:
  • @require('Manage DMD')

getThresholds(self, uid, query='')

source code 

Get the thresholds for a template.

Parameters:
  • uid (string) - Unique ID of a template
  • query (string) - not used
Returns: [dictionary]
List of objects representing representing thresholds

getThresholdDetails(self, uid)

source code 

Get a threshold's details.

Parameters:
  • uid (string) - Unique ID of a threshold
Returns: dictionary
Properties:
  • record: (dictionary) Object representing the threshold
  • form: (dictionary) Object representing an ExtJS form for the threshold

getDataPoints(self, uid, query='')

source code 

Get a list of available data points for a template.

Parameters:
  • query (string) - not used
  • uid (string) - Unique ID of a template
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects representing data points

addDataPoint(self, dataSourceUid, name)

source code 

Add a new data point to a data source.

Parameters:
  • dataSourceUid (string) - Unique ID of the data source to add data point to
  • name (string) - ID of the new data point
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

addDataSource(self, templateUid, name, type)

source code 

Add a new data source to a template.

Parameters:
  • templateUid (string) - Unique ID of the template to add data source to
  • name (string) - ID of the new data source
  • type (string) - Type of the new data source. From getDataSourceTypes()
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getDataSources(self, uid)

source code 

Get the data sources for a template.

Parameters:
  • id (string) - Unique ID of a template
Returns: [dictionary]
List of objects representing representing data sources

getDataSourceDetails(self, uid)

source code 

Get a data source's details.

Parameters:
  • uid (string) - Unique ID of a data source
Returns: dictionary
Properties:
  • record: (dictionary) Object representing the data source
  • form: (dictionary) Object representing an ExtJS form for the data source

getDataPointDetails(self, uid)

source code 

Get a data point's details.

Parameters:
  • uid (string) - Unique ID of a data point
Returns: dictionary
Properties:
  • record: (dictionary) Object representing the data point
  • form: (dictionary) Object representing an ExtJS form for the data point

setInfo(self, **data)

source code 

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".

Parameters:
  • uid (string) - Unique identifier of an object
Returns: DirectResponse
Properties:
  • data: (dictionary) The modified object
Decorators:
  • @require('Manage DMD')

addThreshold(self, **data)

source code 

Add a threshold.

Parameters:
  • uid (string) - Unique identifier of template to add threshold to
  • thresholdType (string) - Type of the new threshold. From getThresholdTypes()
  • thresholdId (string) - ID of the new threshold
  • dataPoints ([string]) - List of data points to select for this threshold
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

removeThreshold(self, uid)

source code 

Remove a threshold.

Parameters:
  • uid (string) - Unique identifier of threshold to remove
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getThresholdTypes(self, query=None)

source code 

Get a list of available threshold types.

Parameters:
  • query (string) - not used
Returns: [dictionary]
List of objects representing threshold types

getDataSourceTypes(self, query)

source code 

Get a list of available data source types.

Parameters:
  • query (string) - not used
Returns: [dictionary]
List of objects representing data source types

getGraphs(self, uid, query=None)

source code 

Get the graph definitions for a template.

Parameters:
  • uid (string) - Unique ID of a template
  • query (string) - not used
Returns: [dictionary]
List of objects representing representing graphs

addDataPointToGraph(self, dataPointUid, graphUid, includeThresholds=False)

source code 

Add a data point to a graph.

Parameters:
  • dataPointUid (string) - Unique ID of the data point to add to graph
  • graphUid (string) - Unique ID of the graph to add data point to
  • includeThresholds (boolean) - (optional) True to include related thresholds (default: False)
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

addDataSourcetoGraphDef(self, dataSourceUid, graphUid, includeThresholds=False)

source code 

Add all the datapoints in a datasource to the graph definition.

Parameters:
  • dataSourceUid (string) - Unique ID of the data source to add to graph
  • graphUid (string) - Unique ID of the graph to add data source to
  • includeThresholds (boolean) - (optional) True to include related thresholds (default: False)
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getCopyTargets(self, uid, query='')

source code 

Get a list of available device classes to copy a template to.

Parameters:
  • uid (string) - Unique ID of the template to copy
  • query (string) - (optional) Filter the returned targets' names based on this parameter (default: '')
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects containing an available device class UID and a human-readable label for that class

copyTemplate(self, uid, targetUid)

source code 

Copy a template to a device or device class.

Parameters:
  • uid (string) - Unique ID of the template to copy
  • targetUid (string) - Unique ID of the device or device class to bind to template
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

addGraphDefinition(self, templateUid, graphDefinitionId)

source code 

Add a new graph definition to a template.

Parameters:
  • templateUid (string) - Unique ID of the template to add graph definition to
  • graphDefinitionId (string) - ID of the new graph definition
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

deleteDataSource(self, uid)

source code 

Delete a data source.

Parameters:
  • uid (string) - Unique ID of the data source to delete
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

deleteDataPoint(self, uid)

source code 

Delete a data point.

Parameters:
  • uid (string) - Unique ID of the data point to delete
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

deleteGraphDefinition(self, uid)

source code 

Delete a graph definition.

Parameters:
  • uid (string) - Unique ID of the graph definition to delete
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

deleteGraphPoint(self, uid)

source code 

Delete a graph point.

Parameters:
  • uid (string) - Unique ID of the graph point to delete
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getGraphPoints(self, uid)

source code 

Get a list of graph points for a graph definition.

Parameters:
  • uid (string) - Unique ID of a graph definition
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects representing graph points

getInfo(self, uid)

source code 

Get the properties of an object.

Parameters:
  • uid (string) - Unique identifier of an object
Returns: DirectResponse
Properties
  • data: (dictionary) Object properties
  • form: (dictionary) Object representing an ExtJS form for the object

addThresholdToGraph(self, graphUid, thresholdUid)

source code 

Add a threshold to a graph definition.

Parameters:
  • graphUid (string) - Unique ID of the graph definition to add threshold to
  • thresholdUid (string) - Unique ID of the threshold to add
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

addCustomToGraph(self, graphUid, customId, customType)

source code 

Add a custom graph point to a graph definition.

Parameters:
  • graphUid (string) - Unique ID of the graph definition to add graph point to
  • customId (string) - ID of the new custom graph point
  • customType (string) - Type of the new graph point. From getGraphInstructionTypes()
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getGraphInstructionTypes(self, query='')

source code 

Get a list of available instruction types for graph points.

Parameters:
  • query (string) - not used
Returns: DirectResponse
Properties:
  • data: ([dictionary]) List of objects representing instruction types

setGraphPointSequence(self, uids)

source code 

Sets the sequence of graph points in a graph definition.

Parameters:
  • uids ([string]) - List of graph point UID's in desired order
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getGraphDefinition(self, uid)

source code 

Get a graph definition.

Parameters:
  • uid (string) - Unique ID of the graph definition to retrieve
Returns: DirectResponse
Properties:
  • data: (dictionary) Object representing a graph definition

setGraphDefinition(self, **data)

source code 

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".

Parameters:
  • uid (string) - Unique identifier of an object
Returns: DirectResponse
Properties:
  • data: (dictionary) The modified object
Decorators:
  • @require('Manage DMD')

setGraphDefinitionSequence(self, uids)

source code 

Sets the sequence of graph definitions.

Parameters:
  • uids ([string]) - List of graph definition UID's in desired order
Returns: DirectResponse
Success message
Decorators:
  • @require('Manage DMD')

getCollectorTemplate(self, id)

source code 
Decorators:
  • @require('Manage DMD')