9. Get the server status

Request

This function provides status information about the targeted server. In contrast to most other functions, it actually matters which server is used when running this command because the result will actually depend on the targeted server. The request URL has the following form:

          /server-status/this-server/
        

The request must use the GET method.

Response

The response is a JSON object with the following attributes:

Field nameInternal data typeJSON data typeDescription
cassandraClusterNamestringstring human-readable name of the Cassandra cluster to which this server is connected. May be null if the server has not connected to the Cassandra cluster yet. In this case, cassandraError is not null .
cassandraErrorstringstring error message indicating a problem that occurred while trying to connect to the Cassandra cluster. This is null if the connection to the Cassandra cluster has been established after starting the server (even if the connection is currently disrupted).
cassandraKeyspaceNamestringstring name of the Cassandra keyspace which is used by the Cassandra PV Archiver. May be null if the server has not connected to the Cassandra cluster yet. In this case, cassandraError is not null .
channelsDisconnectedintstring number of channels that are in the disconnected state.
channelsErrorintstring number of channels that are in the error state.
channelsTotalintstring total number of channels on this server. If the server has not been initialized yet (e.g. because it cannot connect to the database), this number is zero, even if there are channels that belong to the server.
serverIdUUIDstring ID of the server.
serverLastOnlineTimelongstring last time this server successfully registered itself with the cluster. The time is specified as the number of milliseconds since January 1st, 1970, 00:00:00 UTC. This number might be zero if the server has not successfully registered itself with the cluster since it was started.
serverNamestringstring human-readable name of the server. Typically, this is the hostname of the server.
serverOnlinebooleanboolean flag indicating whether the server considers itself to be online. The server considers itself online when a sufficient amount of time has passed since successfully registering with the cluster and the renewal of the registration has not failed since.
totalSamplesDroppedlongstring total number of samples that have been dropped (discarded) by this server because they arrived to quickly and could not be written in time. This counter is reset when the server is restarted.
totalSamplesWrittenlongstring total number of samples that have been written (persisted) by this server. This counter is reset when the server is restarted.

Example

Request:

GET /admin/api/1.0/server-status/this-server/

Response:

{
  "cassandraClusterName": "My Cassandra cluster",
  "cassandraError": null,
  "cassandraKeyspaceName": "pv_archive",
  "channelsDisconnected": "1",
  "channelsError": "0",
  "channelsTotal": "2",
  "serverId": "7cf8f393-cd00-46ae-9343-53e9cb5793fd",
  "serverLastOnlineTime": "1490634430220",
  "serverName": "myserver",
  "serverOnline": "true",
  "totalSamplesDropped": "3",
  "totalSamplesWritten": "4242"
}