Bitbucket client handle + the request seam every atlassian.bitbucket.*
endpoint namespace is built on.
Bitbucket Cloud is a separate Atlassian service from Jira/Confluence: it lives
on a fixed host (https://api.bitbucket.org/2.0) and uses its own credentials
(see atlassian.config/bitbucket-config). Most resources are workspace- and
repository-scoped, so endpoint functions take workspace and repo_slug as
positional arguments and pass them in a path RELATIVE to the single API root:
(require '[atlassian.bitbucket.client :as bitbucket]) (def c (bitbucket/client)) (bitbucket/request c {:method :get :path "/repositories/your-workspace"}) (bitbucket/request c {:method :get :path "/repositories/your-workspace/your-repo/pullrequests" :query {:state "OPEN" :pagelen 25}})
There is a single API surface, so — unlike the Jira/Confluence clients — there
is NO :api routing key.
Pagination differs from Jira and Confluence. List responses are
{:values [...] :page N :pagelen N :size N :next "<full-url>" :previous "<full-url>"}.
The :next link is a COMPLETE absolute URL (not a cursor), so paging fetches it
directly; next-url extracts it and request-url fetches an absolute URL.
Bitbucket client handle + the `request` seam every atlassian.bitbucket.*
endpoint namespace is built on.
Bitbucket Cloud is a separate Atlassian service from Jira/Confluence: it lives
on a fixed host (https://api.bitbucket.org/2.0) and uses its own credentials
(see `atlassian.config/bitbucket-config`). Most resources are workspace- and
repository-scoped, so endpoint functions take `workspace` and `repo_slug` as
positional arguments and pass them in a path RELATIVE to the single API root:
(require '[atlassian.bitbucket.client :as bitbucket])
(def c (bitbucket/client))
(bitbucket/request c {:method :get :path "/repositories/your-workspace"})
(bitbucket/request c {:method :get
:path "/repositories/your-workspace/your-repo/pullrequests"
:query {:state "OPEN" :pagelen 25}})
There is a single API surface, so — unlike the Jira/Confluence clients — there
is NO `:api` routing key.
Pagination differs from Jira and Confluence. List responses are
`{:values [...] :page N :pagelen N :size N :next "<full-url>" :previous "<full-url>"}`.
The `:next` link is a COMPLETE absolute URL (not a cursor), so paging fetches it
directly; `next-url` extracts it and `request-url` fetches an absolute URL.(client)(client cfg)Build a Bitbucket client handle. With no args resolves config from the
environment (process env overlaid on a local .env) and throws a clear
ex-info if required credentials are missing. Pass an explicit Bitbucket config
map to bypass the environment.
Build a Bitbucket client handle. With no args resolves config from the environment (process env overlaid on a local `.env`) and throws a clear ex-info if required credentials are missing. Pass an explicit Bitbucket config map to bypass the environment.
(next-url response)Extract the :next page link from a Bitbucket paginated response (or nil when
there is no next page). Feed it to request-url to fetch the following page.
Extract the `:next` page link from a Bitbucket paginated response (or nil when there is no next page). Feed it to `request-url` to fetch the following page.
(request client {:keys [path] :as opts})Perform a Bitbucket request and return the parsed, keywordized JSON body on 2xx.
opts: :method - :get :post :put :delete (default :get) :path - path relative to the API root, e.g. "/repositories/ws/repo" :query - query-param map (sequential values -> repeated pairs) :body - EDN value, JSON-encoded into the request body :headers - extra request headers :throw? - throw ex-info on non-2xx (default true)
Delegates to atlassian.client/request; see it for error semantics.
Perform a Bitbucket request and return the parsed, keywordized JSON body on 2xx. opts: :method - :get :post :put :delete (default :get) :path - path relative to the API root, e.g. "/repositories/ws/repo" :query - query-param map (sequential values -> repeated pairs) :body - EDN value, JSON-encoded into the request body :headers - extra request headers :throw? - throw ex-info on non-2xx (default true) Delegates to `atlassian.client/request`; see it for error semantics.
(request-url client url)(request-url client url opts)Fetch an ABSOLUTE Bitbucket URL (e.g. the :next link from a paginated
response) and return the parsed body. Use this to follow pagination links,
which Bitbucket returns as complete URLs rather than cursors.
Fetch an ABSOLUTE Bitbucket URL (e.g. the `:next` link from a paginated response) and return the parsed body. Use this to follow pagination links, which Bitbucket returns as complete URLs rather than cursors.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |