Install
[]
= "0.1" # async + rustls (default)
Blocking-only (no Tokio):
[]
= { = "0.1", = false, = ["blocking", "rustls"] }
Native TLS: replace rustls with native-tls (and set default-features = false).
Features
async(default):tokio+reqwest.blocking:reqwest::blocking.rustls(default) /native-tls: pick one TLS backend.tracing: request spans.
If you run inside Tokio, call blocking APIs from spawn_blocking or a dedicated thread pool.
Quick start (async)
use ;
async
Quick start (blocking)
use ;
Base URL
Pass the Grafana root URL (optionally with a subpath). The client automatically targets /api.
Examples:
https://grafana.example.comhttps://example.com/grafana
API coverage
- Hand-written wrappers:
client.dashboards(),client.folders(),client.user(), ... - Generated wrappers:
client.openapi()(method-per-operation, keyed by GrafanaoperationId). - Escape hatch:
client.raw()for custom requests.
Compatibility
Endpoint wrappers follow the latest Grafana OpenAPI spec (grafana/grafana public/openapi3.json).
For full coverage across Grafana versions, use raw() for unwrapped endpoints.
Contract tests (repo)
Run the ignored contract tests against a real Grafana:
# Bearer token auth
GRAFANA_BASE_URL="https://grafana.example.com" GRAFANA_TOKEN="..." \
# Basic auth
GRAFANA_BASE_URL="http://localhost:3000" GRAFANA_USERNAME="admin" GRAFANA_PASSWORD="admin" \