You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Status API 

This opCharts API provides access to Status collection data  in a JSON format.

The Status API is available in opCharts from version 4.7.0

Authentication is required to access all methods below. See opCharts REST API Reference.

Public API for opCharts Inventory "http[s]://server/omk/opCharts/v2/status"

We can view opCharts Inventory below using these endpoints - http[s]://server/omk/opCharts/v2/status

API Routes

Each resource has a consistent set of operations

Request Method

Operation

URL Example

id required

Notes

GETread list /server/omk/opCharts/v2/statusnReturns a list of all the status data
(id and node_uuid)
GETread list/server/omk/opCharts/v2/inventory/:inventory_id/statusy

Returns a list of all the Status objects  having inventory id matching inventory_id

(id and node_uuid)

GETread one /server/omk/opCharts/v2/status/idyReturns the details of the requested status record.

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=["event","lastupdate"]

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={"level":"Normal"}

sort

-1 | 1 : sort the response with _id ascending or descending.

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 of opcharts/v2/status for List

GET /omk/opCharts/v2/status

You will get a list of all the Inventory subconcepts in your database.

Successful Response

HTTP Status

Body

Description

200Possibly empty JSON array of stringsEach array element is a JSON string object with the subconcept name

Unsuccessful Response

HTTP Status

Body

Description

401 UnauthorizedJSON object with an error propertyYou are not authenticated.
403 ForbiddenJSON object with an error propertyYou are not authorized.

Example

GET HTTP://server/omk/opCharts/v2/status.json

Output:- List of all the distinct subconcepts present in inventory
[
	{
		"id": "648a0e4ca44a3ab377278383",
		"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
	},
	{
		"id": "648a0e4ca44a3ab377278389",
		"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
	},
	{
		"id": "648a0e4ca44a3ab37727838c",
		"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
	},
	{
		"id": "648a0e4ca44a3ab377278538",
		"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
	},
...
]


GET of opcharts/v2/inventory/inventory_id/status for List

GET /omk/opCharts/v2/inventory/inventory_id/status

You will get a list of the first 25 status objects for the given inventory_id in your database.

You can use Request Modifiers (see above) for filtering, pagination, and selecting properties.

Successful Response

HTTP Status

Body

Description

200Possibly empty JSON array of stringsEach array element is a JSON string object with the subconcept name

Unsuccessful Response

HTTP Status

Body

Description

400 Bad RequestJSON object with an error property
401 UnauthorizedJSON object with an error propertyYou are not authenticated.
403 ForbiddenJSON object with an error propertyYou are not authorized.
404 Not FoundJSON object with an error propertyYou are authenticated but not authorised to view this object.
404 Not FoundJSON object with an error property

The error property contains an explanation of what went wrong
with your request, e.g. if you request a non-existent object.


Example

GET HTTP://server/omk/opCharts/v2/inventory/648a0baea44a3ab37721db6d/status.json

Output :- List of first 25 status objects ("id" and "node_uuid") sorted by id in ascending order.  
[
	{
		"id": "648a0e4ca44a3ab377278383",
		"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
	},
	{
		"id": "648a0e4ca44a3ab377278389",
		"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
	},
	{
		"id": "648a0e4ca44a3ab37727838c",
		"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
	}
]

Similar requests and descriptions with subconcepts

RequestResponse
GET http://server/omk/opCharts/v2/inventory/648a0baea44a3ab37721db6d/status.json

First 50 elements sorted by id

("id" and "node_uuid")

GET http://server/omk/opCharts/v2/inventory/648a0baea44a3ab37721db6d/status.json?limit=50&page=2

Next 50 elements sorted by id

("id" and "node_uuid")

GET http://server/omk/opCharts/v2/inventory/648a0baea44a3ab37721db6d/status.json?limit=50&properties=["node_name"]

First 50 elements sorted by id

("id" , "node_uuid", "node_name")

GET http://server/omk/opCharts/v2/inventory/648a0baea44a3ab37721db6d/status.json?imit=50&page=2&properties=["event"]

Next 50 elements sorted by id

("id" , "node_uuid", "event")

GET http://server/omk/opCharts/v2/inventory/648a0baea44a3ab37721db6d/status.json?limit=50&properties=["node_name"]&filter={"level":"Normal"}

First 50 elements sorted by id, filtered by level = Normal

("id" , "node_uuid", "node_name")

GET http://server/en/omk/opCharts/v2/inventory/648a0baea44a3ab37721db6d/status.json?properties=["event","lastupdate"]&filter={"level":"Normal"}

First 25 elements sorted by id displaying 2 properties

[
    {
        "event": "Proactive Response Time",
        "id": "648a0e4ca44a3ab377278383",
        "lastupdate": 1687213025,
        "node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
    },
    {
        "event": "Proactive Reachability",
        "id": "648a0e4ca44a3ab377278389",
        "lastupdate": 1687213025,
        "node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
    }
]

GET of opcharts/v2/status/id 

GET /omk/opCharts/v2/status/id

You will get a single objects for the given id in your database.

You can use Request Modifiers (see above) for filtering, pagination, and selecting properties.

Successful Response

HTTP Status

Body

Description

200Possibly empty JSON array of stringsEach array element is a JSON string object with the subconcept name

Unsuccessful Response

HTTP Status

Body

Description

401 UnauthorizedJSON object with an error propertyYou are not authenticated.
403 ForbiddenJSON object with an error propertyYou are not authorized.

Example

http://server/omk/opCharts/v2/status/648a0e4ca44a3ab377278383.json
{
"class": null,
"cluster_id": "9ed25c17-9ec2-4034-94e6-f6c932ad273b",
"element": null,
"event": "Proactive Response Time",
"id": "648a0e4ca44a3ab377278383",
"index": null,
"inventory_id": "648a0baea44a3ab37721db6d",
"lastupdate": 1687213025,
"level": "Normal",
"method": "Threshold",
"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa",
"property": "response",
"status": "ok",
"type": "health",
"value": 8.59
}




Similar requests and descriptions with inventory id

RequestResponse
GET HTTP://server/omk/opCharts/v2/status/648a0e4ca44a3ab377278383.jsonRaw inventory element with given object id
GET HTTP://server/omk/opCharts/v2/status/648a0e4ca44a3ab377278383.json?properties=["event"]

Raw inventory element with given object id, event and node_uuid

{"event": "Proactive Response Time",
"id": "648a0e4ca44a3ab377278383",
"node_uuid": "8da86248-40f3-4c92-90b6-736bb66814aa"
}

  • No labels