/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": "/tmp/restinterface/upload/test888840941838868663.txt",
    "size": 11
}

/file/download?path=/tmp/test2540541702707373123.txt GET

Method URL

GET

/file/download?path=/tmp/test2540541702707373123.txt

Samples

Successful call

Request

curl "http://localhost:8080/file/download?path=/tmp/test2540541702707373123.txt"

Response

200
Content-disposition: attachment; filename=data5841180966893436656.txt
Content-Length: 11

Byte stream

/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": "2022-07-11T20:27:40Z",
    "workingDir": "/tmp/restinterface/working",
    "command": "ls -alh",
    "errorMessage": null,
    "timeout": 30,
    "output": "total 8.0K\ndrwxr-xr-x 2 samuel samuel 4.0K Jun 29 10:06 .\ndrwxr-xr-x 5 samuel samuel 4.0K Jun 29 10:06 ..\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": "2022-07-11T20:27:37Z",
    "workingDir": "/tmp/restinterface/working",
    "command": "ls -alh",
    "errorMessage": null,
    "timeout": null,
    "output": "Command executed successfully",
    "taskStatus": "COMPLETED",
    "exitStatus": 0
}