INNER CODE UNIT · Python
add_templates
mistio/mist-ce · docker/elasticsearch-manage/scripts/add_templates.py:37
def add_templates(force=False):
"""PUT Elasticsearch Templates."""
# Initialize ES client.
es = es_client()
hosts = []
for host in es.transport.hosts:
hosts.append(host['host'])
print('Connected to: %s' % ', '.join(hosts))
# Script path.
spath = os.path.dirname(__file__)
# Templates path.
tpath = os.path.abspath(os.path.join(spath, '../templates/'))