REST API を通じて再インデックスの進捗を監視する方法
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
目的
Confluence のいくつかのオペレーションを自動化するために REST API を活用できる場合があります。再インデックスの自動化や進捗の監視を行う要件がある場合、次の内容を使って実現できます。
ソリューション
- curl コマンドを実行する前に、次の環境変数を把握しておく必要があります。
USER_NAME=<username> ### You must be Confluence Administrator
USER_PASSWORD=<user password>
CONFLUENCE_BASEURL=<Confluence Base URL> ### FQDN and context path without the trailing slash
- ユーザー名、パスワード、および Confluence のベース URL を置き換え、次の例のように curl コマンドを実行します。
curl -u <username>:<password> -X GET "http://localhost:8090/json/reindextaskprogress.action" | python -mjson.tool
- 次のような出力が表示されます。
{
"compactElapsedTime": "12:12:17",
"count": "3020121",
"percentageComplete": "67",
"total": "2051956"
}
ここで、compactElapsedTime は、再インデックスの開始以降の時間を表します。Count はインデックスするアイテムの数を表します。PercentageComplete は、再インデックスの開始以降のここまでの進捗を表します。total は、インデックス済みのアイテムの数を表します。
最終更新日 2020 年 11 月 27 日
Powered by Confluence and Scroll Viewport.