Table of Contents |
---|
Node Resource API
Nodes are gathered from the NMIS installation on the existing server. Each node has a list of resources. Each resource can either be indexed or non-indexed. If non-indexed each resource contains a list of datasets (which are individual data points over time, eg. avgbusy5). If indexed, the resource contains an array, each element in that array contains datasets.
Authentication is required to access all methods below.
API Endpoint
Some of these API endpoints will return HTML or JSON data, to ensure you get JSON data, use the HTTP Header "accept:application/json". Alternatively you can append ".json" onto some requests.
All requests are made under the following base URL:
...
GET /omk/opCharts/nodes/
Retrieves the nodes available to opCharts. No parameters are acceptedavailable to opCharts. No parameters are accepted.
This endpoint requires the use of the "accept:application/json" header, or you can use "GET /omk/opCharts/nodes.json".
Successful Response
Returns an array of strings containing the node names
Code Block | ||
---|---|---|
| ||
[ "odin", "sparkle", "maverick", ] |
...
Anchor | ||||
---|---|---|---|---|
|
...
Retrieves all resources for the specified node. A resource is required when requesting specific datasets or indexed datasets.
Successful Response
Returns an array of resource objects. Each resource object has a value it can be identified by(which can be used in later requests) and a url that the resource value can be appended to in order to fetch information about this resource and it's name which can be displayed to users.
...
GET /omk/opCharts/nodes/[node]/resources/[resource]/datasets.json
Retrieves all datasets for the specified node & resource.
Successful Response
An array of dataset objects. Each dataset object lists it's resource, the value it can be identified by, a url that the value can be appended to (if not ending in .json), tokens used for searching and it's name which can be used for displaying to users.
...
Retrieve all indexes available from a resource. This is only required if the dataset you wish to load is indexed.
Successful Response
Returns a hash, with the name of the resource. A datum array of index objects, these hold the data you are likely looking for. The value attribute holds the identifier for this object. Name is the attribute which can be displayed to users. The "active" property tells you if this index is being collected.
...
Code Block |
---|
{ "name": "cbqos-out", "datum": [ { "classes": [ "InternetControl", "class-default", "Interactive", "Voice", "VPN", "WebTraffic" ], "resource_id": "cbqos-out", "value": "2", "active": 1, "url": "/omk/opCharts/nodes/asgard/resources/cbqos-out/datasets", "tokens": [ "WAN/DSL", "FastEthernet0/1", 2 ], "name": "WAN/DSL -- FastEthernet0/1 -- 2" } ], "header": "cbqos-out" } |
Performance Data
GET/POST node resource dataset (fetch data for a single dataset from a node resource)
...
POST /omk/opCharts/data_model_view/new
BODY WITH JSON OBJECT = { requestData: { contents listed below } }
Request data from a dataset. There are 2 basic ways to request data.
- Request NMIS dataset information for a specific dataset from an RRD file (nmis_rrd)
- Request NMIS graph information, this provides the same data that is displayed in NMIS graphs and are defined by nmis Graph-*.nmis files (nmis_graph)
...
The request structure is not simple. The required inputs are resource, dataset, possibly index.
Required Parameters
Parameters |
---|
{ |
requestData (struct) |
| ||||||||||||||||||||||||||||||||||||||||||||||
} |
...
Request Example
Code Block |
---|
"requestData": { # remove "requestData": { here if posting "model": "nmis_rrd", "model_view": "graph", "data_source": "local_nmis", "parameters": { "start_date_raw": 1401346748, "end_date_raw": 1401951548, "node": "asgard", "graph_type": "nodehealth", "field": "avgBusy5", "resource_index": "", "index_graph_type": "", "axis": "0" }, "options": { } } } |
Successful Response
A successful response will be a hash with 2 objects. The requestObject that was submitted along with a responseObject :
...