이 문서에서는 Google Cloud 프로젝트 또는 조직의 Google Cloud 제품에 영향을 미치거나 영향을 미쳤을 수 있는 서비스 상태 이벤트를 나열하는 방법을 설명합니다. Service Health API를 사용합니다.
시작하기 전에
-
Enable the Service Health API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.gcloud services enable servicehealth.googleapis.com
-
Verify that billing is enabled for your Google Cloud project.
- 이 가이드에 기존 프로젝트를 사용하는 경우 이 가이드를 완료하는 데 필요한 권한이 있는지 확인합니다. 새 프로젝트를 만든 경우에는 이미 필요한 권한이 있습니다.
필요한 역할
서비스 상태 이벤트를 나열하는 데 필요한 권한을 얻으려면 관리자에게 이벤트를 나열하려는 프로젝트 또는 조직에 대한 맞춤 서비스 상태 뷰어 (roles/servicehealth.viewer) IAM 역할을 부여해 달라고 요청하세요.
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.
커스텀 역할이나 다른 사전 정의된 역할을 통해 필요한 권한을 얻을 수도 있습니다.
참조
사용할 수 있는 메서드와 응답의 필드 의미는 이벤트 (v1,v1beta), 조직 이벤트 (v1,v1beta), 조직 영향 (v1, v1beta) API 참조를 참고하세요.
제품 또는 위치를 설정할 때는 Google Cloud products 및 locations에 있는 값을 사용합니다.
프로젝트의 모든 활성 인시던트 나열
특정 Google Cloud 프로젝트의 모든 Google Cloud 인시던트를 나열할 수 있습니다.
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- API_VERSION: 사용할 API 버전입니다.
v1또는v1beta을 사용합니다. - PROJECT_ID: 프로젝트 ID입니다.
HTTP 메서드 및 URL:
GET https://servicehealth.googleapis.com/API_VERSION/projects/PROJECT_ID/locations/global/events?filter=state=ACTIVE%20category=INCIDENT&page_size=2&page_token={page_token}요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
다음과 비슷한 JSON 응답이 표시됩니다.
{
"events": [
{
"name": "projects/PROJECT_ID/locations/global/events/event-123",
"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. We thank you for your patience while we worked on resolving the issue.",
"category": "INCIDENT",
"detailedCategory": "CONFIRMED_INCIDENT",
"state": "ACTIVE",
"detailedState": "CONFIRMED",
"eventImpacts": [
{
"product": {
"productName": "Google Cloud SQL",
"id": "hV87iK5DcEXKgWU2kDri",
},
"location": {
"locationName": "asia-east2",
}
},
{
"product": {
"productName": "Google Cloud SQL",
"id": "hV87iK5DcEXKgWU2kDri",
},
"location": {
"locationName": "asia-southeast1",
}
}
],
"relevance": "RELATED",
"updateTime": "2022-10-18T17:44:05.690761Z",
"startTime": "2022-10-18T17:41:20.112287Z",
},
{
"name": "projects/PROJECT_ID/locations/global/events/event-567",
"title": "Cloud Firestore may experience errors.",
"description": "Mitigation work is currently underway by our engineering team. The mitigation is expected to complete by 2022-10-07T16:30:00Z.",
"category": "INCIDENT",
"detailedCategory": "CONFIRMED_INCIDENT",
"state": "ACTIVE",
"detailedState": "CONFIRMED",
"eventImpacts": [
{
"product": {
"productName": "Cloud Firestore",
"id": "CETSkT92V21G6A1x28me",
},
"location": {
"locationName": "us-central1-a",
}
}
],
"relevance": "RELATED",
"updateTime": "2022-10-07T15:19:59.409530Z",
"startTime": "2022-10-07T15:10:35.887125Z",
"nextUpdateTime": "2022-10-07T16:30:00Z"
}
],
"nextPageToken": "CgwIw8bDmgYQz4nUlgMQChomcHJvamVjdHMvcHNoLW1hbnVhbC"
}
이벤트를 나열할 필요한 권한이 없으면 PERMISSION_DENIED 오류가 발생합니다.
{
"error": {
"code": 403,
"message": "Permission 'servicehealth.events.list' denied on resource '//servicehealth.googleapis.com/projects/PROJECT_ID/locations/global' (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",
"permission": "servicehealth.events.list"
}
}
]
}
}
조직의 모든 활성 인시던트 나열
특정 Google Cloud 조직에서 Personalized Service Health를 사용 설정한 프로젝트에 영향을 미치는 모든 Google Cloud 문제를 나열할 수 있습니다.
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- API_VERSION: 사용할 API 버전입니다.
v1또는v1beta을 사용합니다. - ORGANIZATION_ID: Google Cloud 조직 ID입니다.
HTTP 메서드 및 URL:
GET https://servicehealth.googleapis.com/API_VERSION/organizations/ORGANIZATION_ID/locations/global/organizationEvents?filter=state=ACTIVE%20category=INCIDENT&page_size=2&page_token={page_token}요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
다음과 비슷한 JSON 응답이 표시됩니다.
{
"organization_events": [
{
"name": "organizations/ORGANIZATION_ID/locations/global/organizationEvents/event-123",
"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. We thank you for your patience while we worked on resolving the issue.",
"category": "INCIDENT",
"detailedCategory": "CONFIRMED_INCIDENT",
"state": "ACTIVE",
"detailedState": "CONFIRMED",
"eventImpacts": [
{
"product": {
"productName": "Google Cloud SQL",
"id": "hV87iK5DcEXKgWU2kDri",
},
"location": {
"locationName": "asia-east2",
}
},
{
"product": {
"productName": "Google Cloud SQL",
"id": "hV87iK5DcEXKgWU2kDri",
},
"location": {
"locationName": "asia-southeast1",
}
}
],
"updateTime": "2022-10-18T17:44:05.690761Z",
"startTime": "2022-10-18T17:41:20.112287Z",
},
{
"name": "organizations/ORGANIZATION_ID/locations/global/organizationEvents/event-567",
"title": "Cloud Firestore may experience errors.",
"description": "Mitigation work is currently underway by our engineering team. The mitigation is expected to complete by 2022-10-07T16:30:00Z.",
"category": "INCIDENT",
"detailedCategory": "CONFIRMED_INCIDENT",
"state": "ACTIVE",
"detailedState": "CONFIRMED",
"eventImpacts": [
{
"product": {
"productName": "Cloud Firestore",
"id": "CETSkT92V21G6A1x28me",
},
"location": {
"locationName": "us-central1-a",
}
}
],
"updateTime": "2022-10-07T15:19:59.409530Z",
"startTime": "2022-10-07T15:10:35.887125Z",
"nextUpdateTime": "2022-10-07T16:30:00Z"
}
],
"nextPageToken": "CgwIw8bDmgYQz4nUlgMQChomcHJvamVjdHMvcHNoLW1hbnVhbC"
}
ORGANIZATION_ID를 가져오려면 조직 리소스 ID 가져오기를 참고하세요.
이벤트를 나열할 권한이 없으면 PERMISSION_DENIED 오류가 표시됩니다.
{
"error": {
"code": 403,
"message": "Permission 'servicehealth.organizationEvents.list' denied on resource '//servicehealth.googleapis.com/organizations/ORGANIZATION_ID/locations/global' (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/<var class="readonly">ORGANIZATION_ID</var>/locations/global",
"permission": "servicehealth.organizationEvents.list"
}
}
]
}
}
이 이벤트의 영향을 받을 수 있는 조직의 프로젝트를 나열합니다.
다음과 같은 특정 Google Cloud 조직의 모든 프로젝트를 나열할 수 있습니다.
- 이벤트 (
OrganizationImpact)의 영향을 받을 수 있습니다. - Personalized Service Health를 사용 설정했습니다.
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- API_VERSION: 사용할 API 버전입니다.
v1또는v1beta을 사용합니다. - EVENT_ID: 조직에 영향을 미칠 수 있는 이벤트의 ID입니다.
- ORGANIZATION_ID: Google Cloud 조직 ID입니다.
HTTP 메서드 및 URL:
GET https://servicehealth.googleapis.com/API_VERSION/organizations/ORGANIZATION_ID/locations/global/organizationImpacts?filter=events:organizations%2FORGANIZATION_ID%2Flocations%2Fglobal%2FEVENT_ID&page_size=2&page_token={page_token}요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
다음과 비슷한 JSON 응답이 표시됩니다.
{
"organization_impacts": [
{
"name": "organizations/ORGANIZATION_ID/locations/global/organizationImpacts/impact-123",
"events": [
"organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID",
],
"asset": {
"assetName": "//cloudresourcemanager.googleapis.com/projects/{PROJECT_NUMBER_1}",
"assetType": "cloudresourcemanager.googleapis.com/Project",
},
"updateTime": "2022-10-18T17:44:05.690761Z",
},
{
"name": "organizations/ORGANIZATION_ID/locations/global/organizationImpacts/impact-234",
"events": [
"organizations/ORGANIZATION_ID/locations/global/organizationEvents/EVENT_ID",
],
"asset": {
"assetName": "//cloudresourcemanager.googleapis.com/projects/{PROJECT_NUMBER_2}",
"assetType": "cloudresourcemanager.googleapis.com/Project",
},
"updateTime": "2022-10-18T17:44:05.690761Z",
}
],
"nextPageToken": "CgwIw8bDmgYQz4nUlgMQChomcHJvamVjdHMvcHNoLW1hbnVhbC"
}
이벤트를 나열할 권한이 없으면 다음과 같은 PERMISSION_DENIED 오류가 표시됩니다.
{
"error": {
"code": 403,
"message": "Permission 'servicehealth.organizationImpacts.list' denied on resource '//servicehealth.googleapis.com/organizations/ORGANIZATION_ID/locations/global' (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",
"permission": "servicehealth.organizationImpacts.list"
}
}
]
}
}
다음 단계
Service Health API를 사용하여 프로젝트 또는 조직별로 이벤트 정보를 가져오는 방법을 알아보세요.