I have been trying to create an ILM policy using the python client. But I get an error when running the python script.
This is my code:
from datetime import datetime
from elasticsearch import Elasticsearch
from elasticsearch.Elasticsearch.client import ILMClient
es = Elasticsearch()
es_ilm = IlmClient(es)
**---- more lines of code ----**
But I get the following error:
C:\elasticsearchpython\datastreamilm>python create_policy.py
Traceback (most recent call last):
File "C:\elasticsearchpython\datastreamilm\create_policy.py", line 3, in <module>
from elasticsearch.Elasticsearch.client import ILMClient
ModuleNotFoundError: No module named 'elasticsearch.Elasticsearch'
How do you import the ILMClient into the python script? Also, do I need to download and install anything other than the Elasticsearch module?