This document explains what to do if Personalized Service Health is experiencing a
disruption.

Personalized Service Health may be affected by an incident, partially or completely. You
can check for incidents, processing problems, and performance issues with
Service Health through the Status API resource and the Google Cloud
Service Health dashboard.

## Use the Status API

The Status API resource of the Service Health API tells you if specific
Service Health features are experiencing issues.

### Before you begin

To start using the Status API:

1. [Enable the Service Health API](https://docs.cloud.google.com/service-health/docs/manage-access.md.txt#enable-service-health-api-single-project) for the project or organization that you will use to access this status.
2.
   [Verify that billing is enabled for your Google Cloud project](https://docs.cloud.google.com/billing/docs/how-to/verify-billing-enabled.md.txt#confirm_billing_is_enabled_on_a_project).

3. Set [permissions to access the Service Health API](https://docs.cloud.google.com/service-health/docs/manage-access.md.txt#access-service-health-api-dashboard).
4. Configure Identity and Access Management (IAM) permissions on your project or
   organization to use the Status API.

   To configure permissions on your project, run the following command:

       gcloud projects add-iam-policy-binding PROJECT_ID \
       --member {USER|GROUP|SERVICE_ACCOUNT} \
       --role roles/servicehealth.viewer

   To configure permissions on your organization, run the following command:

       gcloud organizations add-iam-policy-binding ORGANIZATION_ID \
       --member {USER|GROUP|SERVICE_ACCOUNT} \
       --role roles/servicehealth.viewer

   To get your <var class="readonly" translate="no">ORGANIZATION_ID</var>, see [Getting your organization resource
   ID](https://docs.cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id).

The IAM policies granted on an organization are inherited by all projects in the
organization. These policies let you access organization and project event APIs
across the organization.

### References

See the [Status API reference](https://docs.cloud.google.com/service-health/docs/reference/rest/v1beta/Status.md.txt)
for the method you can use and the meaning of the fields in the response.

When setting the product or location, use the values found at [Google Cloud
products](https://docs.cloud.google.com/service-health/docs/supported-products-locations) and [locations](https://docs.cloud.google.com/service-health/docs/supported-products-locations.md.txt#locations).

### Get Service Health status using a project ID

To get the status of Service Health using a project ID, use the
following request:

```restructuredtext
GET https://servicehealth.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/status
```

If the status value is `OK`, the request yields the following response:

```restructuredtext
{
  "state": "OK",
}
```

This status indicates that the features accessed using the project ID such as
events or [impacts](https://docs.cloud.google.com/service-health/docs/reference/rest/v1beta/projects.locations.impacts.md.txt)
aren't experiencing problems internally.

If the status value is `ISSUES_DETECTED`, the request yields the following
response:

```restructuredtext
{
  "state": "ISSUES_DETECTED",
  "issues": [
    {
      "message": "We are experiencing problems creating new events",
      "details": {
        "API": "events"
      }
    },
    {
      "message": "We are experiencing problems creating new impacts",
      "details": {
        "API": "impacts"
      }
    }
  ]
}
```

An `ISSUES_DETECTED` state also returns a set of issues, indicating that
features accessed using the project ID may not be accurate.

If you don't have [permissions](https://docs.cloud.google.com/service-health/docs/manage-access.md.txt#set_required_permissions)
to get the status, you will get a `PERMISSION_DENIED` error.

```restructuredtext
{
  "error": {
    "code": 403,
    "message": "Permission 'servicehealth.statuses.get' denied on resource '//servicehealth.googleapis.com/projects/PROJECT_ID/locations/global/status' (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/status",
          "permission": "servicehealth.statuses.get"
        }
      }
    ]
  }
}
```

### Get Service Health status using an organization ID

To get the status, use the following request:

```restructuredtext
GET https://servicehealth.googleapis.com/v1beta/organizations/ORGANIZATION_ID/locations/global/status
```

If Service Health is operating without issues, the status should yield
the following response:

```restructuredtext
{
  "state": "OK",
}
```

If Service Health is experiencing issues that may affect its accuracy or
capability, the status should yield a response with the
`ISSUES_DETECTED` state:

```restructuredtext
{
  "state": "ISSUES_DETECTED",
  "issues": [
    {
      "message": "We are experiencing problems creating new organization level events",
      "details": {
        "API": "organizationEvents"
      }
    },
    {
      "message": "We are experiencing problems creating new organization level impacts",
      "details": {
        "API": "organizationImpacts"
      }
    }
  ]
}
```

If you don't have the [permissions](https://docs.cloud.google.com/service-health/docs/manage-access.md.txt#set_required_permissions) to
get the status, you will get a `PERMISSION_DENIED` error.

```restructuredtext
{
  "error": {
    "code": 403,
    "message": "Permission 'servicehealth.statuses.get denied on resource '//servicehealth.googleapis.com/organizations/ORGANIZATION_ID/locations/global/status' (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/status",
          "permission": "servicehealth.statuses.get"
        }
      }
    ]
  }
}
```

## Check Google Cloud Service Health

[Google Cloud Service Health](https://status.cloud.google.com/)
tells you if Personalized Service Health is experiencing an issue. You can also use an RSS
feed to consume the data.

For more information on Google Cloud Service Health, see
[Incidents and Google Cloud Service Health](https://docs.cloud.google.com/support/docs/dashboard).