Added api call to delete device

This commit is contained in:
laf
2014-09-17 21:03:02 +01:00
parent d40244cb06
commit 8790bfee0a
4 changed files with 88 additions and 6 deletions

View File

@@ -30,12 +30,13 @@ $app->setName('api');
$app->group('/api', function() use ($app) {
$app->group('/v0', function() use ($app) {
$app->group('/devices', function() use ($app) {
$app->get('/:hostname/ports/:ifname/:type', 'authToken', 'get_graph_by_port_hostname');//api/v1/devices/$hostname/ports/$ifName/$type
$app->get('/:hostname/:type', 'authToken', 'get_graph_generic_by_hostname');//api/v1/devices/$hostname/$type
$app->get('/:hostname/ports/:ifname', 'authToken', 'get_port_stats_by_port_hostname');//api/v1/devices/$hostname/ports/$ifName
$app->get('/:hostname/ports/:ifname/:type', 'authToken', 'get_graph_by_port_hostname');//api/v0/devices/$hostname/ports/$ifName/$type
$app->get('/:hostname/:type', 'authToken', 'get_graph_generic_by_hostname');//api/v0/devices/$hostname/$type
$app->get('/:hostname/ports/:ifname', 'authToken', 'get_port_stats_by_port_hostname');//api/v0/devices/$hostname/ports/$ifName
});
$app->get('/devices', 'authToken', 'list_devices');//api/v1/devices
$app->post('/devices', 'authToken', 'add_device');//api/v1/devices (json data needs to be passed)
$app->get('/devices', 'authToken', 'list_devices');//api/v0/devices
$app->post('/devices', 'authToken', 'add_device');//api/v0/devices (json data needs to be passed)
$app->delete('/devices/:hostname', 'authToken', 'del_device');//api/v0/devices (json data needs to be passed)
});
});