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

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

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

javascript - Restarting Supervisor and effect on FlaskSocketIO -