Monitor

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": "0.00",
            "ram": "28.93",
            "disk": "18.00",
            "load_average": "0.00",
            "created_at": "2019-08-13 13:55:03"
        },
        {
            "cpu": "0.00",
            "ram": "29.44",
            "disk": "18.00",
            "load_average": "0.15",
            "created_at": "2019-08-13 13:50:31"
        }
    ],
    "links": {
        "first": "https://ploi.io/api/servers/1/monitor?page=1",
        "last": "https://ploi.io/api/servers/1/monitor?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://ploi.io/api/servers/1/monitor",
        "per_page": 15,
        "to": 2,
        "total": 2
    }
}

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"
    ]
}