How to get health of an elasticsearch cluster using python API? -
i want health of elasticsearch cluster similar command
curl -xget 'http://localhost:9200/_cluster/health?pretty=true'
but using python. did following
from elasticsearch.client import clusterclient esc = clusterclient([{'host': 'localhost', 'port': 9200}]) esc.health();
but an
attributeerror: 'list' object has no attribute 'transport'
i played around parameters health() such index , level mess around syntax. has working example?
regards, tobi
you can't use cluster api directly, try this:
from elasticsearch import elasticsearch es = elasticsearch() print(es.cluster.health())
Comments
Post a Comment