def remove_instance(instance, admin=False): """Completely remove all components for a given instance, Remove instance in jormungandr db """ instance = get_real_instance(instance) execute(component.db.remove_instance_from_jormun_database, instance) execute(component.db.remove_postgresql_database, instance.db_name) execute(component.db.remove_postgresql_user, instance.db_user) execute(tyr.remove_ed_instance, instance) execute(tyr.remove_tyr_instance, instance) execute(kraken.remove_kraken_instance, instance) execute(jormungandr.remove_jormungandr_instance, instance) if admin and env.use_load_balancer: execute(remove_kraken_vip, instance)
def update_instance(instance, reload_jormun=True): """ param (instance) - update all configuration and restart all services does not deploy any packages """ instance = get_real_instance(instance) reload_jormun = get_bool_from_cli(reload_jormun) print(blue('updating {}'.format(instance.name))) #first of all we compute the instance status, it will be helpfull later execute(compute_instance_status, instance) execute(tyr.create_tyr_instance, instance) execute(component.db.postgis_initdb, instance.db_name) execute(tyr.update_ed_db, instance.name) execute(jormungandr.deploy_jormungandr_instance_conf, instance) execute(kraken.create_eng_instance, instance) execute(tyr.deploy_default_synonyms, instance) execute(component.db.create_privileges_instance_db, instance) if reload_jormun: execute(jormungandr.reload_jormun_safe_all)