Open codyaray opened 7 years ago
We also need st2 key search
Would be great to pull up kvs by prefix.
I wrote a helper script to search in the meantime. I've updated it to support st2search.py key <pattern>
for you @pixelrebel. https://gist.github.com/codyaray/d782c370de3fa2a4c7f0e27f67b3c395
@pixelrebel st2 key list --prefix=
@lakshmi-kannan That's great! I didn't realize there's help pages for the sub commands! But st2 key list -h
reflects this feature. Thanks!
I quite regularly (almost daily) have to pop into MongoDB to search for specific rules or actions. This is because we have far too many of each to do
"st2 rule list | grep"
, they're all in one pack, and they have a predictable naming scheme. To detail our use case a bit more, we have a cron pack where we keep a ton of rules with many named like<app>_<start|stop>_<hostname>
. The existing list filters for pack, action, and trigger aren't super helpful in this scenario. So I tend to use mongo to search for hostname, or for the app name, or for app_start, etc., for a particular rule, action, or (occasionally) action execution.I'm going to write a little helper script so others on my team have this functionality at-hand, but thought a feature request might make it part of core and helper others too.