Skip to content

Commit

Permalink
api: mocked /workflows endpoint
Browse files Browse the repository at this point in the history
* Adds mocked `/workflows` endpoint that provides a quick way to
  check if reana-workflow-engine is running. (closes #20)

Signed-off-by: Harri Hirvonsalo <harri.hirvonsalo@cern.ch>
  • Loading branch information
hjhsalo committed Mar 28, 2017
1 parent b209f4e commit 6eb1e81
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/restapi.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
REST API
========

GET /workflows
--------------

.. autofunction:: reana_workflow_controller.app.get_workflows


POST /yadage
------------

.. autofunction:: reana_workflow_controller.app.yadage_endpoint


40 changes: 40 additions & 0 deletions reana_workflow_controller/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,46 @@
}


@app.route('/workflows', methods=['GET'])
def get_workflows():
"""Get all workflows.
.. http:get:: /workflows
Returns a JSON list with all the workflows.
.. 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.
"""
return jsonify({"workflows": {}}), 200


@app.route('/yadage', methods=['POST'])
def yadage_endpoint():
"""Create a new job.
Expand Down

0 comments on commit 6eb1e81

Please sign in to comment.