Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的问题是以下一个:我想通过 Python 包列出 RhodeCode 实例上存在的所有项目。但是,我在文档中找不到必要的信息。有人会有解决方案吗?
RhodeCode 有一个 JSON-RPC api。您可以使用 python requests lib 获取所有项目列表,读取 JSON,然后迭代结果。
要进行的 JSON api 调用是 get_repos。查看有关 API 主题的 RhodeCode 文档以及如何调用它。此外,如果您需要更详细的示例如何调用 API,请查看此处的开源 CLI 脚本(全部使用 Python):
https://code.rhodecode.com/rhodecode-tools-ce/files/dc1eb60fcd9cadb8be52a56d56d561d731e09d0b/rhodecode_tools/lib/api.py#L218