Last active
August 29, 2015 13:57
-
-
Save siroken3/9635375 to your computer and use it in GitHub Desktop.
botocore でいつも忘れる ec2.DescribeInstances の filterの書き方
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import botocore | |
| import botocore.session | |
| s = botocore.session.get_session() | |
| ec2 = s.get_service('ec2') | |
| ep = ec2.get_endpoint() | |
| op = ec2.get_operation('DescribeInstances') | |
| # Nameタグの値がhogeあるいはfuga | |
| status, resp = op.call(ep, filters=[{"Name":"tag:Name", "Values":["hoge","fuga"]}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment