Add API endpoint for getting server resource utilization, closes #900
This endpoint is throttled to 15 requests per minute to avoid destroying the daemon since clients can use it.
This commit is contained in:
parent
bac02f64e3
commit
3e2ac981a9
3 changed files with 115 additions and 0 deletions
|
@ -22,6 +22,9 @@ Route::get('/', 'ClientController@index')->name('api.client.index');
|
|||
*/
|
||||
Route::group(['prefix' => '/servers/{server}', 'middleware' => [AuthenticateClientAccess::class]], function () {
|
||||
Route::get('/', 'Servers\ServerController@index')->name('api.client.servers.view');
|
||||
Route::get('/utilization', 'Servers\ResourceUtilizationController@index')
|
||||
->middleware(['throttle:15,1'])
|
||||
->name('api.client.servers.resources');
|
||||
|
||||
Route::post('/command', 'Servers\CommandController@index')->name('api.client.servers.command');
|
||||
Route::post('/power', 'Servers\PowerController@index')->name('api.client.servers.power');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue