Hi All,
I recently wrote a quick python script to trigger our Bitbucket pipelines from our Jenkins builds. One of the things I found frustrating was the lack of useful documentation for the bitbucket API around pipelines. The basic APIs were documented adequately for the most part, but the return values of any given API call were basically all missing (for example, go to Bitbucket Pipeline API -> Get a pipeline and and then click on the Response Object "Pipeline", and keep following it down to "state". You get nothing!)
Interestingly, the best documentation I found was a github repo where someone seems to have created a python client based on the Open API spec for Bitbucket. They don't list all the return states anywhere either, but they have stubbed out the classes for the everything with somewhat useful comments about the various states of both pipelines and pipeline steps.
To help others who may need to do something similar in the future, here's the github repo, and a list of pipeline and pipeline step states:
Github repo: https://github.com/magmax/atlassian-openapi/blob/master/spec/bitbucket.yaml
Pipeline states:
COMPLETED
ERROR
EXPIRED
FAILED
IN_PROGRESS
PAUSED
PENDING
RUNNING
STOPPED
SUCCESSFUL
Pipeline Step States:
COMPLETED
ERROR
EXPIRED
FAILED
IN_PROGRESS
NOT_RUN
PENDING
READY
STOPPED
SUCCESSFUL
I may have missed some, I'm not entirely sure. I compiled these lists by grepping through the models/* directory for state info.
Hopefully someone finds this info useful.
--
Paul
Following this spec: https://api.bitbucket.org/swagger.json you get:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.