Retrieving status of callas License Server using REST interface

The license server is listening on to two ports: the first one for license requests, already described in one of the previous articles

The second port is used for the REST interface. The default port for this purpose is 1401 it can be changed by using the --api-port option. If no --api-port option is given and the main port was set using the --port option the license server uses the next port (--port +1 ) for the API port.

The license server provides one REST interface that provides information about the current status of the license server, the cartridges, the failover network and information about running sessions.

The license server  provides an HTML status page that uses the /status/data.json interface internally:

<HOSTNAME>:<API_PORT>/status/index.html
Click to copy

Internally used JSON interface:

<HOSTNAME>:<API_PORT>/status/data.json
Click to copy

Example:

{
    "cartridges": [
        {
            "product_id": 1000,
            "major_version": 0,
            "product": "callas pdfToolbox CLI",
            "runcount": 0,
            "credits": 100000,
            "postpay": false,
            "statistic": {
                "licenses": {
                    "runcount": 0,
                    "credits": 0,
                    "failed": 0
                },
                "used_credits": 2155,
                "remaining_credits": 97845,
                "runcount_in_use": 0,
                "sessions_dropped": 0
            },
            "locations": []
        },
        {
            "product_id": 1000,
            "major_version": 10,
            "product": "callas pdfToolbox CLI",
            "runcount": 8,
            "credits": 0,
            "postpay": false,
            "statistic": {
                "licenses": {
                    "runcount": 32398,
                    "credits": 0,
                    "failed": 5
                },
                "used_credits": 0,
                "remaining_credits": 0,
                "runcount_in_use": 3,
                "sessions_dropped": 5490
            },
            "locations": [
                {
                    "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134",
                    "serial_number": 200000512,
                    "runcount": 8,
                    "credits": 0,
                    "postpay": false
                },
                {
                    "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134",
                    "serial_number": 200000556,
                    "runcount": 0,
                    "credits": 100000,
                    "postpay": false
                }
            ]
        }
    ],
    "sessions": [
        {
            "server_id": "6FC347863C741C475FB3511AF0B9452FA1011F4ADDED5BE7322405",
            "session_id": 7603,
            "status": "finished",
            "host": "ip-172-31-xx-xx",
            "ip_address": "52.59.xxx.xxx",
            "started": "2019-06-27T11:48:08Z",
            "message": "hello AWS world",
            "licenses": []
        },
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134",
            "session_id": 19472,
            "status": "running",
            "host": "ws-linux-cabs",
            "ip_address": "90.187.xx.xx",
            "started": "2019-06-27T11:48:02Z",
            "message": "",
            "licenses": [
                {
                    "product_id": 1000,
                    "major_version": 10,
                    "product": "callas pdfToolbox CLI",
                    "type": "runcount"
                }
            ]
        },
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134",
            "session_id": 19473,
            "status": "running",
            "host": "ws-linux-cabs",
            "ip_address": "90.187.xx.xx",
            "started": "2019-06-27T11:48:02Z",
            "message": "",
            "licenses": [
                {
                    "product_id": 1000,
                    "major_version": 10,
                    "product": "callas pdfToolbox CLI",
                    "type": "runcount"
                }
            ]
        },
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134",
            "session_id": 19477,
            "status": "running",
            "host": "ws-linux-cabs",
            "ip_address": "90.187.xx.xx",
            "started": "2019-06-27T11:48:07Z",
            "message": "",
            "licenses": [
                {
                    "product_id": 1000,
                    "major_version": 10,
                    "product": "callas pdfToolbox CLI",
                    "type": "runcount"
                }
            ]
        },
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134",
            "session_id": 19478,
            "status": "running",
            "host": "iPro.callas.local",
            "ip_address": "90.187.xx.xx",
            "started": "2019-06-27T11:48:09Z",
            "message": "",
            "licenses": []
        }
    ],
    "servers": [
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134",
            "status": "running",
            "serial_number": "200000510",
            "version": "1.0.7",
            "hostname": "ip-172-31-xx-xx",
            "ip_address": "172.31.xx.xx",
            "port": 1400,
            "platform": "Ubuntu 18.04.2 LTS Linux x86_64 4.15.0-1040-aws",
            "started": "2019-06-26T17:04:40Z",
            "coordinator": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134"
        },
        {
            "server_id": "2FE184D50FA29586ECF93185526FDC38CB40004FD464412A8FFDBFD",
            "status": "running",
            "serial_number": "200000510",
            "version": "1.0.7",
            "hostname": "213.160.xx.xx",
            "ip_address": "213.160.xx.xx",
            "port": 1400,
            "platform": "Linux Mint 19 Tara x86_64 4.15.0-20-generic",
            "started": "2019-06-26T18:59:46+02:00"
        },
        {
            "server_id": "6FC347863C741C475FB3511AF0B9452FA1011F4ADDED5BE7322405",
            "status": "running",
            "serial_number": "200000510",
            "version": "1.0.7",
            "hostname": "srv-testing.callassoftware.com",
            "ip_address": "213.160.xx.xx",
            "port": 1400,
            "platform": "Debian GNU/Linux 9.9 stretch x86_64 4.9.0-9-amd64",
            "started": "2019-06-26T18:57:48+02:00"
        }
    ]
}
Click to copy

In case you find any problems in retrieving the status, please write to us at [email protected]

You can also watch a short video about REST interface below: