opCore Integration (API version 1, Node config/info/status)
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.
When listing resources (viewing the index) the default behaviour is to show only what has been asked for, by default only showing the ID's and modifiers will build up the info requested. When an individual resource is requested (show) all info is provided by default and modifiers will pair down the info provided.
Authentication is required to access all methods below.
All requests are made under the following base URL:
Request Modifiers (query parameters)
The properties request modifier tells opCore which properties you would like listed, query limits the requested resources to only those that match all criteria given.
|Query Parameter||Possible Values|
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.
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:
This will query all nodes that are in the group NMIS8 and return their nodestatus':
opCore provides access to all known nodes in the system. Nodes can be listed or viewed individually.
node_id is a UUID, assigned by NMIS, it will be in this form:
Retrieves a list of all node id's/names, returns them as an array. Accepts all modifiers. If property modifier is set, the results will be an array of objects (hashes) with the properties requested found inside the object (hash). This request will always return the node_id, along with any other info listed in properties.
Retrieves the specified node object (hash) and returns all known info about it (so it may be large), accepts properties request modifier. It is recommended to use the properties query modifier to narrow down the data returned to only the data required.