gpt4 book ai didi

python - 如何连接到 boto 中的现有 CloudSearch 域?

转载 作者:太空狗 更新时间:2023-10-29 22:04:17 25 4
gpt4 key购买 nike

我刚刚开始使用 boto 连接到 Amazon CloudSearch。

我得到了这些示例,但我找不到任何连接到现有域的示例,所有示例都创建了一个新域。

四处寻找,我找到了 get_domain,但如果我在连接对象上调用它,那将失败。

>>> conn.get_domain('foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Layer2' object has no attribute 'get_domain'

关于如何连接到现有域有什么建议吗?

[编辑]我从这个开始:http://boto.cloudhackers.com/en/latest/cloudsearch_tut.html

所以,我就是这么做的

import boto
conn = boto.connect_cloudsearch()

最佳答案

您可以执行 conn.list_domains() 这将返回所有当前域的域对象列表,或者您可以执行 conn.lookup('foo') 将返回指定域名的域对象。

关于python - 如何连接到 boto 中的现有 CloudSearch 域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12763129/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com