Traceback (most recent call last):
File "connection.py", line 8, in <module>
print(client.status_code)
AttributeError: 'Elasticsearch' object has no attribute 'status_code'
You need to connect to Elasticsearch to get a responde, setting up a client does nothing, just instantiate a client to be used when making requests to the cluster.
Also, I don't think the requests will return the status code.
If you want to check the connectivity with your cluster use something like this:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.