Monitoring

List monitors

List monitors on a server.

GET /api/server/{id}/monitors

Example request :

curl "https://cloud.boxydev.com/api/server/1/monitors" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "data": [
        {
            "id": 1,
            "type": "disk",
            "operator": "gte",
            "value": 90,
            "duration": 5,
            "status": "installed",
            "state": "success",
            "changed_at": "2022-08-23T16:54:12.000000Z"
        }
    ],
    "links": {
        "first": "https://cloud.boxydev.com/api/server/1/monitors?page=1",
        "last": "https://cloud.boxydev.com/api/server/1/monitors?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://cloud.boxydev.com/api/server/1/monitors",
        "per_page": 20,
        "to": 1,
        "total": 1
    }
}

Get monitor

Show a monitor.

GET /api/monitor/{id}

Example request :

curl "https://cloud.boxydev.com/api/monitor/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "id": 1,
    "type": "disk",
    "operator": "gte",
    "value": 90,
    "duration": 5,
    "status": "installed",
    "state": "success",
    "changed_at": "2022-08-23T16:54:12.000000Z"
}

Create monitor

Create a monitor.

POST /api/server/{id}/monitor

You can get notification channels list here. You can manage all your notification channels on your account.

Parameters :

Parameter Description
type The monitoring type: cpu, disk or memory.
operator The operator to compare value: gte or lte.
value The value in percentage.
duration The duration needs to exceed before notification (Optional).
notification_channel_id Notification provider ID.

Example request :

curl "https://cloud.boxydev.com/api/server/1/monitor" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "type": "disk",
        "operator": "gte",
        "value": 50,
        "duration": 5,
        "notification_channel_id": 1
    }'

Example response :

{
    "id": 1,
    "type": "disk",
    "operator": "gte",
    "value": 50,
    "duration": 5,
    "status": "installing",
    "state": null,
    "changed_at": null
}

Delete monitor

Delete a monitor.

DELETE /api/monitor/{id}

Example request :

curl -X DELETE "https://cloud.boxydev.com/api/monitor/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"