【发布时间】:2014-12-04 08:47:52
【问题描述】:
查看 aws docs 它说您可以使用过滤器来获取或值,例如:
tag:key=value
The key/value combination of a tag assigned to the resource.
Example: To list the resources with the tag Purpose=X, use:
--filter tag:Purpose=X
Example: To list resources with the tag Purpose=X or the tag Purpose=Y, use:
--filter tag:Purpose=X --filter tag:Purpose=Y
但在 boto 中,您将标签存储在字典中(从获取所有快照):
"filters (dict) – 可选过滤器,可用于限制返回的结果。过滤器以字典的形式提供,由过滤器名称作为键和过滤器值作为值。允许的过滤器名称集/values 取决于正在执行的请求。有关详细信息,请查看 EC2 API 指南。"
如果您想执行 OR,那么您的字典中需要两个条目,键为“tag:Purpose”,这显然是行不通的。有谁知道这是否有解决方法?还是boto不支持OR值过滤?
【问题讨论】: