我想在Python中使用Bitbucket服务器的REST API服务。到目前为止,我尝试了名为stashy的python模块,但我甚至无法连接。代码片段
import stashy
stash = stashy.connect("http://localhost:7990/stash", "<user>", "<pass>")
stash.admin.groups.list()引发异常
stashy.errors.GenericException: Unknown error: 503(Service Unavailable)只需通过curl运行GET请求即可
curl -u <user>:<pass> http://127.0.0.1:7990/stash我会看到一个页面,显示我已登录。
我的环境:
Python: 2.7.13 (默认,2017年11月24 17:33:09) GCC 6.3.0 20170516
Bitbucket: Atlassian Bitbucket v5.13.0
谢谢!
发布于 2019-07-27 06:46:28
stashy文档中"http://localhost:7990/stash"的示例连接URL只是一个示例。如果您想要连接到Bitbucket Server的“真实”实例,则需要相应地更改该URL。
只需在web浏览器中访问您的Bitbucket服务器站点,并复制URL的第一部分。它可能类似于https://bitbucket.mycompany.com,并且使用与您通过web浏览器使用的用户名和密码相同的用户名和密码。
stash = stashy.connect("https://bitbucket.mycompany.com", "myusername", "mypassword")
https://stackoverflow.com/questions/51835764
复制相似问题