core rest - added set default services
This commit is contained in:
parent
d522649489
commit
57dc69b9da
1 changed files with 11 additions and 1 deletions
|
@ -22,11 +22,21 @@ def get_services():
|
||||||
|
|
||||||
|
|
||||||
@api.route("/sessions/<int:session_id>/services/default")
|
@api.route("/sessions/<int:session_id>/services/default")
|
||||||
def get_session_options(session_id):
|
def get_session_service_defaults(session_id):
|
||||||
session = core_utils.get_session(coreemu, session_id)
|
session = core_utils.get_session(coreemu, session_id)
|
||||||
return jsonify(defaults=session.services.default_services)
|
return jsonify(defaults=session.services.default_services)
|
||||||
|
|
||||||
|
|
||||||
|
@api.route("/sessions/<int:session_id>/services/default", methods=["POST"])
|
||||||
|
def set_session_service_defaults(session_id):
|
||||||
|
data = request.get_json() or {}
|
||||||
|
session = core_utils.get_session(coreemu, session_id)
|
||||||
|
session.services.default_services.clear()
|
||||||
|
session.services.default_services.update(data)
|
||||||
|
logger.info("default services: %s", session.services.default_services)
|
||||||
|
return jsonify()
|
||||||
|
|
||||||
|
|
||||||
@api.route("/sessions/<int:session_id>/nodes/<node_id>/services/<service_name>")
|
@api.route("/sessions/<int:session_id>/nodes/<node_id>/services/<service_name>")
|
||||||
def get_node_service(session_id, node_id, service_name):
|
def get_node_service(session_id, node_id, service_name):
|
||||||
session = core_utils.get_session(coreemu, session_id)
|
session = core_utils.get_session(coreemu, session_id)
|
||||||
|
|
Loading…
Reference in a new issue