mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added the ability to call the api for a list of endpoints
This commit is contained in:
@ -478,3 +478,15 @@ function get_vlans() {
|
||||
$app->response->headers->set('Content-Type', 'application/json');
|
||||
echo _json_encode($output);
|
||||
}
|
||||
|
||||
function show_endpoints() {
|
||||
global $config;
|
||||
$app = \Slim\Slim::getInstance();
|
||||
$routes = $app->router()->getNamedRoutes();
|
||||
foreach($routes as $route) {
|
||||
$output[$route->getName()] = $config['base_url'].$route->getPattern();
|
||||
}
|
||||
$app->response->setStatus('200');
|
||||
$app->response->headers->set('Content-Type', 'application/json');
|
||||
echo _json_encode($output);
|
||||
}
|
||||
|
Reference in New Issue
Block a user