I'm attempting to write a python code that will perform the actions that I'm currently doing in the curator-cli. The goal is to have Lambda that will perform several actions that are related but not restricted to ELK and Curator.
Some actions I was able to perform while others are not clear as to why they aren't working.
For example, snapshots are successful, but any indices actions fails.
I should probably point out that you got that result because you're assigning the output of an object method (filter_by_regex) to ilo, rather than making ilo an object by instantiating it on its own. Because of this, you cannot pass ilo to curator.Replicas, because it's not actually an IndexList object.
Once you have an IndexList object, the working list is always stored in the indices instance variable (it's in the documentation, but the methods and variables are, unfortunately, listed alphabetically, so it's down the page pretty far).
ilo = curator.IndexList(client)
print(ilo.indices) # Prints all discovered indices (the current working list)
ilo.filter_by_regex(kind='prefix', value='kubernetes-')
print(ilo.indices) # Prints the current working list (post-filter)
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.