Retrieving status of callas License Server using REST interface

The license server listens on 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.

<HOSTNAME>:>API_PORT>/status/data.json

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": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134179708C4A",
                    "serial_number": 200000512,
                    "runcount": 8,
                    "credits": 0,
                    "postpay": false
                },
                {
                    "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134179708C4A",
                    "serial_number": 200000556,
                    "runcount": 0,
                    "credits": 100000,
                    "postpay": false
                }
            ]
        }
    ],
    "sessions": [
        {
            "server_id": "6FC347863C741C475FB3511AF0B9452FA1011F4ADDED5BE73224053DA8960218",
            "session_id": 7603,
            "status": "finished",
            "host": "ip-172-31-42-36",
            "ip_address": "52.59.225.241",
            "started": "2019-06-27T11:48:08Z",
            "message": "hello AWS world",
            "licenses": []
        },
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134179708C4A",
            "session_id": 19472,
            "status": "running",
            "host": "ws-linux-cabs",
            "ip_address": "90.187.72.237",
            "started": "2019-06-27T11:48:02Z",
            "message": "",
            "licenses": [
                {
                    "product_id": 1000,
                    "major_version": 10,
                    "product": "callas pdfToolbox CLI",
                    "type": "runcount"
                }
            ]
        },
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134179708C4A",
            "session_id": 19473,
            "status": "running",
            "host": "ws-linux-cabs",
            "ip_address": "90.187.72.237",
            "started": "2019-06-27T11:48:02Z",
            "message": "",
            "licenses": [
                {
                    "product_id": 1000,
                    "major_version": 10,
                    "product": "callas pdfToolbox CLI",
                    "type": "runcount"
                }
            ]
        },
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134179708C4A",
            "session_id": 19477,
            "status": "running",
            "host": "ws-linux-cabs",
            "ip_address": "90.187.72.237",
            "started": "2019-06-27T11:48:07Z",
            "message": "",
            "licenses": [
                {
                    "product_id": 1000,
                    "major_version": 10,
                    "product": "callas pdfToolbox CLI",
                    "type": "runcount"
                }
            ]
        },
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134179708C4A",
            "session_id": 19478,
            "status": "running",
            "host": "Ulrichs-iPro.callas.local",
            "ip_address": "90.187.72.237",
            "started": "2019-06-27T11:48:09Z",
            "message": "",
            "licenses": []
        }
    ],
    "servers": [
        {
            "server_id": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134179708C4A",
            "status": "running",
            "serial_number": "200000510",
            "version": "1.0 (4 DEV 2019-06-26 17:18:19)",
            "hostname": "ip-172-31-42-36",
            "ip_address": "172.31.42.36",
            "port": 1400,
            "platform": "Ubuntu 18.04.2 LTS Linux x86_64 4.15.0-1040-aws",
            "started": "2019-06-26T17:04:40Z",
            "coordinator": "FAB348C4CD3C14E974730F83A0BFE4705428A9683880C967C9F2134179708C4A"
        },
        {
            "server_id": "2FE184D50FA29586ECF93185526FDC38CB40004FD464412A8FFDBFD2180BBF61",
            "status": "running",
            "serial_number": "200000510",
            "version": "1.0 (4 DEV 2019-06-26 17:18:19)",
            "hostname": "213.160.9.70",
            "ip_address": "213.160.9.70",
            "port": 1400,
            "platform": "Linux Mint 19 Tara x86_64 4.15.0-20-generic",
            "started": "2019-06-26T18:59:46+02:00"
        },
        {
            "server_id": "6FC347863C741C475FB3511AF0B9452FA1011F4ADDED5BE73224053DA8960218",
            "status": "running",
            "serial_number": "200000510",
            "version": "1.0 (4 DEV 2019-06-26 17:18:19)",
            "hostname": "srv-otrs-testing.callassoftware.com",
            "ip_address": "213.160.9.93",
            "port": 1400,
            "platform": "Debian GNU/Linux 9.9 stretch x86_64 4.9.0-9-amd64",
            "started": "2019-06-26T18:57:48+02:00"
        }
    ]
}

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

<HOSTNAME>:>API_PORT>/status/index.html

In case you find any problems in retrieving the status, please write to us at support@callassoftware.com