NAME

Zenoss::API::Router::Template - A JSON/ExtDirect interface to operations on templates

SYNOPSIS

use Zenoss::API;
my $api = Zenoss::API->connect(
    {
        username    => 'zenoss username',
        password    => 'zenoss password',
        url         => 'http://zenossinstance:8080',
    }
);

# Replace SOMEMETHOD() with one of the available methods provided by this package
my $response = $api->template_SOMEMETHOD({parameter1 => 'value', parameter2 => 'value'});

DESCRIPTION

This class is NOT instantiated directly. To call methods from this package create an instance of Zenoss::API. This document serves as a resource of available Zenoss API calls available for use with Zenoss::API.

METHODS

The following is a list of available methods available for interaction with the Zenoss API. Please take note of the arguement requirements, defaults and return content.

$obj->template_getTemplates()

Get all templates.

PARAMETERS

NONE

REQUIRED PARAMETERS

N/A

DEFAULT PARAMETERS

N/A

RETURNS

List of objects representing the templates in tree hierarchy

$obj->template_getDeviceClassTemplates()

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

THIS IS CURRENTLY BROKEN AT THE ZENOSS API LEVEL

$obj->template_getAddTemplateTargets()

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

PARAMETERS

NONE

REQUIRED PARAMETERS

N/A

DEFAULT PARAMETERS

N/A

RETURNS

data: ([dictionary]) List of objects containing an available device class UID and a human-readable label for that class

$obj->template_addTemplate()

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

REQUIRED PARAMETERS

id

targetUid

DEFAULT PARAMETERS

N/A

RETURNS

nodeConfig: (dictionary) Object representing the added template

$obj->template_deleteTemplate()

Delete a template.

PARAMETERS

uid (string) - Unique ID of the template to delete

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_getThresholds()

Get the thresholds for a template.

PARAMETERS

uid (string) - Unique ID of a template

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

List of objects representing representing thresholds

$obj->template_getThresholdDetails()

Get a threshold's details.

PARAMETERS

uid (string) - Unique ID of a threshold

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

record: (dictionary) Object representing the threshold

form: (dictionary) Object representing an ExtJS form for the threshold

$obj->template_getDataPoints()

Get a list of available data points for a template.

PARAMETERS

uid (string) - Unique ID of a template

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

data: ([dictionary]) List of objects representing data points

$obj->template_addDataPoint()

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

REQUIRED PARAMETERS

dataSourceUid

name

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_addDataSource()

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()

REQUIRED PARAMETERS

templateUid

name

type

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_getDataSources()

Get the data sources for a template.

PARAMETERS

id (string) - Unique ID of a template

REQUIRED PARAMETERS

id

DEFAULT PARAMETERS

N/A

RETURNS

List of objects representing representing data sources

$obj->template_getDataSourceDetails()

Get a data source's details.

PARAMETERS

uid (string) - Unique ID of a data source

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

record: (dictionary) Object representing the data source

form: (dictionary) Object representing an ExtJS form for the data source

$obj->template_getDataPointDetails()

Get a data point's details.

PARAMETERS

uid (string) - Unique ID of a data point

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

record: (dictionary) Object representing the data point

form: (dictionary) Object representing an ExtJS form for the data point

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

PARAMETERS

uid (string) - Unique identifier of an object

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

data: (dictionary) The modified object

$obj->template_addThreshold()

Add a threshold.

PARAMETERS

uid (string) - Unique identifier of template to add threshold to

thresholdType (string) - Type of the new threshold. From template_getThresholdTypes()

thresholdId (string) - ID of the new threshold

dataPoints ([string]) - List of data points to select for this threshold

REQUIRED PARAMETERS

uid

thresholdType

thresholdId

dataPoints

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_removeThreshold()

Remove a threshold.

PARAMETERS

uid (string) - Unique identifier of threshold to remove

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_getThresholdTypes()

Get a list of available threshold types.

PARAMETERS

NONE

REQUIRED PARAMETERS

N/A

DEFAULT PARAMETERS

N/A

RETURNS

List of objects representing threshold types

$obj->template_getDataSourceTypes()

Get a list of available data source types.

PARAMETERS

NONE

REQUIRED PARAMETERS

N/A

DEFAULT PARAMETERS

N/A

RETURNS

List of objects representing data source types

$obj->template_getGraphs()

Get the graph definitions for a template.

PARAMETERS

uid (string) - Unique ID of a template

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

List of objects representing representing graphs

$obj->template_addDataPointToGraph()

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) - True to include related thresholds

REQUIRED PARAMETERS

dataPointUid

graphUid

DEFAULT PARAMETERS

{ includeThresholds => JSON::false }

RETURNS

Success message

$obj->template_getCopyTargets()

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

PARAMETERS

uid (string) - Unique ID of the template to copy

query (string) - Filter the returned targets' names based on this parameter

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

{ query => '' }

RETURNS

data: ([dictionary]) List of objects containing an available device class UID and a human-readable label for that class

$obj->template_copyTemplate()

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

REQUIRED PARAMETERS

uid

targetUid

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_addGraphDefinition()

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

REQUIRED PARAMETERS

templateUid

graphDefinitionId

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_deleteDataSource()

Delete a data source.

PARAMETERS

uid (string) - Unique ID of the data source to delete

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_deleteDataPoint()

Delete a data point.

PARAMETERS

uid (string) - Unique ID of the data point to delete

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_deleteGraphDefinition()

Delete a graph definition.

PARAMETERS

uid (string) - Unique ID of the graph definition to delete

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_deleteGraphPoint()

Delete a graph point.

PARAMETERS

uid (string) - Unique ID of the graph point to delete

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_getGraphPoints()

Get a list of graph points for a graph definition.

PARAMETERS

uid (string) - Unique ID of a graph definition

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

data: ([dictionary]) List of objects representing graph points

$obj->template_getInfo()

Get the properties of an object.

PARAMETERS

uid (string) - Unique identifier of an object

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

data: (dictionary) Object properties

form: (dictionary) Object representing an ExtJS form for the object

$obj->template_addThresholdToGraph()

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

REQUIRED PARAMETERS

graphUid

thresholdUid

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_addCustomToGraph()

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()

REQUIRED PARAMETERS

graphUid

customId

customType

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_getGraphInstructionTypes()

Get a list of available instruction types for graph points.

PARAMETERS

NONE

REQUIRED PARAMETERS

N/A

DEFAULT PARAMETERS

N/A

RETURNS

data: ([dictionary]) List of objects representing instruction types

$obj->template_setGraphPointSequence()

Sets the sequence of graph points in a graph definition.

PARAMETERS

uids ([string]) - List of graph point UID's in desired order

REQUIRED PARAMETERS

uids

DEFAULT PARAMETERS

N/A

RETURNS

Success message

$obj->template_getGraphDefinition()

Get a graph definition.

PARAMETERS

uid (string) - Unique ID of the graph definition to retrieve

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

data: (dictionary) Object representing a graph definition

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

PARAMETERS

uid (string) - Unique identifier of an object

REQUIRED PARAMETERS

uid

DEFAULT PARAMETERS

N/A

RETURNS

data: (dictionary) The modified object

$obj->template_setGraphDefinitionSequence()

Sets the sequence of graph definitions.

PARAMETERS

uids ([string]) - List of graph definition UID's in desired order

REQUIRED PARAMETERS

uids

DEFAULT PARAMETERS

N/A

RETURNS

Success message

SEE ALSO

AUTHOR

Patrick Baker <patricksbaker@gmail.com>

COPYRIGHT AND LICENSE

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.