aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorAlexander Kabui2021-03-31 22:31:01 +0300
committerAlexander Kabui2021-03-31 22:31:01 +0300
commitf065ea860f8001942bbf7c61eb49e515d358d2eb (patch)
tree24d4882482e7bf605547e2d934a6835bb11fe4b8 /gn3/api
parentf6c6851504f14a1a163b6eeb5e3653a5ec3f5ceb (diff)
downloadgenenetwork3-f065ea860f8001942bbf7c61eb49e515d358d2eb.tar.gz
add temp_db setup and integration tests
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/datasets.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/gn3/api/datasets.py b/gn3/api/datasets.py
new file mode 100644
index 0000000..874c76a
--- /dev/null
+++ b/gn3/api/datasets.py
@@ -0,0 +1,28 @@
+"""this module contains code for creating datasets"""
+from flask import Blueprint
+from flask import jsonify
+
+from gn3.computations.datasets import create_dataset
+
+
+dataset = Blueprint("dataset", __name__)
+
+
+@dataset.route("/")
+def dataset_home():
+ """initial test endpont for dataset"""
+ return jsonify({"results": "ok"})
+
+
+@dataset.route("/create/<dataset_name>/")
+@dataset.route("/create/<dataset_name>/<dataset_type>")
+def create_dataset_api(dataset_name, dataset_type=None):
+ """Test api/create/dataset/<dataset_name>/<dataset_type>"""
+
+ new_dataset = create_dataset(
+ dataset_type=dataset_type, dataset_name=dataset_name)
+
+ results = {
+ "dataset":new_dataset
+ }
+ return jsonify(results)