繁体   English   中英

使用 Boto3 使用 AllocationIds 作为过滤器的描述地址的语法错误

[英]Syntax error for describe addresses using AllocationIds as Filter using boto3

我正在尝试描述我环境中的弹性 IP 之一,但出现以下错误:

>>> ec2 = boto3.client('ec2', 'ap-south-1')
>>> response = client.describe_addresses(
...     Filters=[
...             AllocationIds=['eipalloc-000f89e6a8a331b84','eipalloc-03d4d2f93bdcb134d']
  File "<stdin>", line 3
    AllocationIds=['eipalloc-000f89e6a8a331b84','eipalloc-03d4d2f93bdcb134d']
                 ^
SyntaxError: invalid syntax

我指的链接是https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_addresses

请任何人都可以建议我做错了什么。

从文档中, FiltersAllocationIdsdescribe_addresses()单独参数。

也许您正在寻找的是:(带有合适的额外字段)

response = client.describe_addresses(Filters=[], AllocationIds=['eipalloc-000f89e6a8a331b84','eipalloc-03d4d2f93bdcb134d'])

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM