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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -