コード例 #1
0
ファイル: bootstrap.py プロジェクト: lucidworks/searchhub
  fusion_update_url = app.config['FUSION_URLS'][0] + "apollo/connectors/datasources"
  FUSION_USERNAME = app.config.get("FUSION_ADMIN_USERNAME", "admin")
  FUSION_PASSWORD = app.config.get("FUSION_ADMIN_PASSWORD")
  for file in datasource_files:
    resp = requests.post(fusion_update_url,
                                 data=json.dumps(json.load(open(join("./typeahead_config", file)))),
                                 headers={'Content-type': 'application/json'},
                                 auth=(FUSION_USERNAME, FUSION_PASSWORD))
  print ("Finished creating datasource")

# ------------------------------------------------------------------------------------------------ # 
# ACTUAL WORK 

# Setting the system metrics and logging level 
backend.toggle_system_metrics(False)
backend.set_log_level("WARN")

# Updating the logging schedule to delete logs when appropriate 
backend.update_logging_scheduler()

# Setting up the variables we will be using that are user related
lucidfind_collection_id = app.config.get("FUSION_COLLECTION", "lucidfind")
lucidfind_batch_recs_collection_id = app.config.get("FUSION_BATCH_RECS_COLLECTION", "lucidfind_thread_recs")
user_collection_id = app.config.get("USER_COLLECTION", "users")
username = app.config.get("FUSION_APP_USER", "lucidfind")

# Updating the permissions for the search user 
# TODO: Make this less gross. This is pretty ugly right now. 
if cmd_args.create_collections or create_all:
  update_permissions = {
    "permissions": [
コード例 #2
0
ファイル: bootstrap.py プロジェクト: Pthinker/searchhub
        datasources.extend(stack_configs)

        for datasource in datasources:
            if datasource:
                # start the data sources
                if cmd_args.start_datasources:
                    print("Stop existing datasource %s if it exists" %
                          datasource["id"])
                    backend.stop_datasource(datasource, abort=True)
                    print("Starting datasource %s" % datasource["id"])
                    #TODO
                    backend.start_datasource(datasource["id"])


backend.toggle_system_metrics(False)
backend.set_log_level("WARN")

backend.update_logging_scheduler()

lucidfind_collection_id = app.config.get("FUSION_COLLECTION", "lucidfind")
lucidfind_batch_recs_collection_id = app.config.get(
    "FUSION_BATCH_RECS_COLLECTION", "lucidfind_thread_recs")
user_collection_id = app.config.get("USER_COLLECTION", "users")

# Create our main application user
username = app.config.get("FUSION_APP_USER", "lucidfind")
if cmd_args.create_collections or create_all:
    update_permissions = {
        "permissions": [
            {
                "methods": ["GET"],