このドキュメントでは、Service Health API を使用して組織に影響するイベントを管理する方法について説明します。
Personalized Service Health には、組織に影響するイベントに関する情報を取得できる OrganizationEvents API リソースと OrganizationImpacts API リソースが用意されています。これには以下の情報が含まれます。
- 組織内の 1 つ以上のプロジェクトに影響する可能性がある Service Health イベント。
- 組織に影響を与えるイベントの影響を受ける可能性のあるプロジェクト、または影響を受けているプロジェクトのリスト。
始める前に
- 組織内の少なくとも 1 つのプロジェクトで Service Health API を有効にします。OrganizationEvents API リソースと OrganizationImpacts API リソースは、Service Health API が有効になっているプロジェクトの情報のみを取得します。
-
Make sure 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.viewer
ORGANIZATION_ID を取得するには、組織リソース ID の取得をご覧ください。
組織に付与された IAM ポリシーは、組織内のすべてのプロジェクトに継承されます。これらのポリシーを使用すると、組織全体で組織イベント API とプロジェクト イベント API にアクセスできます。
参照
使用できるメソッドとレスポンスのフィールドの意味については、OrganizationEvents API リファレンスと 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 と交換可能です。