REST Api

Ressources

Config :
  • base_url : the base of the url of the REST api; something like “http://<host>:<port>/v1/”
  • port : the port number to access on the REST api on the server
  • host : the hostname of the server
  • max_parallel_run : the number of run that the server allow to run simultanously
  • run_config : this object describe the configuration of lxc container that will be used to execute a run
    • disk : allowed disk space in octet; null means that there is no limit
    • ram : allowed ram space in octet; null means that there is no limit
    • core : allowed core (int); null means that there is no limit
    • cpu_frequency : allowed max frequence in Hz; null means that there is no limit
  • version : the version of the pirus api
Pipeline :
  • id :
  • form_url : /pipeline/{id}/form
  • icon : file.png
  • pirus_api : version of the pirus API used by the pipeline
  • version : version of the pipeline
  • license : license of the pipeline
  • name : Displayed name of the pipeline
  • description : Short description of the pipeline (goal and usage)
  • developer : labsquare
Run :
  • pipeline_id : unique id of the Pipeline
  • id : unique id of the run
  • progress :
  • value : value of the progress
  • label : label displayed in the progress bar
  • info : [optional] information about the job currently executing by the run
  • config : {} json configuration used by the run (generated from the form_json provided by the Pipeline)
  • status : status of the run : { INIT, WAIT, RUN, PAUSE, FAIL, CANCEL, DONE, FINISH }
  • start : datetime when the run started
  • end : datetime when the run ended
  • name : displayed name for the run
  • inputs : [ ] list of file id used as input for this run
  • outputs : [ ] list of id of output files generated by the run
File :
  • create_date : “1476366739.449207”,
  • status : “TMP”,
  • tags : [ ],
  • comments : null,
  • name : “0031.jpg”,
  • size : “1.48 Mo”,
  • type : “jpg”,
  • url : url to download the file
  • runs : [ ] Liste des runs contenant File
  • id : “57ff91930e95cb516fd11796”,
  • md5sum : “622824aec0d050c467a56045effef50d”,

Endpoints

Runs

GET /run
Generic request to return a list of runs. Accepted (and all optional) query parameters :
  • range : start-end :
  • fields : the list (comma separedted) of fields that shall be loaded/return
  • order_by : the list (comma separated) of fields in which the results shall be ordered
  • sorted_by : this list shall be used accordingly with order_by to precise if the fields shall ordered ASC or DESC
  • filter : [string] a value that will be used to filter on all fields. only elemnt that contain this string will be returned
POST /run

Init and start a run with provided information. The run is automatically start if there is enough resources; otherwise it will wait for that. POST data must be JSON dictionary with the 3 requiered fields :

  • pipeline_id : [string] the id of the pipeline to use for the run
  • config : [dict] the config key-values to configure the run
  • inputs : [list] the list of file ids that shall be used as input by the run
GET /run/{run_id}
**Description of the get run
GET /run/{run_id}/progress
Description of the get run
GET /run/{run_id}/config
Description of the get run
GET /run/{run_id}/stdout
Description of the get run
GET /run/{run_id}/stderr
Description of the get run
GET /run/{run_id}/log { limit }
Description of the get run
PUT /run/{run_id}/pause
Description of the get run
PUT /run/{run_id}/start
Description of the get run
PUT /run/{run_id}/stop
Description of the get run
DELETE /run/{run_id}
Description of the get run
GET /run/{run_id}/inputs
Description of the get run
GET /run/{run_id}/outputs
Description of the get run

Pipelines

GET /pipeline/
Description of the get run
GET /pipeline/{pipeline_id}
Description of the get run
GET /pipeline/{pipeline_id}/form
Description of the get run
POST /pipeline/
Description of the get run
DELETE /pipeline/{pipeline_id}
Description of the get run

Files

GET /file/
Description of the get run
POST /file/upload
Description of the get run
GET /file/upload/{id}
Description of the get run
DELETE /file/{file_id}
Description of the get run.
GET /file/{file_id}
Description of the get run

Notification

POST /run/{run_id}/notify
Description of the get run { label, info, value, min, max }