このドキュメントでは、Service Health API を使用して単一のプロジェクトに影響するイベントを管理する方法について説明します。
始める前に
Make sure that billing is enabled for your Google Cloud project.
- イベントを管理するプロジェクトで Service Health API を有効にします。
- Service Health API にアクセスするための権限を設定します。
参照
使用できるメソッドとレスポンスのフィールドの意味については、Events API リファレンス(v1、v1beta)をご覧ください。
商品またはロケーションを設定する場合は、Google Cloud products と locations の値を使用します。
プロジェクトのアクティブなインシデントをすべて一覧表示する
クイックスタートをご覧ください。
インシデントの詳細を取得する
Get API を使用すると、イベントの詳細情報を表示できます。
リクエストのデータを使用する前に、次のように置き換えます。
- API_VERSION: 使用する API のバージョン。
v1
またはv1beta
を使用してください。 - PROJECT_ID: Google Cloud プロジェクト ID。
- EVENT_ID: イベントの ID。
HTTP メソッドと URL:
GET https://servicehealth.googleapis.com/API VERSION/projects/PROJECT_ID/locations/global/events/EVENT_ID
リクエストを送信するには、次のいずれかのオプションを展開します。
次のような JSON レスポンスが返されます。
{ "name": "projects/PROJECT_ID/locations/global/events/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", "artifacts": [ { "artifact": "projects/PROJECT_ID/locations/global/artifacts/artifact_id", "artifactCategory": "ARTIFACT_CATEGORY_INCIDENT_REPORT", } ], "eventImpacts": [ { "product": { "productName": "Google Cloud SQL", "id": "hV87iK5DcEXKgWU2kDri", }, "location": { "locationName": "us-central1", } } ], "relevance": "RELATED", "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.events.get' denied on resource '//servicehealth.googleapis.com/projects/PROJECT_ID/locations/global/events/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": "projects/PROJECT_ID/locations/global/events/EVENT_ID",
"permission": "servicehealth.events.get"
}
}
]
}
}
このエラーを修正するには、必要な権限を設定します。