List daemons on a server.
GET /api/server/{id}/daemons
Example request :
curl "https://cloud.boxydev.com/api/server/1/daemons" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
{
"data": [
{
"id": 1,
"command": "php artisan horizon",
"user": "cloud",
"processes": 1,
"directory": "/home/cloud/website.com",
"startsecs": 1,
"stopwaitsecs": 10,
"startretries": 3,
"stopsignal": "TERM",
"status": "installed",
"server_id": 1,
"created_at": "2022-08-17T18:10:37.000000Z"
}
],
"links": {
"first": "https://cloud.boxydev.com/api/server/1/daemons?page=1",
"last": "https://cloud.boxydev.com/api/server/1/daemons?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://cloud.boxydev.com/api/server/1/daemons",
"per_page": 20,
"to": 1,
"total": 1
}
}
Show a daemon.
GET /api/daemon/{id}
Example request :
curl "https://cloud.boxydev.com/api/daemon/1" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
{
"id": 1,
"command": "php artisan horizon",
"user": "cloud",
"processes": 1,
"directory": "/home/cloud/cloud.boxydev.com",
"startsecs": 1,
"stopwaitsecs": 10,
"startretries": 3,
"stopsignal": "TERM",
"status": "installed",
"server_id": 1,
"created_at": "2022-08-17T18:10:37.000000Z"
}
Create a daemon.
POST /api/server/{id}/daemon
Parameters :
Parameter | Description |
---|---|
command | The daemon command. |
user | The user that run daemon. |
processes | The processes number for the daemon (Optional). |
directory | The directory where run daemon (Optional). |
startsecs | The seconds needed before processus start successful (Optional). |
stopwaitsecs | The seconds to wait before to stop processus (Optional). |
startretries | The number of retries to start processus (Optional). |
stopsignal | The stop signal to send when stop: TERM (Optional). |
Example request :
curl "https://cloud.boxydev.com/api/server/1/daemon" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"command": "php artisan horizon",
"user": "cloud",
"processes": 1,
"directory": "/home/cloud/website.com",
"startsecs": 1,
"stopwaitsecs": 10,
"startretries": 3,
"stopsignal": "TERM"
}'
Example response :
{
"id": 1,
"command": "php artisan horizon",
"user": "cloud",
"processes": 1,
"directory": "/home/cloud/website.com",
"startsecs": 1,
"stopwaitsecs": 10,
"startretries": 3,
"stopsignal": "TERM",
"status": "installing",
"server_id": 1,
"created_at": "2022-08-21T08:28:09.000000Z"
}
Stop a daemon.
DELETE /api/daemon/{id}/stop
Example request :
curl -X DELETE "https://cloud.boxydev.com/api/daemon/1/stop" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Start a daemon.
POST /api/daemon/{id}/start
Example request :
curl -X POST "https://cloud.boxydev.com/api/daemon/1/start" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Restart a daemon.
PUT /api/daemon/{id}/restart
Example request :
curl -X PUT "https://cloud.boxydev.com/api/daemon/1/restart" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Delete a daemon.
DELETE /api/daemon/{id}
Example request :
curl -X DELETE "https://cloud.boxydev.com/api/daemon/1" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"