Crons

List crons

List crons on a server.

GET /api/server/{id}/crons

Example request :

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

Example response :

{
    "data": [
        {
            "id": 1,
            "command": "php /home/cloud/website.com/artisan schedule:run",
            "user": "cloud",
            "frequency": "0 0 * * *",
            "status": "installed",
            "created_at": "2022-08-23T16:54:12.000000Z"
        }
    ],
    "links": {
        "first": "https://cloud.boxydev.com/api/server/1/crons?page=1",
        "last": "https://cloud.boxydev.com/api/server/1/crons?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://cloud.boxydev.com/api/server/1/crons",
        "per_page": 20,
        "to": 1,
        "total": 1
    }
}

Get cron

Show a cron.

GET /api/cron/{id}

Example request :

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

Example response :

{
    "id": 1,
    "command": "php /home/cloud/website.com/artisan schedule:run",
    "user": "cloud",
    "frequency": "0 0 * * *",
    "status": "installed",
    "created_at": "2022-08-23T16:54:12.000000Z"
}

Create cron

Create a cron.

POST /api/server/{id}/cron

Parameters :

Parameter Description
command The cron command.
user The user that run cron.
frequency The cron frequency.

Example request :

curl "https://cloud.boxydev.com/api/server/1/cron" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "command": "ls -l",
        "user": "cloud",
        "frequency": "0 0 * * *"
    }'

Example response :

{
    "id": 1,
    "command": "ls -l",
    "user": "cloud",
    "frequency": "0 0 * * *",
    "status": "installing",
    "created_at": "2022-08-26T20:53:31.000000Z"
}

Pause cron

Pause a cron.

DELETE /api/cron/{id}/pause

Example request :

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

Resume cron

Resume a cron.

POST /api/cron/{id}/resume

Example request :

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

Delete cron

Delete a cron.

DELETE /api/cron/{id}

Example request :

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