Commit 50c5599b authored by Daniele Venzano's avatar Daniele Venzano

Fix url variable types

parent ca9a4ef9
This diff is collapsed.
......@@ -30,7 +30,7 @@ def api_status():
return jsonify(**data)
@app.route("/api/<user_id>/cluster/<cluster_id>/terminate")
@app.route("/api/<int:user_id>/cluster/<int:cluster_id>/terminate")
def api_terminate_cluster(user_id, cluster_id):
db = CAaaState()
ret = {}
......@@ -50,7 +50,7 @@ def api_terminate_cluster(user_id, cluster_id):
return jsonify(**ret)
@app.route("/api/<user_id>/container/<container_id>/logs")
@app.route("/api/<int:user_id>/container/<int:container_id>/logs")
def api_container_logs(user_id, container_id):
db = CAaaState()
ret = {}
......@@ -69,7 +69,7 @@ def api_container_logs(user_id, container_id):
return jsonify(**ret)
@app.route("/api/<user_id>/spark-submit", methods=['POST'])
@app.route("/api/<int:user_id>/spark-submit", methods=['POST'])
def api_spark_submit(user_id):
state = CAaaState()
ret = {}
......@@ -89,7 +89,7 @@ def api_spark_submit(user_id):
return jsonify(**ret)
@app.route("/api/<user_id>/history/<app_id>/logs")
@app.route("/api/<int:user_id>/history/<app_id>/logs")
def api_history_log_archive(user_id, app_id):
state = CAaaState()
if not state.check_user_id(user_id):
......
......@@ -9,6 +9,7 @@
{% if has_notebook %}
<p>You have a notebook running:
<a href="{{ notebook_address }}">open</a>
<a href="{{ url_for("web_inspect", user_id=user_id, cluster_id=notebook_cluster_id) }}">inspect</a>
<a href="{{ url_for("web_terminate", user_id=user_id, cluster_id=notebook_cluster_id) }}">terminate</a>
</p>
{% endif %}
......
......@@ -27,7 +27,7 @@ def web_login(email):
return redirect(url_for("web_index", user_id=user_id))
@app.route("/web/<user_id>")
@app.route("/web/<int:user_id>")
def web_index(user_id):
state = CAaaState()
if not state.check_user_id(user_id):
......@@ -39,7 +39,7 @@ def web_index(user_id):
return render_template('home.html', **template_vars)
@app.route("/web/<user_id>/apps")
@app.route("/web/<int:user_id>/apps")
def web_user_apps(user_id):
state = CAaaState()
if not state.check_user_id(user_id):
......@@ -56,7 +56,7 @@ def web_user_apps(user_id):
return render_template('apps.html', **template_vars)
@app.route("/web/<user_id>/spark-notebook")
@app.route("/web/<int:user_id>/spark-notebook")
def web_notebook(user_id):
state = CAaaState()
if not state.check_user_id(user_id):
......@@ -71,7 +71,7 @@ def web_notebook(user_id):
return render_template('notebook.html', **template_vars)
@app.route("/web/<user_id>/cluster/<cluster_id>/inspect")
@app.route("/web/<int:user_id>/cluster/<int:cluster_id>/inspect")
def web_inspect(user_id, cluster_id):
state = CAaaState()
if not state.check_user_id(user_id):
......@@ -93,7 +93,7 @@ def web_inspect(user_id, cluster_id):
return render_template('inspect.html', **template_vars)
@app.route("/web/<user_id>/cluster/<cluster_id>/terminate")
@app.route("/web/<int:user_id>/cluster/<int:cluster_id>/terminate")
def web_terminate(user_id, cluster_id):
state = CAaaState()
if not state.check_user_id(user_id):
......@@ -110,7 +110,7 @@ def web_terminate(user_id, cluster_id):
return render_template('terminate.html', **template_vars)
@app.route("/web/<user_id>/container/<container_id>/logs")
@app.route("/web/<int:user_id>/container/<int:container_id>/logs")
def web_logs(user_id, container_id):
state = CAaaState()
if not state.check_user_id(user_id):
......@@ -133,7 +133,7 @@ def web_logs(user_id, container_id):
return render_template('logs.html', **ret)
@app.route("/web/<user_id>/submit-spark-app")
@app.route("/web/<int:user_id>/submit-spark-app")
def web_spark_submit(user_id):
state = CAaaState()
if not state.check_user_id(user_id):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment