示例#1
0
 /**
  * Define the api routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->group(['namespace' => 'Api', 'prefix' => 'api/v1', 'middleware' => 'accept:application/json'], function ($router) {
         // General
         $router->get('ping', 'GeneralController@ping');
         // Components
         $router->get('components', 'ComponentController@getComponents');
         $router->get('components/{component}', 'ComponentController@getComponent');
         // Incidents
         $router->get('incidents', 'IncidentController@getIncidents');
         $router->get('incidents/{incident}', 'IncidentController@getIncident');
         // Metrics
         $router->get('metrics', 'MetricController@getMetrics');
         $router->get('metrics/{metric}', 'MetricController@getMetric');
         $router->get('metrics/{metric}/points', 'MetricController@getMetricPoints');
         // Api protected
         $router->group(['middleware' => 'auth.api'], function ($router) {
             $router->post('components', 'ComponentController@postComponents');
             $router->post('incidents', 'IncidentController@postIncidents');
             $router->post('metrics', 'MetricController@postMetrics');
             $router->post('metrics/{metric}/points', 'MetricPointController@postMetricPoints');
             $router->put('components/{component}', 'ComponentController@putComponent');
             $router->put('incidents/{incident}', 'IncidentController@putIncident');
             $router->put('metrics/{metric}', 'MetricController@putMetric');
             $router->put('metrics/{metric}/points/{metric_point}', 'MetricPointController@putMetricPoint');
             $router->delete('components/{component}', 'ComponentController@deleteComponent');
             $router->delete('incidents/{incident}', 'IncidentController@deleteIncident');
             $router->delete('metrics/{metric}', 'MetricController@deleteMetric');
             $router->delete('metrics/{metric}/points/{metric_point}', 'MetricPointController@deleteMetricPoint');
         });
     });
 }
示例#2
0
 /**
  * Define the api routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->group(['namespace' => 'Api', 'prefix' => 'api/v1', 'middleware' => ['accept:application/json', 'timezone', 'auth.api.optional']], function ($router) {
         // General
         $router->get('ping', 'GeneralController@ping');
         // Projects
         $router->get('projects', 'ProjectController@getProjects');
         $router->get('projects/teams', 'ProjectTeamController@getTeams');
         $router->get('projects/teams/{project_team}', 'ProjectTeamController@getTeam');
         $router->get('projects/{project}', 'ProjectController@getProject');
         // Issues
         $router->get('issues', 'IssueController@getIssues');
         $router->get('issues/{issue}', 'IssueController@getIssue');
         // Authorization Required
         $router->group(['middleware' => 'auth.api'], function ($router) {
             $router->get('subscribers', 'SubscriberController@getSubscribers');
             $router->post('projects', 'ProjectController@postProjects');
             $router->post('projects/teams', 'ProjectTeamController@postTeams');
             $router->post('issues', 'IssueController@postIssues');
             $router->post('subscribers', 'SubscriberController@postSubscribers');
             $router->put('projects/teams/{project_team}', 'ProjectTeamController@putTeam');
             $router->put('projects/{project}', 'ProjectController@putProject');
             $router->put('issues/{issue}', 'IssueController@putIssue');
             $router->delete('projects/teams/{project_team}', 'ProjectTeamController@deleteTeam');
             $router->delete('projects/{project}', 'ProjectController@deleteProject');
             $router->delete('issues/{issue}', 'IssueController@deleteIssue');
             $router->delete('subscribers/{subscriber}', 'SubscriberController@deleteSubscriber');
         });
     });
 }
示例#3
0
 /**
  * Define the api routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  */
 public function map(Registrar $router)
 {
     $router->group(['namespace' => 'Api', 'prefix' => 'api/v1', 'middleware' => ['accept:application/json', 'timezone', 'auth.api.optional']], function ($router) {
         // General
         $router->get('ping', 'GeneralController@ping');
         // Components
         $router->get('components', 'ComponentController@getComponents');
         $router->get('components/groups', 'ComponentGroupController@getGroups');
         $router->get('components/groups/{component_group}', 'ComponentGroupController@getGroup');
         $router->get('components/{component}', 'ComponentController@getComponent');
         // Incidents
         $router->get('incidents', 'IncidentController@getIncidents');
         $router->get('incidents/{incident}', 'IncidentController@getIncident');
         // Metrics
         $router->get('metrics', 'MetricController@getMetrics');
         $router->get('metrics/{metric}', 'MetricController@getMetric');
         $router->get('metrics/{metric}/points', 'MetricController@getMetricPoints');
         // Authorization Required
         $router->group(['middleware' => 'auth.api'], function ($router) {
             $router->get('subscribers', 'SubscriberController@getSubscribers');
             $router->post('components', 'ComponentController@postComponents');
             $router->post('components/groups', 'ComponentGroupController@postGroups');
             $router->post('incidents', 'IncidentController@postIncidents');
             $router->post('metrics', 'MetricController@postMetrics');
             $router->post('metrics/{metric}/points', 'MetricPointController@postMetricPoints');
             $router->post('subscribers', 'SubscriberController@postSubscribers');
             $router->put('components/groups/{component_group}', 'ComponentGroupController@putGroup');
             $router->put('components/{component}', 'ComponentController@putComponent');
             $router->put('incidents/{incident}', 'IncidentController@putIncident');
             $router->put('metrics/{metric}', 'MetricController@putMetric');
             $router->put('metrics/{metric}/points/{metric_point}', 'MetricPointController@putMetricPoint');
             $router->delete('components/groups/{component_group}', 'ComponentGroupController@deleteGroup');
             $router->delete('components/{component}', 'ComponentController@deleteComponent');
             $router->delete('incidents/{incident}', 'IncidentController@deleteIncident');
             $router->delete('metrics/{metric}', 'MetricController@deleteMetric');
             $router->delete('metrics/{metric}/points/{metric_point}', 'MetricPointController@deleteMetricPoint');
             $router->delete('subscribers/{subscriber}', 'SubscriberController@deleteSubscriber');
         });
     });
 }
