def build_dashboard(params): parser = get_params_parser() parser_create_dash = get_params_parser_create_dash() args = parser.parse_args(params['p2o_params'].split()) config_logging(args.debug) url = args.elastic_url clean = False async_ = True q = Queue('create', connection=Redis(args.redis), async=async_) task_feed = q.enqueue(feed_backend, url, clean, args.fetch_cache, args.backend, args.backend_args) q = Queue('enrich', connection=Redis(args.redis), async=async_) if async_: # Task enrich after feed result = q.enqueue(enrich_backend, url, clean, args.backend, args.backend_args, depends_on=task_feed) else: result = q.enqueue(enrich_backend, url, clean, args.backend, args.backend_args) result = q.enqueue(enrich_backend, url, clean, args.backend, args.backend_args, depends_on=task_feed) # The creation of the dashboard is quick. Do it sync and return the URL. enrich_index = args.backend+"_" enrich_index += get_backend_id(args.backend, args.backend_args)+"_enrich" args = parser_create_dash.parse_args(params['e2k_params'].split()) kibana_host = "http://localhost:5601" dash_url = create_dashboard(args.elastic_url, args.dashboard, enrich_index, kibana_host) return dash_url
def get_params(): ''' Get params definition from ElasticOcean and from all the backends ''' parser = get_params_parser() args = parser.parse_args() return args
def get_params(): ''' Get params definition from ElasticOcean and from all the backends ''' parser = get_params_parser() args = parser.parse_args() return args