API Gateway Availability and Health Status
You can monitor the availability and health status of API Gateway using the Availability REST API. The Availability API is used to report the overall health of the API Gateway.
The REST API is not deployed by default but can be defined by importing the Swagger file APIGatewayAvailability.json from the folder located at SAG_Root/IntegrationServer/instances/default/packages/WmAPIGateway/resources/apigatewayservices. For details, see webMethods API Gateway User's Guide.
You can check API Gateway health using the HTTP requests against http://localhost:5555/gateway/availability. This REST call also verifies the exposure and availability of the API Gateway REST API. You must have the View administration configurations privileges to invoke the Availability API to view the availability and health status of API Gateway.
Each health check request displays a status field as the first entry. The status can have the values green, yellow or red describing the overall status of the components to check. This means that when any of the components signals a problem, then the status is set to red.
The REST API provides the following resources and methods:
GET /gateway/availability/adminThe request retrieves the availability and health status of the API Gateway administration service (UI, Dashboards).
Request: GET http://localhost:5555/gateway/availability/admin
HTTP response looks as follows:
{
"status": "red",
"ui": {
"status": "green",
"response_time_ms": "316"
},
"kibana": {
"error": "HttpResponse: 503 (Service Unavailable): Kibana server is not ready yet",
"status": "red"
}
}
The sample HTTP response shows a red status since Kibana is not available.
GET /gateway/availability/engine The request retrieves the availability and health status of the API Gateway to process API invocations and requests (ElasticSearch cluster, IS and Terracotta).
Request: GET http://localhost:5555/gateway/availability/engine
HTTP response looks as follows:
{
"status": "green",
"elasticsearch": {
"cluster_name": "SAG_EventDataStore",
"status": "green",
"number_of_nodes": "3",
"number_of_data_nodes": "3",
"timed_out": "false",
"active_shards": "236",
"initializing_shards": "0",
"unassigned_shards": "0",
"task_max_waiting_in_queue_millis": "0",
"port_9240": "ok",
"response_time_ms": "29"
},
"is": {
"status": "green",
"diskspace": {
"status": "up",
"free": "8249233408",
"inuse": "2476650496",
"threshold": "1072588390",
"total": "10725883904"
},
"memory": {
"status": "up",
"freemem": "252558496",
"maxmem": "954728448",
"threshold": "55679385",
"totalmem": "556793856"
},
"servicethread": {
"status": "up",
"avail": "71",
"inuse": "4",
"max": "75",
"threshold": "7"
},
"response_time_ms": "315"
},
"terracotta": {
"status": "green",
"nodes": "1",
"healthy_nodes": "1",
"response_time_ms": "176"
}
}
The overall status is green since all components work as expected.
GET /gateway/availability/externalServices The request retrieves the availability of external services accessed by API Gateway. The external services include destinations and external accounts. The checked external accounts include Service registries and Integration Servers.
The status field of externalServices displays the values green or yellow, if at least one of the destination resources is not available. In case of a problem, the error field displays the details of the problem encountered.
Request: GET http://localhost:5555/gateway/availability/externalServices
HTTP response looks as follows:
{
"status": "yellow",
"destinations": [
{
"type": "centrasite",
"name": "centrasite",
"status": "yellow",
"error": "Port 53307 not active",
"response_time_ms": "1006"
},
{
"type": "centrasite",
"name": "centrasite_snmp",
"status": "yellow",
"error": "Port 8181 not active",
"response_time_ms": "1005"
},
{
"type": "api_portal",
"name": "api_portal",
"status": "not configured",
"response_time_ms": "9"
},
{
"type": "snmp",
"name": "snmp",
"status": "yellow",
"error": "Port 8189 not active",
"response_time_ms": "1004"
},
{
"type": "email",
"name": "email",
"status": "green",
"response_time_ms": "9"
},
{
"type": "elasticsearch",
"name": "elasticsearch",
"status": "not configured",
"response_time_ms": "0"
}
],
"external_accounts": [
{
"type": "service_registry",
"name": "ServiceConsulDefault",
"status": "green",
"response_time_ms": "12"
},
{
"type": "service_registry",
"name": "EurekaDefault",
"status": "yellow",
"error": "Error: HttpResponse: 500 (Connect to http://daefermion3:9092 failed): ",
"response_time_ms": "1026"
}
]
}
The sample response shows the status of all external services including those that are not configured. As the CentraSite destination is not properly configured, as shown in the sample response, this turns the overall status to yellow.
GET /gateway/availability/all The request retrieves the availability of the administration service of the policy enforcement engine and of the external services accessed by API Gateway.
Request: GET http://localhost:5555/gateway/availability/all
HTTP response looks as follows:
{
"status": "red",
"ui": {
"status": "green",
"response_time_ms": "4"
},
"kibana": {
"error": "HttpResponse: 503 (Service Unavailable): Kibana server is not ready yet",
"status": "red"
},
"elasticsearch": {
"cluster_name": "SAG_EventDataStore",
"status": "green",
"number_of_nodes": "3",
"number_of_data_nodes": "3",
"timed_out": "false",
"active_shards": "236",
"initializing_shards": "0",
"unassigned_shards": "0",
"task_max_waiting_in_queue_millis": "0",
"port_9240": "ok",
"response_time_ms": "7"
},
"is": {
"status": "green",
"diskspace": {
"status": "up",
"free": "8249327616",
"inuse": "2476556288",
"threshold": "1072588390",
"total": "10725883904"
},
"memory": {
"status": "up",
"freemem": "232997664",
"maxmem": "954728448",
"threshold": "57094963",
"totalmem": "570949632"
},
"servicethread": {
"status": "up",
"avail": "71",
"inuse": "4",
"max": "75",
"threshold": "7"
},
"response_time_ms": "127"
},
"terracotta": {
"status": "green",
"nodes": "1",
"healthy_nodes": "1",
"response_time_ms": "114"
},
"destinations": [
{
"type": "centrasite",
"name": "centrasite",
"status": "yellow",
"error": "Port 53307 not active",
"response_time_ms": "1006"
},
{
"type": "centrasite",
"name": "centrasite_snmp",
"status": "yellow",
"error": "Port 8181 not active",
"response_time_ms": "1005"
},
{
"type": "api_portal",
"name": "api_portal",
"status": "not configured",
"response_time_ms": "9"
},
{
"type": "snmp",
"name": "snmp",
"status": "yellow",
"error": "Port 8189 not active",
"response_time_ms": "1004"
},
{
"type": "email",
"name": "email",
"status": "green",
"response_time_ms": "9"
},
{
"type": "elasticsearch",
"name": "elasticsearch",
"status": "not configured",
"response_time_ms": "0"
}
],
"external_accounts": [
{
"type": "service_registry",
"name": "ServiceConsulDefault",
"status": "green",
"response_time_ms": "12"
},
{
"type": "service_registry",
"name": "EurekaDefault",
"status": "yellow",
"error": "Error: HttpResponse: 500 (Connect to http://daefermion3:9092 failed): ",
"response_time_ms": "1026"
}
]
}
Note:

To perform the following
API Gateway Availability REST calls you must have the
View Administration Configuration privileges.

GET /gateway/availability/externalServices

GET /gateway/availability/all

To perform the following
API Gateway Availability REST calls you must be a valid
API Gateway user.

GET /gateway/availability/admin

GET /gateway/availability/engine
You can use the existing health check request GET http://localhost:5555/rest/apigateway/health, without any authentication being set, to retrieve the health of API Gateway that monitors the availability and health status of Kubernetes and Docker containers . This returns a HTTP 200 response without additional data.