From 98408cf69d73d224e5120bb8b1a999875cb2a9fe Mon Sep 17 00:00:00 2001 From: hahirvon Date: Tue, 28 Mar 2017 12:03:44 +0200 Subject: [PATCH] api: Add MOCKED /workflows -endpoint * Add MOCKED /workflows -endpoint that provides a quick way to check if reana-workflow-engine is running. Closes #20. Signed-off-by: Harri Hirvonsalo --- docs/restapi.rst | 1 + reana_workflow_controller/app.py | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/restapi.rst b/docs/restapi.rst index f82d4a8e..5a710d74 100644 --- a/docs/restapi.rst +++ b/docs/restapi.rst @@ -5,3 +5,4 @@ POST /yadage ------------ .. autofunction:: reana_workflow_controller.app.yadage_endpoint +.. autofunction:: reana_workflow_controller.app.get_workflows \ No newline at end of file diff --git a/reana_workflow_controller/app.py b/reana_workflow_controller/app.py index 0a8bd107..b02e5482 100644 --- a/reana_workflow_controller/app.py +++ b/reana_workflow_controller/app.py @@ -45,25 +45,37 @@ @app.route('/workflows', methods=['GET']) def get_workflows(): """Get all workflows. - + .. http:get:: /workflows + Returns a JSON list with all the workflows. - NOTE: Currently just a mock that can used e.g. to quickly - check if reana-workflow-controller is running. + + .. warning:: + Not implemented, just a mock that can be used e.g. to quickly + check if reana-workflow-controller is running. + **Request**: + .. sourcecode:: http + GET /workflows HTTP/1.1 Content-Type: application/json Host: localhost:5000 + :reqheader Content-Type: application/json + **Responses**: + .. sourcecode:: http + HTTP/1.1 200 OK Content-Length: 22 Content-Type: application/json + { "workflows": {} } + :resheader Content-Type: application/json :statuscode 200: no error - the list has been returned. """