List commands history on a site.
GET /api/site/{id}/commands
Example request :
curl "https://cloud.boxydev.com/api/site/1/commands" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
{
"data": [
{
"id": 1,
"command": "ls -l",
"output": "output",
"status": "finished",
"user_id": 1,
"created_at": "2022-09-10T06:00:57.000000Z"
}
],
"links": {
"first": "https://cloud.boxydev.com/api/site/1/commands?page=1",
"last": "https://cloud.boxydev.com/api/site/1/commands?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://cloud.boxydev.com/api/site/1/commands",
"per_page": 20,
"to": 1,
"total": 1
}
}
Show a command.
GET /api/command/{id}
Example request :
curl "https://cloud.boxydev.com/api/command/1" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
Example response :
{
"id": 1,
"command": "ls -l",
"output": "output",
"status": "finished",
"user_id": 1,
"created_at": "2022-09-10T06:00:57.000000Z"
}
Run a command.
POST /api/site/{id}/command
Parameters :
Parameter | Description |
---|---|
command | The command. |
Example request :
curl "https://cloud.boxydev.com/api/site/1/command" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"command": "ls -l"
}'
Example response :
{
"id": 1,
"command": "ls -l",
"output": null,
"status": "pending",
"user_id": 1,
"created_at": "2022-09-11T08:32:53.000000Z"
}