过滤博托实例列表由'标签:组件':'富',或'标签:组件':'棒' [英] Filter boto instance list by 'tag: component': 'foo', or 'tag:component': 'bar'
本文介绍了过滤博托实例列表由'标签:组件':'富',或'标签:组件':'棒'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想获得在博托实例列表要么富或酒吧的分量的标签。
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?
这篇关于过滤博托实例列表由'标签:组件':'富',或'标签:组件':'棒'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文