Skip to content

Other APIs

This document outlines other API endpoints that are available on ActiveServer.

Health Check (GET /health/{token})

Health check entry point which returns the status of the service. It can be used to determine if the service is up or down and current system performance metrics.

This entry point can be enabled by setting the following configuration on the application properties file. The random token value will be used to replace the {token} in the entry point.

1
as.settings.health-check-token=<Any random token>

Important

The above property file must be set with a token before the health check API can be used.

HTTP Status code (200) response

Below is an example JSON HTTP response with HTTP status code 200 when the API was called with valid configured token:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "status": "OK",
  "dbStatus": "OK",
  "dbProbeElapsed": 10,
  "version": "1.4.1.edesfd",
  "threads": 256,
  "pendingRequests": 0,
  "maxMem": 28900002,
  "currentMem": 1890001,
  "timestamp": "20201101T12:12:30"
}
  • status - The ActiveServer status, always returns "OK". If ActiveServer is down, the response status code will not be 200.
  • dbStatus - The DB status, always returns "OK". If the database is down, the response status code will not be 200.
  • dbProbeElapsed - The amount of time in milliseconds it took to perform DB connection check.
  • version - The current ActiveServer version.
  • threads - The current number of worker threads.
  • pendingRequests - The current number of pending requests (in the queue).
  • maxMem - The maximum number of the memory size in bytes.
  • currentMem - The current memory usage in bytes.
  • timestamp - The current UTC timestamp (Format: yyyy-MM-dd'T'HH:mm:ss)

HTTP Status Code (403) response

If the health status token is invalid you may get a forbidden HTTP status code. The HTTP response body may look like below.

1
2
3
4
{
    "code": "2005",
    "message": "Access is denied."
}

HTTP Status Code (501) response

If as.settings.health-check-token is not configured, 501 Not Implemented will be returned with empty HTTP response body.