Add API endpoint to get service graphs (#15138)

* Add API endpoint to get service graphs

* Docs: Add missing title to get_graph_by_service
This commit is contained in:
richard-ririe
2023-07-20 04:19:43 +01:00
committed by GitHub
parent 7cdb81b2e9
commit 4c8e5fc783
3 changed files with 51 additions and 0 deletions

View File

@@ -564,6 +564,38 @@ Output:
Output is an image.
### `get_graph_by_service`
Get the graph for a service
Route: `/api/v0/devices/:hostname/services/:service_id/graphs/:datasource`
- hostname can be either the device hostname or id
- service id
- datasource is the name of the service datasource
Input:
- from: This is the date you would like the graph to start - See
[http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html](http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html)
for more information.
- to: This is the date you would like the graph to end - See
[http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html](http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html)
for more information.
- width: The graph width, defaults to 1075.
- height: The graph height, defaults to 300.
Example:
```curl
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/services/localhost/35/graphs/loss
```
Output:
Output is an image.
### `get_port_graphs`
Get a list of ports for a particular device.