Este documento explica como usar a API Service Health para gerir 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 para o projeto para o qual quer gerir eventos.
- Defina autorizações para aceder à API Service Health.
Referências
Consulte a referência da API Events (v1, v1beta) para ver os métodos que pode usar e o significado dos campos nas respostas.
Quando definir o produto ou a localização, use os valores encontrados em Google Cloud products e locations.
Apresenta todos os incidentes ativos de um projeto
Consulte o início rápido.
Obtenha detalhes do incidente
Pode usar a API Get para ver informações detalhadas sobre um evento.
Antes de usar qualquer um dos dados do pedido, faça as seguintes substituições:
- API_VERSION: a versão da API a usar. Use
v1ouv1beta. - PROJECT_ID: o ID do seu projeto do 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 o seu pedido, expanda uma destas opções:
Deve receber uma resposta JSON semelhante à seguinte:
{
"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 não tiver as autorizações para receber eventos, recebe 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 autorizações necessárias.