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

Compare with Current View Page History

« Previous Version 10 Current »

Enterprise Services API 

This opCharts API provides access to the data of Enterprise Services in a JSON format.

Authentication is required to access all methods below.

Public API for Enterprise Services "http[s]://server/omk/opCharts/v2/enterprise_services"

We can view Enterprise Services below using these endpoints - http[s]://server/omk/opCharts/v2/enterprise_services

API Routes

Each resource has a consistent set of operations

Request Method

Operation

URL Example

id required

Notes

GETread list /server/omk/opCharts/v2/enterprise_servicesnReturns a list of Enterprise Services.
GETread one /server/omk/opCharts/v2/enterprise_services/idyReturns the details of one Enterprise Service.

GET of /v2/enterprise_services for List

GET /omk/opCharts/v2/enterprise_services

If your GET call provides an Accept header indicating JSON, or if you use /v2/enterprise_services.json as URI, then opCharts will look for matching Enterprise Services and return their properties in the form of a JSON object, an array of Enterprise Services. Extra query parameters can be used to narrow down the listing or search for particular Enterprise Services only; without parameters you will get all Enterprise Services.

Optional Query Parameters

Parameter

Description

search

Search criteria for matching Enterprise Services. The search expression is a hash of field-name, search value pairs.

Example:

http://athena.opmantek.net/en/omk/opCharts/v2/enterprise_services.json?search={"name":"John%20Test"}

You can use "regex:<regular expression>" or a plain text string, or iregex: for case-insensitive regex.


Successful Response

HTTP Status

Body

Description

200Possibly empty JSON array of objectsEach array element is a JSON object with the raw properties of the Enterprise Service in question, described in known Enterprise Service properties.

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.

GET of /v2/enterprise_services/<id> for Read

If your GET call provides an accept header indicating application/json or if you use /omk/opCharts/v2/enterprise_services/id/<id>.json as URI, then the Enterprise Service will be looked up and all properties will be returned in the form of a JSON object.

Successful Response

HTTP Status

Body

200JSON object with all known Enterprise Service properties.

Unsuccessful Response

HTTP Status

Body

Description

400 Bad RequestJSON object with an error property
401 UnauthorizedJSON object with an error propertyYou are not authenticated.
404 Not FoundJSON object with an error propertyYou are authenticated but not authorised to view this Enterprise Service in opCharts.
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 Enterprise Service.

Enterprise Service properties

The following tables represents the properties of an Enterprise Service.


Property

Description

Example

id

A globally unique Enterprise Service ID

"63576103ad794974594a1f11"
name
"John Test"
description
"This is a test Enterprise Service"
node_name
"john_test_ES"
frequency
60



last_updatedThe time that these status metrics were last recalculated. The metrics are updated with a frequency of frequency seconds.1682489067
overall_statusThe Overall Status can be Up, Degraded or Down. The Overall Status of the Enterprise Service is calculated from the worst of the Node State, Interface State and Service State.DOWN"Down"



interface_state
"Normal"
interface_statusA decimal number between 0 (bad) and 100 (good) inclusive representing the status of the interfaces in the Enterprise Service100
interface_status_level
"Normal"
interfaces_reachable
null
interfaces_unreachable
0



node_state
"Down"
node_status

A decimal number between 0 (bad) and 100 (good) inclusive representing the status of the interfaces in the Enterprise Service

The Node Status is calculated from the status events for the Node. It aggregates the status event levels and presents an average of 0% to 100%

98.3333333333333
node_status_level
"Minor"
nodes_up
1
nodes_degraded
1
nodes_down
1
nodes_total
3



service_state
"Down"
service_status
0
service_status_level
"Fatal"
services_degraded
0
services_reachable
0
services_unreachable
1


Limitations

API Endpoint

All requests are made under the following base URL:

http[s]://server/omk/opCharts/v2/enterprise_services


Examples of how to use the API can be found in the response blocks below.  In general, the queries will look something like this: 
GET HTTP://server/omk/opCharts/v2/enterprise_services/id.json
 
