async def vmmaster_command(request): session_id = request.match_info.get("session_id") return helpers.form_response(200, {}, "vmmaster command %s" % session_id)
async def get_session(request): session_id = request.match_info.get("session_id") session = request.app.sessions[int(session_id)] return helpers.form_response(200, {}, {"session": session})
async def get_proxy_request(request): session_id = request.match_info.get("session_id") session = request.app.sessions[int(session_id)] status, headers, body = await commands.transparent(request, session) return helpers.form_response(status, headers, body)
async def create_session(request): session = await commands.create_vmmaster_session(request) status, headers, body = await commands.start_vmmaster_session(request, session) return helpers.form_response(status, headers, body)
async def delete_session(request): session_id = request.match_info.get("session_id") await commands.service_command_send(request, "SESSION_CLOSING") del request.app.sessions[int(session_id)] return helpers.form_response(200, {}, "Session %s closed" % session_id)
async def create_session(request): session = await commands.create_vmmaster_session(request) status, headers, body = await commands.start_vmmaster_session( request, session) return helpers.form_response(status, headers, body)