/task POST
| Method | URL |
|---|---|
POST |
/task |
Headers
| Header Name | HeaderValue |
|---|---|
Accept |
application/json |
Content-Type |
application/x-www-form-urlencoded |
Params
| Type | Name | Required | Schema | Description |
|---|---|---|---|---|
FORM_URL_ENCODED |
command |
YES |
String |
Command to be executed by the task |
FORM_URL_ENCODED |
timeout |
NO |
Integer |
Task timeout in seconds |
Samples
Successful call
Request
curl -X "POST" "http://localhost:8080/task" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "command=ls -alh" \
--data-urlencode "timeout=30"
Response
200
{
"id": 2,
"startDate": "2025-05-21T22:41:19Z",
"workingDir": "/opt/restinterface/userfiles",
"command": "ls -alh",
"username": null,
"errorMessage": null,
"timeout": 30,
"output": "total 8.0K\ndrwxrwxrwx+ 2 runner docker 4.0K May 21 22:41 .\ndrwxrwxrwx+ 4 runner docker 4.0K May 21 22:41 ..\n",
"taskStatus": "COMPLETED",
"exitStatus": 0
}
/task/1 GET
| Method | URL |
|---|---|
GET |
/task/1 |
Headers
| Header Name | HeaderValue |
|---|---|
Accept |
application/json |
Samples
Successful call
Request
curl "http://localhost:8080/task/1"
Response
200
{
"id": 1,
"startDate": "2025-05-21T22:41:18Z",
"workingDir": "/opt/restinterface/userfiles",
"command": "ls -alh",
"username": null,
"errorMessage": null,
"timeout": null,
"output": "Command executed successfully",
"taskStatus": "COMPLETED",
"exitStatus": 0
}
/file/upload POST
| Method | URL |
|---|---|
POST |
/file/upload |
Headers
| Header Name | HeaderValue |
|---|---|
Accept |
application/json |
Content-Type |
multipart/form-data |
Params
| Type | Name | Required | Schema | Description |
|---|---|---|---|---|
FORM_DATA |
file |
YES |
byte[] |
File to be uploaded |
Samples
Successful call
Request
curl -X "POST" "http://localhost:8080/file/upload" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/file"
Response
200
{
"path": "/opt/restinterface/public/uploads/test1779459393935632067.txt",
"size": 11
}
/file/download?path=/tmp/test7943102557664088963.txt GET
| Method | URL |
|---|---|
GET |
/file/download?path=/tmp/test7943102557664088963.txt |
Samples
Successful call
Request
curl "http://localhost:8080/file/download?path=/tmp/test7943102557664088963.txt"
Response
200
Content-disposition: attachment; filename=data6660358563623724979.txt
Content-Length: 11
Byte stream