如何从Python中检索CouchDB复制状态

643ylb08  于 2022-12-09  发布在  CouchDB
关注(0)|答案(1)|浏览(98)

在bash中,我可以轻松检索CouchDB复制状态文档的json blob:

curl -X GET -u admin:password localhost:5984/_scheduler/docs/_replicator

在Python中使用couchdb库是否可以检索相同的信息?我已经尝试过了:

couch_db.view("_scheduler/docs/_replicator", include_docs=True)

..但这会传回('not_found', 'missing')错误。

qnyhuwrf

qnyhuwrf1#

事实证明,我把它做得比实际需要的还要复杂,使用Python requests库可以使这个任务变得简单:

requests.get("localhost:5984/_scheduler/docs/_replicator", auth=("admin", "password"))

相关问题