mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Tidy API entry points & doc; error if something other than image/png is asked for from portgroup graphs
This commit is contained in:
@ -377,9 +377,16 @@ function list_bgp() {
|
||||
echo _json_encode($output);
|
||||
}
|
||||
|
||||
function get_graph_by_group() {
|
||||
function get_graph_by_portgroup() {
|
||||
global $config;
|
||||
$app = \Slim\Slim::getInstance();
|
||||
if ($app->request->getMediaType() != "image/png") {
|
||||
// we only support PNG graphs at the moment
|
||||
$app->response->setStatus(406); // Not Acceptable
|
||||
echo("<h3>Not Acceptable</h3>\n");
|
||||
echo("<p>Only media type 'image/png' is provided at present</p>\n");
|
||||
return;
|
||||
}
|
||||
$router = $app->router()->getCurrentRoute()->getParams();
|
||||
$group = $router['group'];
|
||||
$vars = array();
|
||||
|
Reference in New Issue
Block a user