Versions Compared

Key

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

Table of Contents

opCore Integration (API version 1, Node config/info/status)

opCore API V1 is supported in opCharts 3.X, for opCharts version 4.0.9 or greater, please refer to opCore API V2

opCore provides access to common data shared through all Opmantek applications.  Not all applications expose or use all parts of opCore, opCharts allows access to the functionality below. 

...

Not all requests will use all request modifiers. Arrays / KVP's are url encoded JSON. E.G.  javascript: urlencode(JSON.stringify(array)); perl: URI::Escape::uri_escape(encode_json($array));

Query ParameterPossible Values
properties

Array of property names. If provided only the properties specified will be returned (instead of the whole document), special property of opcore_all_properties will return all known properties.

eg: properties=["status.nodeModel","info.system.cbqos"]

query

Array of key=value pairs, but coded in an array. Applied to the list of results in the order they are given. If an application key is provided that will be applied first.

eg: query=["config.group","NMIS8","status.nodestatus","reachable"] (which is "config.group"="NMIS8" AND "status.nodestatus"="reachable" )

Examples of how to use the request modifiers can be found in the response blocks below.  In general, the queries will look something like this: 

...

Code Block
# no properties specified, all data is returned, this will have some common data structures and some specific to the node / model
# GET /omk/opCharts/v1/nodes/UUID1
{
	"node_id": "$UUID1",
	"name": "node1"
	"config": { ... full of infodata from this nodes Nodes.nmis section ... },
	"info": { ... full of info data from this nodes "name-node.json" file ... },
	"status": { ... full of info data from this nodes nmis-nodesum.json section ... },
	...
}
# properties=["node_id","config.group","info.system.sysDescr"]
# GET /omk/opCharts/v1/nodes/UUID1?properties=["node_id","config.group","info.system.sysDescr"]
{
	"node_id": "$UUID1",
	"config": {
		group: "group1"
	},
	info: {
		system: {
			sysDescr: "something really long and full of great info"
		}
	}
}

...