Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Enterprise Services API 

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

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.

pare down the info provided.

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 /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

o_start, o_end

Start and end of the period you are interested in.
Takes all standard opEvents Date/Time formats and UNIX seconds.

Note, you should pass o_summarise=1 to make sure UNIX time is not rounded.

o_nodeName of the node you are interested in.
You can use "regex:<regular expression>" or a plain text string.
ev_event_nameName of the event you are interested in.
You can use "regex:<regular expression>" or a plain text string.
ev_event_typeType of the event, i.e. what source it came from.
e.g: nmis_eventlogapi.
ev_event_elementElement in question. Not present for all events.
Regex or plain text string.
ev_event_detailsDetails that were supplied with the event. Not present for all events.
Regex or plain text string.


Successful Response

HTTP Status

Body

Description

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

Unsuccessful Response

HTTP Status

Body

Description

401N/AYou are not authenticated.
403N/AYou are not authorized.
404N/AYou are authenticated but not authorised to view Enterprise Services.
200Empty JSON arrayYour request was valid, but there were no matching Enterprise Services.

GET of /enterprise_services/<id> for Read

If your GET call provides an Accept header indicating 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 event properties.

Unsuccessful Response

HTTP Status

Body

Description

400 Bad Request

401 UnauthorizedN/AYou are not authenticated.
404 Not FoundN/AYou 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.

Limitations

API Endpoint

All requests are made under the following base URL:

Code Block
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: 

...

Code Block
GET HTTP://server/omk/opCharts/v2/enterprise_services/"_id".json
 
************* OUTPUT ****************
 
  "_id": "63688b6ead79493a96602191",
  "active": "1",
  "created_at": 1667795822,
  "created_by": "pallavip",
  "current_user_privileges": {
    "create": 1,
    "delete": 1,
    "read": 1,
    "update": 1
  },
  "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": 1680479586,
  "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
}


##################### 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
  }
]

...