示例#4
0
 /**
  * Define the api routes.
  *
  * @param \Illuminate\Contracts\Routing\Registrar $router
  *
  * @return void
  */
 public function map(Registrar $router)
 {
     $router->group(['namespace' => 'Api', 'prefix' => 'api/v1', 'middleware' => ['api']], function (Registrar $router) {
         $router->group(['middleware' => ['auth.api']], function (Registrar $router) {
             $router->get('ping', 'GeneralController@ping');
             $router->get('version', 'GeneralController@version');
             $router->get('status', 'GeneralController@status');
             $router->get('components', 'ComponentController@getComponents');
             $router->get('components/groups', 'ComponentGroupController@getGroups');
             $router->get('components/groups/{component_group}', 'ComponentGroupController@getGroup');
             $router->get('components/{component}', 'ComponentController@getComponent');
             $router->get('incidents', 'IncidentController@getIncidents');
             $router->get('incidents/{incident}', 'IncidentController@getIncident');
             $router->get('metrics', 'MetricController@getMetrics');
             $router->get('metrics/{metric}', 'MetricController@getMetric');
             $router->get('metrics/{metric}/points', 'MetricController@getMetricPoints');
         });
         $router->group(['middleware' => ['auth.api:true']], function (Registrar $router) {
             $router->get('subscribers', 'SubscriberController@getSubscribers');
             $router->post('components', 'ComponentController@postComponents');
             $router->post('components/groups', 'ComponentGroupController@postGroups');
             $router->post('incidents', 'IncidentController@postIncidents');
             $router->post('metrics', 'MetricController@postMetrics');
             $router->post('metrics/{metric}/points', 'MetricPointController@postMetricPoints');
             $router->post('subscribers', 'SubscriberController@postSubscribers');
             $router->put('components/groups/{component_group}', 'ComponentGroupController@putGroup');
             $router->put('components/{component}', 'ComponentController@putComponent');
             $router->put('incidents/{incident}', 'IncidentController@putIncident');
             $router->put('metrics/{metric}', 'MetricController@putMetric');
             $router->put('metrics/{metric}/points/{metric_point}', 'MetricPointController@putMetricPoint');
             $router->delete('components/groups/{component_group}', 'ComponentGroupController@deleteGroup');
             $router->delete('components/{component}', 'ComponentController@deleteComponent');
             $router->delete('incidents/{incident}', 'IncidentController@deleteIncident');
             $router->delete('metrics/{metric}', 'MetricController@deleteMetric');
             $router->delete('metrics/{metric}/points/{metric_point}', 'MetricPointController@deleteMetricPoint');
             $router->delete('subscribers/{subscriber}', 'SubscriberController@deleteSubscriber');
             $router->delete('subscriptions/{subscription}', 'SubscriberController@deleteSubscription');
         });
     });
 }
示例#5
0
 /**
  * Register a new PUT route with the router.
  *
  * @param  string                $uri
  * @param  Closure|array|string  $action
  */
 public function put($uri, $action)
 {
     $this->router->put($uri, $action);
 }