Ploi API
Ploi API

Monitoring

Get the latest monitoring responses for your server. This will require you to have monitoring installed, otherwise you'll be greeted with an error message.

GET api/servers/{server}/monitor

Example request:

curl -X GET "https://ploi.io/api/servers/{server}/monitor" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": [
        {
            "cpu": "5.2",
            "ram": "21.81",
            "disk": "40",
            "load_average": "0.19",
            "date": "2021-05-18 05:50:14"
        },
        {
            "cpu": "5",
            "ram": "22.15",
            "disk": "40",
            "load_average": "0.06",
            "date": "2021-05-18 05:45:38"
        },
        {
            "cpu": "6",
            "ram": "22.09",
            "disk": "40",
            "load_average": "0.26",
            "date": "2021-05-18 05:40:06"
        }
    ]
}

Errors you can encounter:

No monitoring installed

{
    "message": "The given data was invalid.",
    "errors": [
        "You do not have monitoring installed on this server."
    ],
    "links": []
}

Subscription not sufficient enough

{
    "message": "The given data was invalid.",
    "errors": [
        "Your subscription is not sufficient enough to allow monitoring."
    ],
    "links": [
        "http://ploi.io/pricing"
    ]
}