Enterprise Services API
This opCharts API provides access to 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.
.
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 |
---|---|---|---|---|
GET | read list | /server/omk/opCharts/v2/enterprise_services | n | Returns a list of Enterprise Services. |
GET | read one | /server/omk/opCharts/v2/enterprise_services/id | y | Returns 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 a .json
suffix, eg /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 " |
Successful Response
HTTP Status | Body | Description |
---|---|---|
200 | Possibly empty JSON array of objects | Each 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 Unauthorized | JSON object with an error property | You are not authenticated. |
403 Forbidden | JSON object with an error property | You 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>.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 |
---|---|
200 | JSON object with all known Enterprise Service properties. |
Unsuccessful Response
HTTP Status | Body | Description |
---|---|---|
400 Bad Request | JSON object with an error property | |
401 Unauthorized | JSON object with an error property | You are not authenticated. |
404 Not Found | JSON object with an error property | You are authenticated but not authorised to view this Enterprise Service in opCharts. |
404 Not Found | JSON object with an error property | The |
Enterprise Service properties
The following tables represents theproperties of an Enterprise Service.
Property | Description | Example |
| A globally unique Enterprise Service ID | "63576103ad794974594a1f11" |
name | The name of the Enterprise Service. This is used for identifying the Enterprise Service | "John Test" |
description | A long description of the Enterprise Service | "This is a test Enterprise Service" |
node_name | The name of the node that is created and/or used to store the status and events for the Enterprise Service. | "john_test_ES" |
frequency | How frequently the status of the Enterprise Service is recalculated. | 60 |
last_updated | The time that these status metrics were last recalculated. The metrics are updated with a frequency of frequency seconds. | 1682489067 |
overall_status | The 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" |
interface_state | If any Interface is marked Down, the Interface State is marked Down, otherwise it is Normal. | "Normal" |
interface_status | A decimal number between 0 (bad) and 100 (good) inclusive representing the status of the interfaces in the Enterprise Service. The Interface Status is calculated from the status events for the Interfaces by aggregating all the Interface-related status event levels and averaging them out to a value from 0% to 100%. | 100 |
interface_status_level | A status level categorizing the interface_status , into traffic light colours. | "Normal" |
interfaces_reachable | A count of the number of interfaces that are reachable or null if there are none. | null |
interfaces_unreachable | A count of the number of interfaces that are unreachable or null if there are none. | 0 |
node_state | If any Node is unreachable, the Node State is marked Down. If any Node is reachable, but it is not at its optimal level/health, the Node State is marked Degraded, otherwise it is Normal. | "Down" |
node_status | A decimal number between 0 (bad) and 100 (good) inclusive representing the status of the nodes in the Enterprise Service. The Node Status is calculated from the status events for the Nodes. It aggregates the status event levels and presents an average of 0% to 100% | 98.3333333333333 |
node_status_level | A status level categorizing the node_status , into traffic light colours. | "Minor" |
nodes_up | A count of the number of nodes that are reachable or null if there are none. | 1 |
nodes_degraded | A count of the number of nodes that are degraded or null if there are none. | 1 |
nodes_down | A count of the number of nodes that are down or null if there are none. | 1 |
nodes_total | A count of the total number of nodes in the Enterprise Service or null if there are none. | 3 |
service_state | If any Monitored Service is marked Down, then the Service State is marked Down, otherwise it is Normal. | "Down" |
service_status | A decimal number between 0 (bad) and 100 (good) inclusive representing the status of the interfaces in the Enterprise Service. The Service Status is calculated from the status events for the Services. It aggregates the status event levels and presents an average of 0% to 100% | 0 |
service_status_level | A status level categorizing the service_status , into traffic light colours. | "Fatal" |
services_degraded | A count of the number of monitored services that are degraded or null if there are none. | 0 |
services_reachable | A count of the number of monitored services that are reachable or null if there are none. | 0 |
services_unreachable | A count of the number of monitored services that are unreachable or null if there are none. | 1 |
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 request modifiers 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.json |
Code Block |
/63fdd07e0454aa367e368b0b.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 ################################## GET HTTP://server/omk/opCharts/v2/enterprise_services/"_id".json.json ************* OUTPUT **************** [ { description: "Show core network", frequency: "60", id: "63f6fda90454aa0265333e61", interface_state: "Normal", interface_status: 100, interface_status_level: "Normal", interfaces_reachable: null, interfaces_unreachable: 0, last_updated: 1682570689, name: "Core Network", node_name: "core_network_es", node_state: "Normal", node_status: 96.6666666666667, node_status_level: "Minor", nodes_degraded: 1, nodes_down: 0, nodes_total: 1, nodes_up: 0, overall_status: "Degraded", service_state: "Normal", service_status: 100, service_status_level: "Normal", services_degraded: 0, services_reachable: 1, services_unreachable: 0 }, { 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 } ] |