Inventory API
This opCharts API provides access to opCharts inventory data in a JSON format.
Authentication is required to access all methods below.
Public API for Enterprise Services "http[s]://server/omk/opCharts/v2/"
We can view Enterprise Services below using these endpoints - http[s]://server/omk/opCharts/v2/inventory
API Routes
Each resource has a consistent set of operations
Request Method | Operation | URL Example | id required | Notes |
---|---|---|---|---|
GET | read list | /server/omk/opCharts/v2/inventory | n | Returns a list of all the inventory subconcepts |
GET | read one | /server/omk/opCharts/v2/inventory/(id or subconcept) | y | Returns the details of inventory data. |
Request Modifiers (query parameters)
The properties request modifier tells opCharts which properties you would like listed, query limits the requested resources to only those that match all criteria given. This collection can paginated, it is also limited to 25 results by default (this could be subject to change in future opCharts versions) use the limit query parameter to request more nodes
Not all requests will use all request modifiers.
Query Parameter | Possible Values |
---|---|
properties | Array of property names. If provided only the properties specified will be returned (instead of the whole document. eg: properties=["configuration.customer", "configuration.group"] By default the nodes UUID is returned by default if no properties are given |
page | (int) Which page of the requested document to returned |
limit | (int) How many results are returned, defaults to 25 |
filter | 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: filter={"configuration.group":"NMIS8","catchall.data.nodestatus": "reachable"} (which is "configuration.group"="NMIS8" AND "catchall.data.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:
GET HTTP://server/omk/opCharts/v2/inventory.json Output:- List of all the distinct subconcepts present in inventory [ "health", "Host_Health", "laload", "mib2ip", "systemStats", "tcp", "WindowsProcessor", "hrwin", "nodehealth", "NetFlowStats", "RouteNumber", "Buffers" ]
GET HTTP://server/omk/opCharts/v2/inventory/interface.json Output :- List of first 25 inventory objects ("_id" and "nodes.uuid") sorted by nodes.name. [ { "_id": "63958e8d41073d2dd381d606", "nodes": { "uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" } }, { "_id": "63958e9441073d2dd3822365", "nodes": { "uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" } }, { "_id": "63958e9041073d2dd381fbb7", "nodes": { "uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" } }, { "_id": "63958e9641073d2dd3823095", "nodes": { "uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" } }, ]
Similar requests and descriptions with subconcepts
Request | Response |
---|---|
GET HTTP://server/omk/opCharts/v2/inventory/interface.json?limit=50 | Top 50 elements sorted by nodes.name ("_id" and "nodes.uuid") |
GET HTTP://server/omk/opCharts/v2/inventory/interface.json?limit=50&page=2 | Top NEXT 50 elements sorted by nodes.name ("_id" and "nodes.uuid") |
GET HTTP://server/omk/opCharts/v2/inventory/interface.json?limit=50&properties=["nodes.name"] | Top 50 elements sorted by nodes.name ("_id" , "nodes.uuid", "nodes.name") |
GET HTTP://server/omk/opCharts/v2/inventory/interface.json?limit=50&page=2&properties=["inventory.data"] | Top NEXT 50 elements sorted by nodes.name ("_id" , "nodes.uuid", "inventory.data") |
Similar requests and descriptions with inventory id
Request | Response |
---|---|
GET HTTP://server/omk/opCharts/v2/inventory/63195a0341073d2dd339ce82.json | Raw inventory element with given object id |
GET HTTP://server/omk/opCharts/v2/inventory/63195a0341073d2dd339ce82.json?properties=["inventory.data"] | Raw inventory element with given object id ("_id", "inventory.data" and "nodes.uuid") |