アトラシアンの山本です。この記事では Bitbucket Cloud での REST API による Mercurial リポジトリ一覧の取得方法を紹介します。
■背景
本年 2020-05-31 に Bitbucket での Mercurial サポート終了が予定されております。詳しくはブログ記事 Sunsetting Mercurial support in Bitbucket をご参照下さい。
■手順
既存の Mercurial レポジトリ一覧を取得して、影響範囲を調べたい方は下記例のように REST API を利用できます。
API_TOKEN="__YOUR_API_TOKEN__"
USERNAME="__YOUR_USERNAME__"
curl -L --request GET \
--user "${USERNAME}:${API_TOKEN}" \
--header "Accept: application/json" \
--url "https://api.bitbucket.org/2.0/repositories/?q=scm%20%3D%20%22hg%22&role=member"
レスポンスはページングされており、10件までのリポジトリが含まれています。続きのリポジトリ情報はレスポンスに含まれる "next" プロパティの URL から取得できます。例:
"next": "https://api.bitbucket.org/2.0/repositories/?q=scm+%3D+%22hg%22&after=2017-12-19T07%3A05%3A36.988129%2B00%3A00&role=member"
補足:
K. Yamamoto
Technical Support Engineer
Atlassian, K.K.
Yokohama, Japan
10 accepted answers
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
0 comments