Este documento explica como usar a API Service Health para gerenciar eventos que afetam um único projeto.
Antes de começar
Verify that billing is enabled for your Google Cloud project.
- Ative a API Service Health no projeto em que você quer gerenciar eventos.
- Defina as permissões para acessar a API Service Health.
Referências
Consulte a referência da API Events (v1, v1beta) para conferir os métodos que podem ser usados e o significado dos campos nas respostas.
Ao definir o produto ou local, use os valores encontrados em Google Cloud products e locations.
Listar todos os incidentes ativos de um projeto
Consulte o guia de início rápido.
Receber detalhes do incidente
Use a API Get para conferir informações detalhadas sobre um evento.
Antes de usar os dados da solicitação abaixo, faça as substituições a seguir:
- API_VERSION: a versão da API a ser usada. Use
v1ouv1beta. - PROJECT_ID: é seu ID do projeto no Google Cloud.
- EVENT_ID: o ID do evento.
Método HTTP e URL:
GET https://servicehealth.googleapis.com/API VERSION/projects/PROJECT_ID/locations/global/events/EVENT_ID
Para enviar a solicitação, expanda uma destas opções:
Você receberá uma resposta JSON semelhante a esta:
{
"name": "projects/PROJECT_ID/locations/global/events/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",
"artifacts": [
{
"artifact": "projects/PROJECT_ID/locations/global/artifacts/artifact_id",
"artifactCategory": "ARTIFACT_CATEGORY_INCIDENT_REPORT",
}
],
"eventImpacts": [
{
"product": {
"productName": "Google Cloud SQL",
"id": "hV87iK5DcEXKgWU2kDri",
},
"location": {
"locationName": "us-central1",
}
}
],
"relevance": "RELATED",
"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",
}
Se você não tiver as permissões para receber eventos, vai aparecer o seguinte erro PERMISSION_DENIED.
{
"error": {
"code": 403,
"message": "Permission 'servicehealth.events.get' denied on resource '//servicehealth.googleapis.com/projects/PROJECT_ID/locations/global/events/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": "projects/PROJECT_ID/locations/global/events/EVENT_ID",
"permission": "servicehealth.events.get"
}
}
]
}
}
Para corrigir o erro, defina as permissões necessárias.