通过Python的Bitbucket服务器RESTAPI

通过Python的Bitbucket服务器RESTAPI,python,bitbucket-server,stashy,Python,Bitbucket Server,Stashy,我想在Python中使用Bitbucket服务器的RESTAPI服务。到目前为止,我尝试了名为stashy的python模块,但我甚至无法连接。片段 import stashy stash = stashy.connect("http://localhost:7990/stash", "<user>", "<pass>") stash.admin.groups.list() 只需通过curl运行GET请求 curl -u <user>:<pass>

我想在Python中使用Bitbucket服务器的RESTAPI服务。到目前为止,我尝试了名为stashy的python模块,但我甚至无法连接。片段

import stashy
stash = stashy.connect("http://localhost:7990/stash", "<user>", "<pass>")
stash.admin.groups.list()
只需通过curl运行GET请求

curl -u <user>:<pass> http://127.0.0.1:7990/stash
curl-u:http://127.0.0.1:7990/stash
我得到一个页面,显示我已登录

我的环境:

Python: 2.7.13(默认,2017年11月24日,17:33:09) [GCC 6.3.0 20170516]

比特桶: Atlassian Bitbucket v5.13.0


谢谢

的示例连接URL
“http://localhost:7990/stash“
在隐藏文档中只是一个例子。如果要连接到Bitbucket服务器的“真实”实例,则需要相应地更改该URL

只需在web浏览器中访问Bitbucket服务器站点并复制URL的第一部分。可能是
https://bitbucket.mycompany.com
,并使用与web浏览器相同的用户名和密码

stash=stashy.connect(“https://bitbucket.mycompany.com“,”我的用户名“,”我的密码“

curl -u <user>:<pass> http://127.0.0.1:7990/stash