我正在尝试为Amazon EC2实例创建一个名为Name
的新标记和值hostnameapphostname
。
下面是我的代码,它将失败并显示此错误消息:
>>> ec2.create_tags(["i-1923943832310"], {"name": "apphostname"})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/site-packages/botocore/client.py", line 157, in _api_call
"%s() only accepts keyword arguments." % py_operation_name)
TypeError: create_tags() only accepts keyword arguments.
>>>
见Create Tags。它需要键值参数。
Tags
是字典列表。如果需要,可以创建多个标记。相关问题 更多 >
编程相关推荐