我剛開始與boto合作連接到Amazon CloudSearch。如何連接到博託的現有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()
謝謝! (我刪除了以前對此不起作用的評論,這是操作員錯誤)。 – ThoughtfulHacking
調用conn。lookup('name')引發以下錯誤:AttributeError:'Layer2'對象沒有屬性'lookup'。通過代碼搜索,我無法在CloudSearch中找到「查找」方法。 – waigani
嗯。 cloudsearch.layer2模塊明確定義了一個「查找」方法。自2012年8月22日加入此提交(https://github.com/boto/boto/commit/87cc02e496f0f803a07274b8976d14a45663a4ee)以來,它已經有了它。也許你正在使用老版本的boto? – garnaat