Grafana HTTP API 참조 가이드

Grafana HTTP API 참조 가이드 (Grafana HTTP API reference guide)

모든 Grafana 인스턴스는 HTTP API를 노출하며, Grafana 프론트엔드가 대시보드 저장, 사용자 생성, 데이터 소스 업데이트, 알림 삭제 등의 리소스를 관리하는 데 사용해요. HTTP API를 사용해 Grafana 인스턴스에서 리소스에 프로그래밍 방식으로 접근하거나 관리할 수 있어요.

Grafana Cloud Stack의 다른 리소스를 관리하거나 접근해야 한다면 대신 Grafana Cloud API를 참고해요.

출처: 문서

본문

모든 Grafana 인스턴스는 HTTP API를 노출하며, Grafana 프론트엔드가 대시보드 저장, 사용자 생성, 데이터 소스 업데이트, 알림 삭제 등의 리소스를 관리하는 데 사용해요. HTTP API를 사용해 Grafana 인스턴스에서 리소스에 프로그래밍 방식으로 접근하거나 관리할 수 있어요.

Grafana Cloud Stack의 다른 리소스를 관리하거나 접근해야 한다면 대신 Grafana Cloud API를 참고해요.

차세대 HTTP API (New generation HTTP APIs)

Grafana는 표준화된 API 구조와 일관된 API 버전 관리를 따르는 개선된 차세대 API(/apis)를 위해 레거시 API(/api)를 폐기하고 있어요.

더 배우려면 다음을 참고해요:

Grafana API 명세 (The Grafana API specification)

Grafana HTTP API는 OpenAPI v2 명세(Swagger 2.0)와 OpenAPI v3 명세를 모두 준수해요. 둘 다 정확히 동일한 Grafana HTTP API 라우트 집합(대시보드, 폴더, 데이터 소스, 조직, 사용자, 팀, RBAC, 알림 프로비저닝 등)을 설명하지만, v2가 정식 명세이자 진실의 원천이고 v3는 v2 파일에서 변환 스크립트로 변환된 것이에요.

Grafana HTTP API를 소비하고 있다면:

  • 도구(SDK 생성기, 구형 Swagger UI, terraform-provider-grafana)가 Swagger 2.0을 기대한다면 v2를 사용해요.
  • 도구가 OpenAPI 3.x를 요구한다면(예: 최신 codegen 도구, 일부 API 게이트웨이, Postman의 최신 가져오기 기능) v3를 사용해요.

Grafana 서버가 제공하는 /swagger-ui로 이동해 Swagger UI 편집기를 통해 둘 다 탐색하고 사용해 볼 수 있어요.

인증 (Authentication)

OSS에서 HTTP API에 대한 요청을 기본 인증(basic auth)이나 서비스 계정 토큰으로 인증할 수 있어요. Grafana Cloud에서는 서비스 계정 토큰 옵션만 사용할 수 있어요. 자세한 내용은 HTTP API 인증을 참고해요.

사용 가능한 HTTP API 목록 (List of available HTTP APIs)

다음 표는 사용 가능한 모든 HTTP API 참조 페이지를 나열해요. 새 API가 먼저 나열되고, 그다음 레거시 API가 나열돼요.

테이블 펼치기

API Type Replaces legacy API
Alert enrichment HTTP API (Swagger) New No
Alert notifications HTTP API (Swagger) New No
Banners HTTP API (Swagger) New No
Dashboard HTTP API New /api/dashboards/*
Folder HTTP API New /api/folders/*
SLO (Swagger) New - Cloud only No
Playlist HTTP API New No
Resource history HTTP API New No
Secrets Management HTTP API New No
Admin HTTP API Deprecated Not Applicable
Alerting Provisioning HTTP API Deprecated Not Applicable
Annotations HTTP API Deprecated Not Applicable
Correlations HTTP API Deprecated Not Applicable
Dashboard Permissions HTTP API Deprecated Not Applicable
Dashboard Versions HTTP API Deprecated Not Applicable
Data source HTTP API Deprecated Not Applicable
Data source LBAC rules HTTP API Deprecated Not Applicable
Data source permissions HTTP API Deprecated Not Applicable
Folder/Dashboard Search HTTP API Deprecated Not Applicable
Folder Permissions HTTP API Deprecated Not Applicable
Library Element HTTP API Deprecated Not Applicable
Licensing HTTP API Deprecated Not Applicable
Organization HTTP API Deprecated Not Applicable
Other HTTP API Deprecated Not Applicable
Preferences API Deprecated Not Applicable
Query and Resource Caching HTTP API Deprecated Not Applicable
Query History HTTP API Deprecated Not Applicable
RBAC HTTP API Deprecated Not Applicable
Reporting API Deprecated Not Applicable
Service account HTTP API Deprecated Not Applicable
Shared Dashboards HTTP API Deprecated Not Applicable
Short URL HTTP API Deprecated Not Applicable
Snapshot API Deprecated Not Applicable
SSO Settings API Deprecated Not Applicable
Team HTTP API Deprecated Not Applicable
Team Sync HTTP API Deprecated Not Applicable
User HTTP API Deprecated Not Applicable

Grafana API로 계속 작업하려면 다음 리소스를 사용해요:

더 알아보기 (Learn more)