File Server - Frontend communication

master
Petr Stefan 9 years ago
parent 2d586754f3
commit abb54ada1e

@ -117,7 +117,7 @@ File server has it's internal directory structure, where all the files are store
- **GET /submission_archives/\<id\>.\<ext\>** - gets an archive with submitted source code and corresponding configuration of this job evaluation - **GET /submission_archives/\<id\>.\<ext\>** - gets an archive with submitted source code and corresponding configuration of this job evaluation
- **GET /tasks/\<hash\>** - gets a file, common usage is for input files or reference result files - **GET /tasks/\<hash\>** - gets a file, common usage is for input files or reference result files
- **PUT /results/\<id\>.\<ext\>** - upload archive with evaluation results under specified name (should be same _id_ as name of submission archive) - **PUT /results/\<id\>.\<ext\>** - upload archive with evaluation results under specified name (should be same _id_ as name of submission archive). On successful upload returns JSON `{ "result": "OK" }` as body of returned page.
If not specified otherview, `zip` format of archives is used. Symbol `/` in API description is root of file server's domain. If the domain is for example `fs.recodex.org` with SSL support, getting input file for one task could look as GET request to `https://fs.recodex.org/tasks/8b31e12787bdae1b5766ebb8534b0adc10a1c34c`. If not specified otherview, `zip` format of archives is used. Symbol `/` in API description is root of file server's domain. If the domain is for example `fs.recodex.org` with SSL support, getting input file for one task could look as GET request to `https://fs.recodex.org/tasks/8b31e12787bdae1b5766ebb8534b0adc10a1c34c`.
@ -176,7 +176,16 @@ Commands from broker to frontend (all are responses to **eval** command):
## File Server - Frontend communication ## File Server - Frontend communication
**TODO:** File server has a REST API for interaction with other parts of ReCodEx. Description communication with workers is in [[Communication#file-server-point-of-view]]. On top of that, there are other command for interaction with frontend:
- **GET /results/\<id\>.\<ext\>** - download archive with evaluated results of job _id_
- **POST /submissions/\<id\>** - upload new submission with identifier _id_. Expects that the body of the POST request uses file paths as keys and the content of the files as values. On successful upload returns JSON `{ "archive_path": <archive_url>, "result_path": <result_url> }` in response body. From _archive_path_ can be the submission downloaded (by worker) and corresponding evaluation results shouldbe uploaded to _result_path_.
- **POST /tasks** - upload new files, which will be available by names eqal to `sha1sum` of their content. There can be uploaded more files at once. On successful upload returns JSON `{ "result": "OK", "files": <file_list> }` in response body, where _file_list_ is dictionary of original file name as key and new URL with already hashed name as value.
There are no plans yet to support deleting files from this API. This may change in time.
**TODO: frontend side**
## Monitor - Browser communication ## Monitor - Browser communication

Loading…
Cancel
Save