I'am having a trouble to connect the Python API to Elasticsearch. The Elasticsearch cluster is in azure cloud environment. This is what I tried:
from elasticsearch import Elasticsearch
es = Elasticsearch(
"https://machine_name.kb.westeurope.azure.elastic-cloud.com:9200/",
ca_certs="/path/to/http_ca.crt",
api_key=("api_id", "api_key")
)
However i can't ping the 'es' client. In fact the test return a None Object.
if not es.ping():
print("No connection")
else:
print(es.ping())
The code abose print "No connection". Can you please tell me what is wrong with my code ? There is another method using the Cloud ID. Where i can find the Cloud ID ?
Please Help, Thank you so much.