Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dokumen ini menjelaskan cara menggunakan Service Health API untuk mengelola peristiwa yang memengaruhi organisasi Anda.
Personalized Service Health menyediakan resource OrganizationEvents dan OrganizationImpacts API, yang memungkinkan Anda mendapatkan informasi tentang peristiwa yang memengaruhi organisasi Anda. Informasi ini mencakup:
Peristiwa kesehatan layanan yang dapat memengaruhi satu atau beberapa project dalam organisasi.
Daftar project yang mungkin atau sedang terpengaruh oleh peristiwa yang memengaruhi organisasi Anda.
Sebelum memulai
Aktifkan Service Health API
untuk setidaknya satu project dalam organisasi Anda. Resource OrganizationEvents
dan OrganizationImpacts API hanya mendapatkan informasi untuk project yang
mengaktifkan Service Health API.
Konfigurasi izin Identity and Access Management (IAM) di organisasi Anda untuk menggunakan resource API OrganizationEvents dan OrganizationImpacts. Jalankan perintah berikut:
Kebijakan IAM yang diberikan pada organisasi diwarisi oleh
semua project dalam organisasi. Kebijakan ini memungkinkan Anda mengakses API peristiwa organisasi dan project di seluruh organisasi.
{
"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",
}
Jika Anda tidak memiliki
izin untuk mendapatkan peristiwa,
Anda akan mendapatkan error PERMISSION_DENIED berikut.
{
"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"
}
}
]
}
}
Mendapatkan detail project dalam organisasi yang mungkin terpengaruh oleh suatu peristiwa
Untuk peristiwa tertentu, ID peristiwa tetap sama antara project dan peristiwa organisasi Anda.
OrganizationImpact berisi EVENT_ID dan PROJECT_NUMBER, yang dapat Anda gunakan untuk
mendapatkan detail untuk peristiwa yang memengaruhi
project Anda. Detail ini mencakup
state dan
relevance.
PROJECT_NUMBER dapat dipertukarkan dengan PROJECT_ID, yang ditampilkan oleh Get API.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 UTC."],[],[],null,["# Manage events affecting an organization\n\nThis document explains how-tos for using the Service Health API to manage events\naffecting your organization.\n\nPersonalized Service Health provides the OrganizationEvents and OrganizationImpacts API\nresources, which let you get information on events that affect your\norganization. This information includes:\n\n- Service health events that may impact one or more projects in an organization.\n- List of projects that may be or are impacted by an event affecting your organization.\n\nBefore you begin\n----------------\n\n1. [Enable the Service Health API](/service-health/docs/manage-access#enable-service-health-api-single-project) for at least one project under your organization. The OrganizationEvents and OrganizationImpacts API resources get information only for projects that have the Service Health API enabled.\n2.\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n3. Set [permissions to access the Service Health API](/service-health/docs/manage-access#access-service-health-api-dashboard).\n4. Configure Identity and Access Management (IAM) permissions on your organization to use\n the OrganizationEvents and OrganizationImpacts API resources. Run the\n following command:\n\n gcloud organizations add-iam-policy-binding $\u003cvar scope=\"ORGANIZATION_ID\" translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e \\\n --member {USER|GROUP|SERVICE_ACCOUNT} \\\n --role roles/servicehealth.viewer\n\n To get your \u003cvar class=\"readonly\" translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e, see [Getting your organization resource ID](/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).\n\n The IAM policies granted on an organization are inherited by\n all projects in the organization. These policies allow you to access\n organization and project event APIs across the organization.\n\nReferences\n----------\n\nSee the [OrganizationEvents](/service-health/docs/reference/rest/v1/organizations.locations.organizationEvents)\nand\n[OrganizationImpacts](/service-health/docs/reference/rest/v1/organizations.locations.organizationImpacts)\nAPI reference for the methods you can use, and the meaning of the fields in the\nresponse.\n\nWhen setting the product or location, use the values found at\n[Google Cloud products](/service-health/docs/supported-products-locations) and\n[locations](/service-health/docs/supported-products-locations#locations).\n\nList projects under an organization that may be affected by an event\n--------------------------------------------------------------------\n\nSee the [quickstart](/service-health/docs/list-events#list_projects_under_an_organization_that_may_be_affected_by_an_event).\n\nList all active incidents for an organization\n---------------------------------------------\n\nSee the [quickstart](/service-health/docs/list-events#list_all_active_incidents_for_an_organization).\n\nGet details for an event affecting an organization\n--------------------------------------------------\n\nYou can use the Get API to view detailed information about an event affecting an\norganization.\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar class=\"edit\" scope=\"API_VERSION\" translate=\"no\"\u003eAPI_VERSION\u003c/var\u003e: The API version to use. Use `v1` or `v1beta`.\n- \u003cvar class=\"edit\" scope=\"ORGANIZATION_ID\" translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e: your Google Cloud organization ID.\n- \u003cvar class=\"edit\" scope=\"EVENT_ID\" translate=\"no\"\u003eEVENT_ID\u003c/var\u003e: the ID of the event.\n\n\nHTTP method and URL:\n\n```\nGET https://servicehealth.googleapis.com/API VERSION/organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID\n```\n\nTo send your request, expand one of these options:\n\n#### curl (Linux, macOS, or Cloud Shell)\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\ncurl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n \"https://servicehealth.googleapis.com/API VERSION/organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID\"\n```\n\n#### PowerShell (Windows)\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -Uri \"https://servicehealth.googleapis.com/API VERSION/organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID\" | Select-Object -Expand Content\n```\n\nYou should receive a JSON response similar to the following:\n\n```\n{\n \"name\": \"organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID\",\n \"title\": \"We are experiencing a connectivity issue affecting Google Cloud SQL in us-east1, australia-southeast2.\",\n \"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.\",\n \"category\": \"INCIDENT\",\n \"detailedCategory\": \"CONFIRMED_INCIDENT\",\n \"state\": \"CLOSED\",\n \"detailedState\": \"RESOLVED\",\n \"eventImpacts\": [\n {\n \"product\": {\n \"productName\": \"Google Cloud SQL\",\n \"id\": \"hV87iK5DcEXKgWU2kDri\",\n },\n \"location\": {\n \"locationName\": \"us-central1\",\n }\n }\n ],\n \"updates\": [\n {\n \"updateTime\": \"2022-10-18T17:41:20.112287Z\",\n \"title\": \"We are experiencing a connectivity issue affecting Google Cloud SQL in us-east1, australia-southeast2.\",\n \"description\": \"We are experiencing an intermittent issue with Google Cloud SQL. Our engineering team continues to investigate the issue.\",\n \"symptom\": \"None at this time.\",\n \"workaround\": \"None at this time.\"\n },\n {\n \"updateTime\": \"2022-10-18T18:00:05.690761Z\",\n \"title\": \"We are experiencing a connectivity issue affecting Google Cloud SQL in us-east1, australia-southeast2.\",\n \"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.\",\n \"symptom\": \"None at this time.\",\n \"workaround\": \"None at this time.\"\n }\n ],\n \"updateTime\": \"2022-10-18T18:00:05.690761Z\",\n \"startTime\": \"2022-10-18T17:41:20.112287Z\",\n \"endTime\": \"2022-10-18T18:00:05.690761Z\",\n}\n```\n\nIf you don't have\npermissions to get events,\nyou will get the following `PERMISSION_DENIED` error. \n\n {\n \"error\": {\n \"code\": 403,\n \"message\": \"Permission 'servicehealth.organizationEvents.get' denied on resource '//servicehealth.googleapis.com/organizations/\u003cvar scope=\"ORGANIZATION_ID\" translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e/locations/global/organizationEvents/\u003cvar scope=\"EVENT_ID\" translate=\"no\"\u003eEVENT_ID\u003c/var\u003e' (or it may not exist).\",\n \"status\": \"PERMISSION_DENIED\",\n \"details\": [\n {\n \"@type\": \"type.googleapis.com/google.rpc.ErrorInfo\",\n \"reason\": \"IAM_PERMISSION_DENIED\",\n \"domain\": \"servicehealth.googleapis.com\",\n \"metadata\": {\n \"resource\": \"organizations/\u003cvar scope=\"ORGANIZATION_ID\" translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e/locations/global/organizationEvents/\u003cvar scope=\"EVENT_ID\" translate=\"no\"\u003eEVENT_ID\u003c/var\u003e\",\n \"permission\": \"servicehealth.organizationEvents.get\"\n }\n }\n ]\n }\n }\n\nTo fix this error, set the [required permissions](/service-health/docs/manage-access#access-service-health-api-dashboard).\n\nGet details for a project under an organization that may be affected by an event\n--------------------------------------------------------------------------------\n\nFor a given event, the event ID remains the same between your project and\norganization events.\n[`OrganizationImpact`](/service-health/docs/reference/rest/v1/organizations.locations.organizationImpacts#resource:-organizationimpact) contains an \u003cvar class=\"readonly\" translate=\"no\"\u003eEVENT_ID\u003c/var\u003e and a \u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e, which you can use to\n[get details for an event](/service-health/docs/project-events#get_incident_details) affecting\nyour project. These details include\n[`state`](/service-health/docs/reference/rest/v1/projects.locations.events#state) and\n[`relevance`](/service-health/docs/reference/rest/v1/projects.locations.events#relevance).\n\n\u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e is interchangeable with \u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e, which the Get API\nreturns."]]