Returns PNG image of a dashboard panel. To display any data on the graph you must include a ‘target’, you can append multiple targets to the request as follows: ?target=foo.bar.A&target=foo.bar.B
Parameters
Name
Type
Description
target*
String
graphite query
from
String
Format: -<num>m|h|d|w|M|Y
default: -6h
to
String
Format: now-<num>m|h|d|w|M|Y
default: now
width
String
number measured in pixels
default: 1000
height
String
number measured in pixels
default: 500
style
String
Format: “light” | “dark ”
default: dark
Curl Example:
curl -i -X GET \
"https://<api-key>@api.hostedgraphite.com/api/v3/grafana/render/?target=foo.bar"
Response:
HTTP/1.1 200
Content-Type: image/png
<image data>
Bad Request Invalid form data
Unauthorized
Time Queries:
m = Minutes
h = Hours
d = Days
w = Weeks
M = Months
Y = Years
To use the Grafana API, you will need to create a new Grafana API key within the Grafana UI (Settings => Service Accounts => Add Service Account with Admin role => Generate Service Account Token).
This token will be referred to as <SERVICE-ACCOUNT-TOKEN> in the examples below.
In all examples <UID> refers to the URL subdomain of your hosted instance, uid refers to the unique identifier of the related resource. Below are examples of requests made using the Grafana API.
POST/api/dashboards/db
Creates a new dashboard or updates an existing dashboard