Skip to content

Commit

Permalink
Added endpoint to get session options
Browse files Browse the repository at this point in the history
  • Loading branch information
Habush committed Apr 5, 2019
1 parent c4366d6 commit 954edbb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions webserver/apimain.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ def check_status(mnemonic):
return jsonify({"response": "Session not found"}), 404


@app.route("/session/<mnemonic>", methods=["GET"])
def get_session_info(mnemonic):
db = pymongo.MongoClient(MONGODB_URI)[DB_NAME]

session = Session.get_session(db, mnemonic=mnemonic)

if session:
return jsonify({
"moses_opts": session.moses_options,
"cross_val_opts": session.crossval_options,
"target_feature": session.target_feature
})
else:
return jsonify({
"message": "Session not found"
}), 404


@app.route("/result/<mnemonic>", methods=["GET"])
def send_result(mnemonic):
db = pymongo.MongoClient(MONGODB_URI)[DB_NAME]
Expand Down

0 comments on commit 954edbb

Please sign in to comment.