Personalized Service Health API로 조직 이벤트에 액세스

이 문서에서는 Service Health API를 사용하여 조직에 영향을 미치는 이벤트에 액세스하는 방법을 설명합니다.

Personalized Service Health는 조직에 영향을 미치는 이벤트에 관한 정보를 가져올 수 있는 OrganizationEvents 및 OrganizationImpacts API 리소스를 제공합니다. 이러한 정보에는 다음이 포함됩니다.

  • 조직의 하나 이상의 프로젝트에 영향을 줄 수 있는 서비스 상태 이벤트입니다.
  • 조직에 영향을 미치는 이벤트로 인해 영향을 받을 수 있거나 영향을 받는 프로젝트 목록입니다.

Google Cloud 콘솔에서 조직 수준 인시던트를 보는 방법을 알아보려면 Google Cloud 콘솔에서 조직 인시던트 보기를 참고하세요.

시작하기 전에

  1. 조직의 하나 이상의 프로젝트에 Service Health API를 사용 설정합니다. OrganizationEvents 및 OrganizationImpacts API 리소스는 Service Health API가 사용 설정된 프로젝트의 정보만 가져옵니다.
  2. Verify that billing is enabled for your Google Cloud project.

  3. Service Health API에 액세스할 수 있는 권한을 설정합니다.
  4. OrganizationEvents 및 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에 액세스할 수 있습니다.

참조

사용할 수 있는 메서드와 응답의 필드 의미는 OrganizationEventsOrganizationImpacts API 참조를 참고하세요.

제품 또는 위치를 설정할 때는 Google Cloud productslocations에 있는 값을 사용합니다.

이 이벤트의 영향을 받을 수 있는 조직의 프로젝트를 나열합니다.

빠른 시작을 참고하세요.

조직의 모든 활성 인시던트 나열

빠른 시작을 참고하세요.

조직에 영향을 미치는 이벤트의 세부정보 가져오기

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_IDPROJECT_NUMBER이 포함되어 있으며, 이를 사용하여 프로젝트에 영향을 미치는 이벤트의 세부정보를 가져올 수 있습니다. 이러한 세부정보에는 staterelevance가 포함됩니다.

PROJECT_NUMBER는 Get API에서 반환하는 PROJECT_ID와 상호 교환할 수 있습니다.