def launch_api_server(): LOG.info("Starting congress server on port %d", cfg.CONF.bind_port) # API resource runtime encapsulation: # event loop -> wsgi server -> webapp -> resource manager paste_config = config.find_paste_config() config.set_config_defaults() servers = [] servers.append(create_api_server(paste_config, cfg.CONF.dse.node_id, cfg.CONF.bind_host, cfg.CONF.bind_port, cfg.CONF.api_workers)) return servers
def main(): config.init(sys.argv[1:]) if not cfg.CONF.config_file: sys.exit("ERROR: Unable to find configuration file via default " "search paths ~/.congress/, ~/, /etc/congress/, /etc/) and " "the '--config-file' option!") config.setup_logging() LOG.info("Starting congress server") # API resource runtime encapsulation: # event loop -> wsgi server -> webapp -> resource manager paste_config = config.find_paste_config() servers = [] servers.append( create_api_server(paste_config, "congress", cfg.CONF.bind_host, cfg.CONF.bind_port, cfg.CONF.api_workers)) serve(*servers)
def main(): config.init(sys.argv[1:]) if not cfg.CONF.config_file: sys.exit("ERROR: Unable to find configuration file via default " "search paths ~/.congress/, ~/, /etc/congress/, /etc/) and " "the '--config-file' option!") config.setup_logging() LOG.info("Starting congress server on port %d", cfg.CONF.bind_port) # API resource runtime encapsulation: # event loop -> wsgi server -> webapp -> resource manager paste_config = config.find_paste_config() servers = [] servers.append(create_api_server(paste_config, "congress", cfg.CONF.bind_host, cfg.CONF.bind_port, cfg.CONF.api_workers)) serve(*servers)
def launch_servers(node_id, api, policy, data): servers = [] if api: LOG.info("Starting congress API server on port %d", cfg.CONF.bind_port) # API resource runtime encapsulation: # event loop -> wsgi server -> webapp -> resource manager paste_config = config.find_paste_config() config.set_config_defaults() servers.append(create_api_server(paste_config, node_id, cfg.CONF.bind_host, cfg.CONF.bind_port, cfg.CONF.api_workers, policy_engine=policy, datasources=data)) else: LOG.info("Starting congress server on node %s", node_id) servers.append(create_nonapi_server(node_id, policy, data, cfg.CONF.api_workers)) return servers