개요

Alert Center API를 사용하면 도메인에 영향을 주는 알림을 관리할 수 있습니다. 알림은 Google에서 감지한 잠재적인 보안 문제에 대한 경고입니다. 알림에는 다음 정보가 포함됩니다.

  • 알림이 발생한 소스입니다.
  • 경고의 이름입니다.
  • 이 알림이 발생한 시간입니다.
  • 이 알림과 관련된 구체적인 데이터입니다.

도메인 관리자는 Google 관리 콘솔에서 수동으로 알림을 확인하고 관리할 수 있습니다. Alert Center API를 사용하면 앱을 빌드한 앱에서 알림 데이터 및 알림 의견을 가져올 수 있습니다. API는 기존 알림에 대한 새로운 알림 의견을 만들 수도 있습니다.

예를 들어 모니터링 앱에서 Alert Center API를 사용하여 도메인의 최근 알림을 검색하고 우선순위를 지정한 후 조직의 구성원에게 알릴 수 있습니다. 팀이 알림에 응답하면 앱은 결과를 기반으로 알림에 피드백을 첨부할 수 있습니다.

Alert Center API 사용

Alert Center API를 사용하기 전에 새 Cloud Platform 프로젝트를 설정하고 Alert Center API를 사용 설정해야 합니다. 프로젝트에서 API에 액세스할 때는 서비스 계정을 사용해야 합니다.

앱에 기본 요건을 충족하는 Cloud 프로젝트가 있고 적절하게 승인되면 Alert Center API REST 요청을 할 수 있습니다. 제공되는 클라이언트 라이브러리를 사용하면 더 쉽게 API를 요청할 수 있습니다.

다음 예시에서는 API를 사용하여 사용 가능한 알림을 나열하는 방법을 보여줍니다.

Java

// First, authorize the API and create a client to make requests with.
URL serviceAccountUrl = AuthUtils.class.getResource("/client_secret.json");
GoogleCredentials credentials =  ServiceAccountCredentials
    .fromStream(serviceAccountUrl.openStream())
    .createDelegated("admin@xxxx.com")
    .createScoped(Collections.singleton("https://www.googleapis.com/auth/apps.alerts"));
ApacheHttpTransport transport = new ApacheHttpTransport();
HttpCredentialsAdapter adapter = new HttpCredentialsAdapter(credentials);
AlertCenter alertCenter = new AlertCenter.Builder(transport, new JacksonFactory(), adapter)
    .setApplicationName("Alert Center client")
    .build();

// List alerts in pages, printing each alert discovered.
String pageToken = null;
do {
  ListAlertsResponse listResponse = service.alerts().list().setPageToken(pageToken)
      .setPageSize(20).execute();
  if (listResponse.getAlerts() != null) {
    for (Alert alert : listResponse.getAlerts()) {
      System.out.println(alert);
    }
  }
  pageToken = listResponse.getNextPageToken();
} while (pageToken != null);