************* OUTPUT ****************   [
{
    description: "This is a test Enterprise Service",
    frequency: "30",
    id: "63fdd07e0454aa367e368b0b",
    interface_state: "Normal",
    interface_status: 100,
    interface_status_level: "Normal",
    interfaces_reachable: null,
    interfaces_unreachable: 0,
    last_updated: 1682489067,
    name: "John Test",
    node_name: "john_test_ES",
    node_state: "Down",
    node_status: 98.3333333333333,
    node_status_level: "Minor",
    nodes_degraded: 1,
    nodes_down: 1,
    nodes_total: 3,
    nodes_up: 1,
    overall_status: "Down",
    service_state: "Down",
    service_status: 0,
    service_status_level: "Fatal",
    services_degraded: 0,
    services_reachable: 0,
    services_unreachable: 1
}


   ##################### List Resources ##################################

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

************* OUTPUT ****************


[
  {
    "_id": "63576103ad794974594a1f11",
    "active": "1",
    "created_at": 1666670851,
    "created_by": "johns",
    "data": {
      "state": {
        "interfaces": {
          "reachable": null,
          "unreachable": null
        },
        "monitored_services": {
          "degraded": null,
          "reachable": null,
          "unreachable": null
        },
        "nodes": {
          "degraded": 0,
          "reachable": 1,
          "total": 1,
          "unreachable": 0
        }
      },
      "status": {
        "interfaces": null,
        "monitored_services": null,
        "nodes": 100.0
      }
    },
    "data_source_type": "enterprise_service",
    "description": "A test for Evelyn",
    "enabled": true,
    "frequency": "60",
    "last_updated": 1680479710,
    "map": "",
    "name": "The apollo web page",
    "node_name": "apollo_entserv",
    "result": {
      "state": {
        "interfaces": {
          "unreachable": null
        },
        "monitored_services": {
          "unreachable": null
        },
        "nodes": {
          "unreachable": "Normal"
        },
        "overall": "Up"
      },
      "status": {
        "interfaces": null,
        "monitored_services": null,
        "nodes": "Normal"
      },
      "threshold": {
        "state_nodes_unreachable": 0,
        "status_nodes": 100
      }
    },
    "version": 1
  },
  {
    "_id": "635d136fad79497d1f5b2a41",
    "active": "1",
    "created_at": 1667044207,
    "created_by": "johns",
    "data": {
      "state": {
        "interfaces": {
          "reachable": null,
          "unreachable": null
        },
        "monitored_services": {
          "degraded": null,
          "reachable": null,
          "unreachable": null
        },
        "nodes": {
          "degraded": 0,
          "reachable": 1,
          "total": 1,
          "unreachable": 0
        }
      },
      "status": {
        "interfaces": null,
        "monitored_services": null,
        "nodes": 100.0
      }
    },
    "data_source_type": "enterprise_service",
    "description": "John Test",
    "enabled": true,
    "frequency": "60",
    "last_updated": 1680479754,
    "map": "",
    "name": "John Test",
    "node_name": "JohnES",
    "result": {
      "state": {
        "interfaces": {
          "unreachable": null
        },
        "monitored_services": {
          "unreachable": null
        },
        "nodes": {
          "unreachable": "Normal"
        },
        "overall": "Up"
      },
      "status": {
        "interfaces": null,
        "monitored_services": null,
        "nodes": "Normal"
      },
      "threshold": {
        "state_nodes_unreachable": 0,
        "status_nodes": 100
      }
    },
    "version": 1
  },
  {
    "_id": "63688b6ead79493a96602191",
    "active": "1",
    "created_at": 1667795822,
    "created_by": "pallavip",
    "data": {
      "state": {
        "interfaces": {
          "reachable": null,
          "unreachable": null
        },
        "monitored_services": {
          "degraded": null,
          "reachable": null,
          "unreachable": null
        },
        "nodes": {
          "degraded": null,
          "reachable": null,
          "total": null,
          "unreachable": null
        }
      },
      "status": {
        "interfaces": null,
        "monitored_services": null,
        "nodes": null
      }
    },
    "data_source_type": "enterprise_service",
    "description": "Test",
    "enabled": true,
    "frequency": "60",
    "last_updated": 1680479706,
    "map": "ESM Example Map2",
    "name": "Test 123",
    "node_name": "Test",
    "result": {
      "state": {
        "interfaces": {
          "unreachable": null
        },
        "monitored_services": {
          "unreachable": null
        },
        "nodes": {
          "unreachable": null
        },
        "overall": "Up"
      },
      "status": {
        "interfaces": null,
        "monitored_services": null,
        "nodes": null
      },
      "threshold": {
        
      }
    },
    "version": 1
  }
]
  • No labels