This is a DRAFT Work In Progress - Contents subject to change.
Inventory API
This opCharts API provides access to opCharts inventory data data in a JSON format.
The Inventory API is available in opCharts from version 4.7.0
Authentication is required to access all methods below. See opCharts REST API Reference.
Table of Contents maxLevel 2
Public API for opCharts Inventory "http[s]://server/omk/opCharts/v2/inventory"
...
Query Parameter | Possible Values |
---|---|
properties | Array of property names. If provided only the properties specified will be returned (instead of the whole document). eg: By default the nodes UUID is returned by default if no properties are given |
page | (int) Which page of the requested document to be returned, from 1 .. n, defaults to 1 |
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: for a string, if it starts with regex: or iregex: then a case-sensitive or case-insensitive regular expression match is used. eg: |
sort | 1 | -1 : sort the response with id ascending or descending. |
redact | 0 | 1 : redact the information in configuration. |
...
Property | Description | Example |
| A globally unique ID | 65a5b8b843c6b8c138bc9cab |
| The concept for this inventory | "device" |
| The |
|
| ||
|
| |
| ||
|
| |
| 0 or 1 | |
| ||
| 0 or 1 | |
| The unix timestamp that this inventory record was last updated. |
|
| The | "vrouter_host" |
| The |
|
| array | response |
| The | lab_poller1 |
| An array of the subconcepts for this inventory record | [ "hrsmpcpu" ] |
|
...
You will get a list of all the Inventory subconcepts for the node with node_uuid.
Successful Response
HTTP Status | Body | Description |
---|---|---|
200 OK | Possibly empty JSON array of objects | Each array element is a JSON object with the properties selected by the Request Modifiers (see above). |
Unsuccessful Response
HTTP Status | Body | Description |
---|---|---|
401 Unauthorized | JSON object with an error property | You are not authenticated. |
403 Forbidden | JSON object with an error property | You are not authorized. |
Code Block |
---|
GET HTTP://server/omk/opCharts/v2/nodes/08098577-5d8c-11e9-9614-8a6323fe4840/inventory.json Output:- List of all the distinct subconcepts present in inventory [ "Cisco_CBQoS", "Memory-cpm", "addressTable", "bgpPeer", "cempMemPool", "ciscoMemoryPool", "ciscoNormalizedCPUMem", "cpu_cpm", "entityMib", "env-temp", "interface", "pkts", "pkts_hc", "ospfNbr", "powerSupply" ] |
...
You will get a list of all the Inventory records with the node with node_uuid and the subconcept subconcept.
Successful Response
HTTP Status | Body | Description |
---|---|---|
200 OK | Possibly empty JSON array of objects | Each array element is a JSON object with the properties selected by the Request Modifiers (see above). |
Unsuccessful Response
HTTP Status | Body | Description |
---|---|---|
401 Unauthorized | JSON object with an error property | You are not authenticated. |
403 Forbidden | JSON object with an error property | You are not authorized. |
Code Block |
---|
GET HTTP://server/omk/opCharts/v2/nodes/08098577-5d8c-11e9-9614-8a6323fe4840/inventory/interface.json Output:- List of first 25 node inventory objects ("id" and "node_uuid") sorted by id inside given subconcept. [ { "id": "63195a0341073d2dd339ce47", "node_uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" }, { "id": "63195a0341073d2dd339ce5d", "node_uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" }, { "id": "63195a0341073d2dd339ce74", "node_uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" }, { "id": "63195a0341073d2dd339ce82", "node_uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" }, { "id": "63195a0341073d2dd339ce90", "node_uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" }, { "id": "63195a0341073d2dd339ceba", "node_uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" }, { "id": "63195a0341073d2dd339ced0", "node_uuid": "08098577-5d8c-11e9-9614-8a6323fe4840" } ] |
Similar requests and descriptions with node and subconcept
Request | Response |
---|---|
GET HTTP://server/omk/opCharts/v2/nodes/08098577-5d8c-11e9-9614-8a6323fe4840/inventory/interface.json?limit=50 | Top 50 elements of given node ("id" and "node_uuid") |
GET HTTP://server/omk/opCharts/v2/nodes/08098577-5d8c-11e9-9614-8a6323fe4840/inventory/interface.json?limit=50&page=2 | Top NEXT 50 elements of given node ("id" and "node_uuid") |
GET HTTP://server/omk/opCharts/v2/nodes/08098577-5d8c-11e9-9614-8a6323fe4840/inventory/interface.json?properties=["node_name"] | Top 50 elements of given node ("id" , "node_uuid", "node_name") |
GET HTTP://server/omk/opCharts/v2/nodes/08098577-5d8c-11e9-9614-8a6323fe4840/inventory/interface.json?limit=50&page=2&properties=["data"] | Top NEXT 50 elements of given node ("id" , "node_uuid", "data") |
GET HTTP://server/omk/opCharts/v2/nodes/08098577-5d8c-11e9-9614-8a6323fe4840/inventory/interface.json?properties=["data"]&filter={"data.ifIndex":2} | Top 50 elements of given node filtered by ifIndex=>2 ("id" , "nodes_uuid", "data.ifIndex") |