...
Code Block | ||
---|---|---|
| ||
[ "odin", "sparkle", "maverick", ] |
Anchor | ||||
---|---|---|---|---|
|
GET /omk/opCharts/nodes/[node]/resources/
...
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
...
requestData | { | |||
parameters | { | #holds general parameters that might be used to gather several datasets for the same graph | ||
time_period | "specific_time" or "time_difference. When specific_time is specified the times are used as-is. When time_difference is specified, the times given are subtracted, that period is then applied to the current time being the stop_date and start_date = current_time - period | |||
start_date | Any parse-able date, eg "16-May-2014 09:24:56", usage specified by time_period | |||
end_date | Any parse-able date, eg "23-May-2014 09:24:56", usage specified by time_period | |||
} | ||||
options | {} | |||
dataset | { | |||
name | can be anything, unused but will be returned back in the response | |||
type | "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 | |||
parameters | { | |||
node | maps to a node found using GET node | |||
graph_type | nmis_rrd: maps to a resource found using Get Node Resources (value attribute, which is the ID) nmis_graph: maps to the name of the graph if not indexed, maps to the same as nmis_rrd if indexed | |||
resource_index | If the resource is indexed, the index of the resource required | |||
index_graph_type | Only used if the resource is indexed: nmis_rrd: nmis_graph: the name of the graph | |||
field | Only used for nmis_rrd: maps to the dataset required found using GET node resource datasets (value attribute of desired dataset) | |||
axis | 0 or 1, the axis the dataset will group itself into, usually 0 | |||
} | ||||
options | { | |||
datasetTitle | The title the dataset will return with itself | |||
} | ||||
} | ||||
} |
Parameter | Description |
---|---|
node | node id (name) provided by API call |
graph_type | resource name provided by API call above |
index_graph_type | |
field | dataset id provided by API call |
Request Example
Code Block |
---|
requestData = JSON( {
"model_view": "graph",
"dataset": {
"data_source": "local_nmis",
"parameters": {
"type" : "nmis_rrd",
"resource_index": "2",
"graph_type": "interface",
"lineType": "line",
"index_graph_type": "ifInOctets",
"axis": "0",
"node": "thor",
"translation": "",
"field": ""
},
"options": {
"datasetTitle": ""
}
},
"parameters": {
"time_period": "specific_time",
"start_date": "23-May-2014 00:14:40",
"end_date": "23-May-2014 08:14:40"
},
"options": {
"titleText": "Interface Average Bits"
}
} |
...