Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
themeConfluence
[
  "odin",
  "sparkle",
  "maverick",
]

...


Anchor
Get Node Resources
Get Node Resources
GET node resources (fetch resources for a single node)

...

GET /omk/opCharts/nodes/[node]/resources/[resource]/datasets.json

Retrieves all datasets for the specified node & resource.

...

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.

  1. Request NMIS dataset information for a specific dataset from an RRD file (nmis_rrd)
  2. 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)

 



modelstring"nmis_rrd" or "nmis_graph". nmis_rrd will provide data directly as it is in the RRD files. nmis_graph will provide data after running it through the manipulations done by the NMIS graph
model_viewstring"graph", no other options supported at this time
data_sourcestring"local_nmis", no other options supported at this time
optionsstruct* can be empty for now, so just {}
parametersstruct


start_date_rawnumberunix time for data to start
end_date_rawnumberunix time for data to end
nodestringnode name, found using GET node
graph_typestring

If using nmis_rrd: maps to a resource found using Get Node Resources (value attribute, which is the ID).

If using nmis_graph: maps to the name of the graph if not indexed, maps to the same as nmis_rrd if indexed

fieldstringOnly used for nmis_rrd: maps to the dataset required found using GET node resource datasets (value attribute of desired dataset)
resource_indexstring/numberIf the resource is indexed, the index of the resource required, found using GET node resource indexes
index_graph_typestring

Only used if the resource is indexed:

 nmis_rrd: same as graph_type

nmis_graph: the name of the graph

itemstringCBQoS class name, found by using "Get node resource index"
axisnumber0 or 1, the axis the dataset will group itself into, usually 0
modestringIf using nmis_rrd: Defines the "Consolidation Function" that is used to on the data when it needs to change resolution. Defaults to AVERAGE, other options: MAX, MIN. If changes have been made to default settings not all of these may be available for all time periods

If using nmis_graph: mode/CF functions are built into the graph definitions, after changing the definition reloading the dataset the data will use the new definition.



}
  

...




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 : 

...