def start_application(): application_container = session['application_container'] if application_container is None: return docker_interface.start_user_container(application_container, session['user_container_name']) return True
def start_application(): if not 'application_container' in session: return False if not 'user_container_name' in session: return False application_container = session['application_container'] docker_interface.start_user_container(application_container, session['user_container_name'], ROS_DISTRIBUTION) return True
def start_application(): if not 'application_container' in session: return False if not 'user_container_name' in session: return False application_container = session['application_container'] docker_interface.start_user_container(application_container, session['user_container_name']) return True
def start_by_session(): """ Starts the container for the currently logged in user. """ if 'user_container_name' not in session: return False image_name = generate_user_image_name() container_name = session['user_container_name'] docker_interface.start_user_container(image_name, container_name, ROS_DISTRIBUTION)
def start_container(token): """ Starts the container of the user assigned to the given API token. The WebSocket url to the users rosbridge instance will be returned on success. """ user = user_by_token(token) if user is None: return jsonify({'error': 'wrong api token'}) docker_interface.start_user_container('openease/'+ROS_DISTRIBUTION+'-knowrob-daemon', user.username, ROS_DISTRIBUTION) host_url = urlparse(request.host_url).hostname return jsonify({'result': 'success', 'url': '//'+host_url+'/ws/'+user.username+'/'})
def start_container(token): """ Starts the container of the user assigned to the given API token. The WebSocket url to the users rosbridge instance will be returned on success. """ user = user_by_token(token) if user is None: return jsonify({'error': 'wrong api token'}) ros_distro = os.getenv('OPENEASE_DOCKER_ROS_DISTRO', 'hydro') docker_interface.start_user_container('knowrob/'+ros_distro+'-knowrob-base', user.username) host_url = urlparse(request.host_url).hostname return jsonify({'result': 'success', 'url': '//'+host_url+'/ws/'+user.username+'/'})
def start_container(token): """ Starts the container of the user assigned to the given API token. The WebSocket url to the users rosbridge instance will be returned on success. """ user = user_by_token(token) if user is None: return jsonify({'error': 'wrong api token'}) docker_interface.start_user_container('knowrob/hydro-knowrob-base', user.username) host_url = urlparse(request.host_url).hostname return jsonify({ 'result': 'success', 'url': '//' + host_url + '/ws/' + user.username + '/' })
def start_container(token): """ Starts the container of the user assigned to the given API token. The WebSocket url to the users rosbridge instance will be returned on success. """ user = _user_by_token(token) if user is None: return jsonify({'error': 'wrong api token'}) docker_interface.start_user_container(_generate_user_image_name(), user.username, ROS_DISTRIBUTION) host_url = urlparse(request.host_url).hostname return jsonify({ 'result': 'success', 'url': '//' + host_url + '/ws/' + user.username + '/' })