initial stage

This commit is contained in:
Giambattista Bloisi 2024-03-27 22:58:50 +01:00
parent 7c919f5278
commit 5fd2558a3a
1 changed files with 3 additions and 3 deletions

View File

@ -212,10 +212,10 @@ for config_name, config in configs.items():
for entity in kwargs["params"]["ENTITIES"]: for entity in kwargs["params"]["ENTITIES"]:
indexname = f'{entity}_{kwargs["params"]["SUFFIX"]}' indexname = f'{entity}_{kwargs["params"]["SUFFIX"]}'
client.indices.update_aliases( client.indices.update_aliases(
actions=[ body={"actions": [
{"remove": {"index": f"{entity}_*", "alias": entity}}, {"remove": {"index": f"{entity}_*", "alias": entity}},
{"add": {"index": indexname, "alias": entity}}, {"add": {"index": indexname, "alias": entity}},
] ]}
) )
# update "allresources" alias # update "allresources" alias
actions = [] actions = []
@ -225,7 +225,7 @@ for config_name, config in configs.items():
actions.append({"add": {"index": "allresources", "alias": entity}}) actions.append({"add": {"index": "allresources", "alias": entity}})
if len(actions) > 0: if len(actions) > 0:
client.indices.update_aliases( client.indices.update_aliases(
actions=actions body={"actions": actions}
) )
parallel_batches = PythonOperator(task_id="compute_parallel_batches", python_callable=compute_batches) parallel_batches = PythonOperator(task_id="compute_parallel_batches", python_callable=compute_batches)