このドキュメントでは、Service Health API を使用して組織に影響するイベントを管理する方法について説明します。
Personalized Service Health は、OrganizationEvents API リソースと OrganizationImpacts API リソースを提供します。これらのリソースを使用すると、組織に影響するイベントに関する情報を取得できます。これには以下の情報が含まれます。
- 組織内の 1 つ以上のプロジェクトに影響を与える可能性のあるサービス健全性イベント。
- 組織に影響を与えるイベントの影響を受ける可能性のあるプロジェクトのリスト。
始める前に
- 組織内の少なくとも 1 つのプロジェクトで Service Health API を有効にします。OrganizationEvents API リソースと OrganizationImpacts API リソースは、Service Health API が有効になっているプロジェクトの情報のみを取得します。
-
Verify that billing is enabled for your Google Cloud project.
- Service Health API にアクセスする権限を設定します。
OrganizationEvents API リソースと OrganizationImpacts API リソースを使用するように、組織に対する Identity and Access Management(IAM)権限を構成します。次のコマンドを実行します。
gcloud organizations add-iam-policy-binding $ORGANIZATION_ID \ --member {USER|GROUP|SERVICE_ACCOUNT} \ --role roles/servicehealth.viewerORGANIZATION_ID を取得するには、組織リソース ID の取得をご覧ください。
組織に付与された IAM ポリシーは、組織内のすべてのプロジェクトに継承されます。これらのポリシーを使用すると、組織全体で組織とプロジェクトのイベント API にアクセスできます。
参照
使用できるメソッドと、レスポンスのフィールドの意味については、OrganizationEvents と OrganizationImpacts の API リファレンスをご覧ください。
商品またはロケーションを設定する場合は、Google Cloud products と locations で見つかった値を使用します。
イベントの影響を受ける可能性がある組織のプロジェクトを一覧表示する
クイックスタートをご覧ください。
組織のアクティブなインシデントをすべて一覧表示する
クイックスタートをご覧ください。
組織に影響するイベントの詳細を取得する
Get API を使用すると、組織に影響するイベントの詳細情報を表示できます。
リクエストのデータを使用する前に、次のように置き換えます。
- API_VERSION: 使用する API のバージョン。
v1またはv1betaを使用してください。 - ORGANIZATION_ID: Google Cloud 組織 ID。
- EVENT_ID: イベントの ID。
HTTP メソッドと URL:
GET https://servicehealth.googleapis.com/API VERSION/organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID
リクエストを送信するには、次のいずれかのオプションを展開します。
次のような JSON レスポンスが返されます。
{
"name": "organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID",
"title": "We are experiencing a connectivity issue affecting Google Cloud SQL in us-east1, australia-southeast2.",
"description": "The issue with Google Cloud SQL has been resolved for all affected projects as of Tuesday, 2022-10-18 11:00 US/Pacific. We thank you for your patience while we worked on resolving the issue.",
"category": "INCIDENT",
"detailedCategory": "CONFIRMED_INCIDENT",
"state": "CLOSED",
"detailedState": "RESOLVED",
"eventImpacts": [
{
"product": {
"productName": "Google Cloud SQL",
"id": "hV87iK5DcEXKgWU2kDri",
},
"location": {
"locationName": "us-central1",
}
}
],
"updates": [
{
"updateTime": "2022-10-18T17:41:20.112287Z",
"title": "We are experiencing a connectivity issue affecting Google Cloud SQL in us-east1, australia-southeast2.",
"description": "We are experiencing an intermittent issue with Google Cloud SQL. Our engineering team continues to investigate the issue.",
"symptom": "None at this time.",
"workaround": "None at this time."
},
{
"updateTime": "2022-10-18T18:00:05.690761Z",
"title": "We are experiencing a connectivity issue affecting Google Cloud SQL in us-east1, australia-southeast2.",
"description": "The issue with Google Cloud SQL has been resolved for all affected projects as of Tuesday, 2022-10-18 11:00 US/Pacific.\n\nWe thank you for your patience while we worked on resolving the issue.",
"symptom": "None at this time.",
"workaround": "None at this time."
}
],
"updateTime": "2022-10-18T18:00:05.690761Z",
"startTime": "2022-10-18T17:41:20.112287Z",
"endTime": "2022-10-18T18:00:05.690761Z",
}
イベントを取得する権限がない場合は、次の PERMISSION_DENIED エラーが表示されます。
{
"error": {
"code": 403,
"message": "Permission 'servicehealth.organizationEvents.get' denied on resource '//servicehealth.googleapis.com/organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID' (or it may not exist).",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "IAM_PERMISSION_DENIED",
"domain": "servicehealth.googleapis.com",
"metadata": {
"resource": "organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID",
"permission": "servicehealth.organizationEvents.get"
}
}
]
}
}
このエラーを解決するには、必要な権限を設定します。
イベントの影響を受ける可能性がある組織のプロジェクトの詳細を取得する
特定のイベントの場合、プロジェクト イベントと組織イベントの間でイベント ID は同じままです。OrganizationImpact には EVENT_ID と PROJECT_NUMBER が含まれています。これらを使用して、プロジェクトに影響するイベントの詳細を取得できます。これらの詳細には、state と relevance が含まれます。
PROJECT_NUMBER は、Get API が返す PROJECT_ID と交換可能です。