1

I would like to use the REST API service of Bitbucket server in Python. Till now I tried the python module called stashy, but I could not even connect. The snippet

import stashy
stash = stashy.connect("http://localhost:7990/stash", "<user>", "<pass>")
stash.admin.groups.list()

raises the exception

stashy.errors.GenericException: Unknown error: 503(Service Unavailable)

By simply running a GET request via curl

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

I get a page, which shows I am logged in.

My environment:

Python: 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0 20170516]

Bitbucket: Atlassian Bitbucket v5.13.0

Thanks!

bayerb
  • 649
  • 2
  • 9
  • 28

1 Answers1

1

The example connection URL of "http://localhost:7990/stash" in the stashy docs is just an example. If you want to connect to a "real" instance of Bitbucket Server, you need to change that URL accordingly.

Just visit your Bitbucket Server site in a web browser and copy the first part of the URL. It's probably something like https://bitbucket.mycompany.com, and use the same username and password as you'd use via your web browser.

stash = stashy.connect("https://bitbucket.mycompany.com", "myusername", "mypassword")

sql_knievel
  • 1,199
  • 1
  • 13
  • 26