Skip to content

Commit

Permalink
Added sim/dataset endpoint with the option to specify a version
Browse files Browse the repository at this point in the history
  • Loading branch information
egauzens committed Mar 19, 2024
1 parent 34c484a commit 7be4df7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/main.py
Expand Up @@ -795,7 +795,6 @@ def build_filetypes_table(osparc_viewers):
table[filetype].append(viewer)
return table


@app.route("/sim/dataset/<id_>")
def sim_dataset(id_):
if request.method == "GET":
Expand All @@ -807,6 +806,17 @@ def sim_dataset(id_):
return jsonify(json_data)
abort(404, description="Resource not found")

@app.route("/sim/dataset/<id_>/versions/<version_>")
def sim_dataset_versions(id_, version_):
if request.method == "GET":
req = requests.get("{}/datasets/{}/versions/{}".format(Config.DISCOVER_API_HOST, id_, version_))
if req.ok:
json_data = req.json()
inject_markdown(json_data)
inject_template_data(json_data)
return jsonify(json_data)
abort(404, description="Resource not found")


@app.route("/get_osparc_data")
def get_osparc_data():
Expand Down

0 comments on commit 7be4df7

Please sign in to comment.