이 문서에서는 Google Cloud 프로젝트 또는 조직의 Google Cloud 제품에 영향을 미치거나 영향을 미쳤을 수 있는 서비스 상태 이벤트를 나열하는 방법을 설명합니다. Service Health API를 사용합니다.
시작하기 전에
- 이벤트를 나열할 조직의 프로젝트에 대해 Service Health API를 사용 설정합니다.
-
Verify that billing is enabled for your Google Cloud project.
- Service Health API에 액세스할 수 있는 권한을 설정합니다.
OrganizationEvents 및 OrganizationImpacts API 리소스를 사용하도록 조직에 ID 및 액세스 관리 (IAM) 권한을 구성합니다.
아래의 명령어 데이터를 사용하기 전에 다음을 바꿉니다.
- ORGANIZATION ID: Google Cloud 조직 ID입니다.
다음 명령어를 실행합니다.
Linux, macOS 또는 Cloud Shell
gcloud organizations add-iam-policy-binding ORGANIZATION_ID \ --member {USER|GROUP|SERVICE_ACCOUNT} \ --role roles/servicehealth.viewer
Windows(PowerShell)
gcloud organizations add-iam-policy-binding ORGANIZATION_ID ` --member {USER|GROUP|SERVICE_ACCOUNT} ` --role roles/servicehealth.viewer
Windows(cmd.exe)
gcloud organizations add-iam-policy-binding ORGANIZATION_ID ^ --member {USER|GROUP|SERVICE_ACCOUNT} ^ --role roles/servicehealth.viewer
ORGANIZATION_ID를 가져오려면 조직 리소스 ID 가져오기를 참고하세요.
조직에 부여된 IAM 정책은 조직의 모든 프로젝트에 상속됩니다. 이러한 정책을 사용하면 조직 전체에서 조직 및 프로젝트 이벤트 API에 액세스할 수 있습니다.
참조
사용할 수 있는 메서드와 응답의 필드 의미는 이벤트 (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를 사용하여 프로젝트 또는 조직별로 이벤트 정보를 가져오는 방법을 알아보세요.