我想获得在博托实例列表要么富或酒吧的分量的标签。
I'd like to get a list of instances in boto either have a "component" tag of foo or bar.
有没有一种方法,以避免两个请求,并改写(munging)的对象?
Is there a way to avoid making two requests and munging the objects?
这应该会发现有一个名为标签的所有实例组件
,值为任富
或栏
:
This should find all instances that have a tag called component
with a value of either foo
or bar
:
import boto.ec2
c = boto.ec2.connect_to_region('us-west-2')
reservations = c.get_all_instances(filters={'tag:component':['foo', 'bar']})
这是否解决问题了吗?
Does that solve your problem?