api.php 2.37 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

$parameters = env('AUTH_ENABLED') ? ['middleware' => 'auth:api'] : [];

Route::group($parameters, function () {
Route::get('config', 'ConfigController@index');
Route::get('capec', 'CapecController@index');
Route::group(['prefix' => 'v1'], function () {

Route::post('adt', 'V1\Partners\AdtController@store');
Route::post('xlsiem', 'V1\Partners\XlsiemController@store');
Route::post('vdm', 'V1\Partners\VdmController@store');

Route::group(['prefix' => 'ceptd'], function () {
Route::get('start', 'V1\Components\CeptdController@start');
Route::get('status', 'V1\Components\CeptdController@status');
Route::get('stop', 'V1\Components\CeptdController@stop');
});
Route::group(['prefix' => 'mltd'], function () {
Route::get('start', 'V1\Components\MltdController@start');
Route::get('status', 'V1\Components\MltdController@status');
Route::get('stop/{pid}', 'V1\Components\MltdController@stop');
Route::get('events/count','V1\Components\MltdController@count');
Route::get('events/group','V1\Components\MltdController@group');
Route::get('events/last','V1\Components\MltdController@last');
//should be last since matches to anything */*
Route::get('{train_id}/{top}', 'V1\Components\MltdController@train');
});
Route::group(['prefix' => 'od'], function () {
Route::get('start', 'V1\Components\OdController@start');
Route::get('status', 'V1\Components\OdController@status');
Route::get('stop/{pid}', 'V1\Components\OdController@stop');
Route::post('analyze/{pid}', 'V1\Components\OdController@analyze');
Route::get('events/count','V1\Components\OdController@count');
Route::get('events/group','V1\Components\OdController@group');
Route::get('events/last','V1\Components\OdController@last');
});
});
});