From abb54ada1efc68cd8c10c88d589960ec77c55c9b Mon Sep 17 00:00:00 2001 From: Petr Stefan Date: Wed, 22 Jun 2016 22:59:09 +0200 Subject: [PATCH] File Server - Frontend communication --- Communication.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Communication.md b/Communication.md index 13274d3..d0ecaca 100644 --- a/Communication.md +++ b/Communication.md @@ -117,7 +117,7 @@ File server has it's internal directory structure, where all the files are store - **GET /submission_archives/\.\** - gets an archive with submitted source code and corresponding configuration of this job evaluation - **GET /tasks/\** - gets a file, common usage is for input files or reference result files -- **PUT /results/\.\** - upload archive with evaluation results under specified name (should be same _id_ as name of submission archive) +- **PUT /results/\.\** - 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`. @@ -176,7 +176,16 @@ Commands from broker to frontend (all are responses to **eval** command): ## 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/\.\** - download archive with evaluated results of job _id_ +- **POST /submissions/\** - 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": , "result_path": }` 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": }` 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