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 は除く
目的
管理者は、REST API を使用してヘルス チェックの結果を取得したい場合があります。この記事では、その方法について詳しく説明します。
これらの REST コールは、JIRA システム管理者または JIRA 管理者のグローバル権限を持つユーザーとしての認証で実行する必要があります
ソリューション
サポート ツール プラグインを使用する場合:
GET の送信先:
http://<jira-baseurl>/rest/supportHealthCheck/1.0/check/
Atlassian Troubleshooting and Support Tools プラグインを使用する場合:
GET の送信先:
http://<jira-baseurl>/rest/troubleshooting/1.0/check/
ヘルス チェックの結果として返される内容の例:
{
"statuses": [
{
"id": 0,
"completeKey": "com.atlassian.jira.plugins.jira-healthcheck-plugin:hsqlHealthCheck",
"name": "Embedded database",
"description": "Checks if the instance is connected to an HSQL or H2 database",
"isHealthy": true,
"failureReason": "You are not using an HSQL or H2 embedded database with a production license.",
"application": "JIRA",
"time": 1484054268590,
"severity": "undefined",
"documentation": "https://confluence.atlassian.com/x/1guaEQ",
"tag": "Supported Platforms",
"healthy": true
},
{
"id": 0,
"completeKey": "com.atlassian.jira.plugins.jira-healthcheck-plugin:eolHealthCheck",
"name": "End of Life",
"description": "Checks if the running version of JIRA is approaching, or has reached End of Life.",
"isHealthy": true,
"failureReason": "JIRA version 7.3.x has not reached End of Life. This version will reach End of Life in 722 days.",
"application": "JIRA",
"time": 1484054268591,
"severity": "undefined",
"documentation": "https://confluence.atlassian.com/x/HjnRLg",
"tag": "Supported Platforms",
"healthy": true
},
{
"id": 0,
"completeKey": "com.atlassian.jira.plugins.jira-healthcheck-plugin:baseUrlHealthCheck",
"name": "Base URL",
"description": "Checks if JIRA is able to access itself through the configured Base URL.",
"isHealthy": false,
"failureReason": "JIRA is not able to access itself through the configured Base URL. This is necessary so that dashboard gadgets can be generated successfully. Please verify the current Base URL and if necessary, review your network configurations to resolve the problem.",
"application": "JIRA",
"time": 1484054344127,
"severity": "warning",
"documentation": "https://confluence.atlassian.com/x/WCA6Mw",
"tag": "Supported Platforms",
"healthy": false
},
....
上記は、ユーザーがすでにログインしていることを前提として、Web ブラウザからこの API コールを呼ぶ場合の概要を示しています。ユーザーがログインしていない場合は、情報を取得できません
この情報を別のソース、たとえば Linux 端末から取得したい場合には、以下の例のように curl コマンドで Basic 認証を使用できます。
curl --request GET \
--url '<jira-baseurl>/rest/troubleshooting/1.0/check/' \
--user 'username:password' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
There another ways to authenticate from API outlined here: Basic auth for REST APIs