From a1e85f195a74a88d52d5a66df63ddaf22b2522db Mon Sep 17 00:00:00 2001 From: Florian M Date: Mon, 29 Oct 2018 10:17:23 +0100 Subject: [PATCH] Add REST API versioning support (second try) (#3408) * Revert "Add debugging methods to visualize wireframe of buckets (#3402)" This reverts commit 8238820f2e1b5272cc80e37b8073ce1b2c5de60e. * Revert "fixed bug that selects a just removed layout (#3379)" This reverts commit 8b16ef337cfe6412e82f881ec046e060d2fe7e0e. * Revert "Added button to revoke admin rights in frontend (#3378)" This reverts commit 2fc489c3b3e37081bfeef41c38fa757183485cbf. * Revert "Revert "Add REST API versioning support (#3385)" (#3404)" This reverts commit 49819b2100931f8093bb1e9e04f943ba3861f7a6. * move /api routes prefix to webknossosApi.routes * reorganize routing to handle all combinations of local datastore/tracingstore etc * update migrations --- MIGRATIONS.md | 1 + app/controllers/LegacyApiController.scala | 12 ++ conf/noDS.noTS.routes | 3 + conf/noDS.routes | 4 + conf/noTS.routes | 4 + conf/routes | 4 +- conf/webknossos.latest.routes | 161 +++++++++++++++++++++ conf/webknossos.routes | 162 ---------------------- conf/webknossos.versioned.routes | 13 ++ 9 files changed, 201 insertions(+), 163 deletions(-) create mode 100644 app/controllers/LegacyApiController.scala create mode 100644 conf/noDS.noTS.routes create mode 100644 conf/noDS.routes create mode 100644 conf/noTS.routes create mode 100644 conf/webknossos.latest.routes delete mode 100644 conf/webknossos.routes create mode 100644 conf/webknossos.versioned.routes diff --git a/MIGRATIONS.md b/MIGRATIONS.md index 06d52bea3ea..1e0e3b3c208 100644 --- a/MIGRATIONS.md +++ b/MIGRATIONS.md @@ -9,6 +9,7 @@ User-facing changes are documented in the [changelog](CHANGELOG.md). - There is now a separate module for the tracingstore, the datastore is no longer responsible for saving tracings. This module can run as a standalone application, or as a module of webKnossos locally. It is recommended that you choose the option that was previously also in place for datastores. In case of a standalone datastore, the local one needs to be disabled in application.conf: `tracingstore.enabled = false` and `play.modules.disabled += "com.scalableminds.braingames.datastore.TracingStoreModule` – and in either case, the adress of the tracingstore (localhost or remote) needs to be inserted in the db in `webknossos.tracingStores`. - The FossilDB version has changed from `0.1.10` to `0.1.14`. - The FossilDB needs to be run with an additional column family `volumeUpdates`. +- If your setup overwrites the config key `play.http.router` to disable the local datastore, change it to `"noDS.Routes"` (or `"noDS.noTS.Routes"` to also disable the local tracingstore). #### Postgres Evolutions: - [027-drop-dataset-name-unique-constraint.sql](conf/evolutions/027-drop-dataset-name-unique-constraint.sql) diff --git a/app/controllers/LegacyApiController.scala b/app/controllers/LegacyApiController.scala new file mode 100644 index 00000000000..78839a35f46 --- /dev/null +++ b/app/controllers/LegacyApiController.scala @@ -0,0 +1,12 @@ +package controllers + +import com.mohiva.play.silhouette.api.Silhouette +import javax.inject.Inject +import oxalis.security.WkEnv +import utils.WkConf + +class LegacyApiController @Inject()(conf: WkConf, + sil: Silhouette[WkEnv]) extends Controller { + + +} diff --git a/conf/noDS.noTS.routes b/conf/noDS.noTS.routes new file mode 100644 index 00000000000..7f145d6f370 --- /dev/null +++ b/conf/noDS.noTS.routes @@ -0,0 +1,3 @@ +GET /assets/*file controllers.Assets.at(path="/public", file) + +-> /api/ webknossos.versioned.Routes diff --git a/conf/noDS.routes b/conf/noDS.routes new file mode 100644 index 00000000000..a542660d6f7 --- /dev/null +++ b/conf/noDS.routes @@ -0,0 +1,4 @@ +GET /assets/*file controllers.Assets.at(path="/public", file) + +-> /api/ webknossos.versioned.Routes +-> /tracings/ com.scalableminds.webknossos.tracingstore.Routes diff --git a/conf/noTS.routes b/conf/noTS.routes new file mode 100644 index 00000000000..ee0be5b5ad5 --- /dev/null +++ b/conf/noTS.routes @@ -0,0 +1,4 @@ +GET /assets/*file controllers.Assets.at(path="/public", file) + +-> /api/ webknossos.versioned.Routes +-> /data/ com.scalableminds.webknossos.datastore.Routes diff --git a/conf/routes b/conf/routes index 28683ebc3ac..44e1a87c27a 100644 --- a/conf/routes +++ b/conf/routes @@ -1,3 +1,5 @@ --> / webknossos.Routes +GET /assets/*file controllers.Assets.at(path="/public", file) + +-> /api/ webknossos.versioned.Routes -> /data/ com.scalableminds.webknossos.datastore.Routes -> /tracings/ com.scalableminds.webknossos.tracingstore.Routes diff --git a/conf/webknossos.latest.routes b/conf/webknossos.latest.routes new file mode 100644 index 00000000000..74bab731066 --- /dev/null +++ b/conf/webknossos.latest.routes @@ -0,0 +1,161 @@ +# Routes +# This file defines all application routes (Higher priority routes first) +# ~~~~ + +GET /assets/*file controllers.Assets.at(path="/public", file) + +GET /buildinfo controllers.Application.buildInfo +GET /features controllers.Application.features +POST /analytics/:namespace controllers.Application.analytics(namespace) +POST /triggers/initialData controllers.InitialDataController.triggerInsert +GET /maintenance controllers.MaintenanceController.info +POST /maintenance controllers.MaintenanceController.initMaintenance +DELETE /maintenance controllers.MaintenanceController.closeMaintenance + +# Authentication +GET /auth/autoLogin controllers.Authentication.autoLogin +POST /auth/register controllers.Authentication.handleRegistration +POST /auth/login controllers.Authentication.authenticate +GET /auth/token controllers.Authentication.getToken +DELETE /auth/token controllers.Authentication.deleteToken +GET /auth/switch controllers.Authentication.switchTo(to: String) +POST /auth/startResetPassword controllers.Authentication.handleStartResetPassword +POST /auth/changePassword controllers.Authentication.changePassword +POST /auth/resetPassword controllers.Authentication.handleResetPassword +GET /auth/logout controllers.Authentication.logout +GET /auth/sso controllers.Authentication.singleSignOn(sso: String, sig: String) +POST /auth/createOrganizationWithAdmin controllers.Authentication.createOrganizationWithAdmin + +# Configurations +GET /user/userConfiguration controllers.ConfigurationController.read +PUT /user/userConfiguration controllers.ConfigurationController.update +GET /dataSetConfigurations/:organizationName/:dataSetName controllers.ConfigurationController.readDataSet(organizationName: String, dataSetName: String) +PUT /dataSetConfigurations/:organizationName/:dataSetName controllers.ConfigurationController.updateDataSet(organizationName: String, dataSetName: String) +GET /dataSetConfigurations/default/:organizationName/:dataSetName controllers.ConfigurationController.readDataSetDefault(organizationName: String, dataSetName: String) +PUT /dataSetConfigurations/default/:organizationName/:dataSetName controllers.ConfigurationController.updateDataSetDefault(organizationName: String, dataSetName: String) + +# Users +POST /user/tasks/request controllers.TaskController.request +GET /user/tasks/peek controllers.TaskController.peekNext + +GET /users controllers.UserController.list +GET /user controllers.UserController.current +GET /user/tasks controllers.UserController.tasks(isFinished: Option[Boolean], limit: Option[Int]) +GET /user/annotations controllers.UserController.annotations(isFinished: Option[Boolean], limit: Option[Int]) +GET /user/loggedTime controllers.UserController.loggedTime +GET /users/:id controllers.UserController.user(id: String) +PUT /users/:id controllers.UserController.update(id: String) +GET /users/:id/tasks controllers.UserController.userTasks(id: String, isFinished: Option[Boolean], limit: Option[Int]) +GET /users/:id/loggedTime controllers.UserController.userLoggedTime(id: String) +POST /users/loggedTime controllers.UserController.usersLoggedTime +GET /users/:id/annotations controllers.UserController.userAnnotations(id: String, isFinished: Option[Boolean], limit: Option[Int]) + +# Team +GET /teams controllers.TeamController.list +POST /teams controllers.TeamController.create +DELETE /teams/:id controllers.TeamController.delete(id: String) +GET /teams/:id/openTasksOverview controllers.ReportController.openTasksOverview(id: String) +GET /teams/:id/progressOverview controllers.ReportController.projectProgressOverview(id: String) + +# DataSets +POST /datasets/:organizationName/:dataSetName/createExplorational controllers.AnnotationController.createExplorational(organizationName: String, dataSetName: String) +GET /datasets controllers.DataSetController.list +POST /datasets controllers.DataSetController.create(typ: String) +POST /datasets/addForeign controllers.DataSetController.addForeignDataStoreAndDataSet +GET /datasets/disambiguate/:dataSetName/toNew controllers.DataSetController.getOrganizationForDataSet(dataSetName: String) +GET /datasets/:organizationName/:dataSetName/health controllers.DataSetController.health(organizationName: String, dataSetName: String, sharingToken: Option[String]) +PATCH /datasets/:organizationName/:dataSetName controllers.DataSetController.update(organizationName: String, dataSetName: String) +GET /datasets/:organizationName/:dataSetName/accessList controllers.DataSetController.accessList(organizationName: String, dataSetName: String) +GET /datasets/:organizationName/:dataSetName/sharingToken controllers.DataSetController.getSharingToken(organizationName: String, dataSetName: String) +DELETE /datasets/:organizationName/:dataSetName/sharingToken controllers.DataSetController.deleteSharingToken(organizationName: String, dataSetName: String) +PATCH /datasets/:organizationName/:dataSetName/teams controllers.DataSetController.updateTeams(organizationName: String, dataSetName: String) +GET /datasets/:organizationName/:dataSetName/layers/:layer/thumbnail controllers.DataSetController.thumbnail(organizationName: String, dataSetName: String, layer: String, w: Option[Int], h: Option[Int]) +GET /datasets/:organizationName/:dataSetName/isValidNewName controllers.DataSetController.isValidNewName(organizationName: String, dataSetName: String) +GET /datasets/:organizationName/:dataSetName controllers.DataSetController.read(organizationName: String, dataSetName: String, sharingToken: Option[String]) + +# Datastores +GET /datastores controllers.DataStoreController.list +PUT /datastores/:name/datasource controllers.WKDataStoreController.updateOne(name: String) +PUT /datastores/:name/datasources controllers.WKDataStoreController.updateAll(name: String) +PATCH /datastores/:name/status controllers.WKDataStoreController.statusUpdate(name: String) +POST /datastores/:name/verifyUpload controllers.WKDataStoreController.validateDataSetUpload(name: String) +POST /datastores/:name/validateUserAccess controllers.UserTokenController.validateAccessViaDatastore(name: String, token: String) + +# Tracingstores +GET /tracingstore controllers.WKTracingStoreController.listOne +POST /tracingstores/:name/handleTracingUpdateReport controllers.WKTracingStoreController.handleTracingUpdateReport(name: String) +POST /tracingstores/:name/validateUserAccess controllers.UserTokenController.validateAccessViaTracingstore(name: String, token: String) + +# User access tokens for datastore authentification +POST /userToken/generate controllers.UserTokenController.generateTokenForDataStore + +# Annotations +POST /annotations/upload controllers.AnnotationIOController.upload +POST /annotations/:typ/:id/duplicate controllers.AnnotationController.duplicate(typ: String, id: String) +PATCH /annotations/:typ/:id/edit controllers.AnnotationController.editAnnotation(typ: String, id: String) + +PATCH /annotations/:typ/:id/finish controllers.AnnotationController.finish(typ: String, id: String) +PATCH /annotations/:typ/finish controllers.AnnotationController.finishAll(typ: String) +PATCH /annotations/:typ/:id/reopen controllers.AnnotationController.reopen(typ: String, id: String) +PUT /annotations/:typ/:id/reset controllers.AnnotationController.reset(typ: String, id: String) +PATCH /annotations/:typ/:id/transfer controllers.AnnotationController.transfer(typ: String, id: String) + +GET /annotations/:typ/:id/info controllers.AnnotationController.info(typ: String, id: String) +PATCH /annotations/:typ/:id/makeHybrid controllers.AnnotationController.makeHybrid(typ: String, id: String) +DELETE /annotations/:typ/:id controllers.AnnotationController.cancel(typ: String, id: String) +POST /annotations/:typ/:id/merge/:mergedTyp/:mergedId controllers.AnnotationController.merge(typ: String, id: String, mergedTyp: String, mergedId: String) +GET /annotations/:typ/:id/download controllers.AnnotationIOController.download(typ: String, id: String) + +GET /annotations/:typ/:id/loggedTime controllers.AnnotationController.loggedTime(typ: String, id: String) + +# Tasks +POST /tasks controllers.TaskController.create +POST /tasks/createFromFiles controllers.TaskController.createFromFiles +POST /tasks/list controllers.TaskController.listTasks +GET /tasks/experienceDomains controllers.TaskController.listExperienceDomains +GET /tasks/:id controllers.TaskController.read(id: String) +DELETE /tasks/:id controllers.TaskController.delete(id: String) +PUT /tasks/:id controllers.TaskController.update(id: String) +GET /tasks/:id/annotations controllers.AnnotationController.annotationsForTask(id: String) + +# TaskTypes +GET /taskTypes controllers.TaskTypeController.list +POST /taskTypes controllers.TaskTypeController.create +DELETE /taskTypes/:id controllers.TaskTypeController.delete(id: String) +GET /taskTypes/:id/tasks controllers.TaskController.listTasksForType(id: String) +GET /taskTypes/:id controllers.TaskTypeController.get(id: String) +PUT /taskTypes/:id controllers.TaskTypeController.update(id: String) + +# Scripts +GET /scripts controllers.ScriptController.list +POST /scripts controllers.ScriptController.create +GET /scripts/:id controllers.ScriptController.get(id: String) +PUT /scripts/:id controllers.ScriptController.update(id: String) +DELETE /scripts/:id controllers.ScriptController.delete(id: String) + +# Projects +GET /projects controllers.ProjectController.list +GET /projects/assignments controllers.ProjectController.listWithStatus +POST /projects controllers.ProjectController.create +GET /projects/:name controllers.ProjectController.read(name: String) +DELETE /projects/:name controllers.ProjectController.delete(name: String) +PUT /projects/:name controllers.ProjectController.update(name: String) +GET /projects/:name/tasks controllers.ProjectController.tasksForProject(name: String) +PATCH /projects/:name/incrementEachTasksInstances controllers.ProjectController.incrementEachTasksInstances(name: String, delta: Option[Long]) +PATCH /projects/:name/pause controllers.ProjectController.pause(name: String) +PATCH /projects/:name/resume controllers.ProjectController.resume(name: String) +GET /projects/:name/usersWithActiveTasks controllers.ProjectController.usersWithActiveTasks(name:String) +POST /projects/:name/transferActiveTasks controllers.ProjectController.transferActiveTasks(name:String) + +# Statistics +GET /statistics/webknossos controllers.StatisticsController.webKnossos(interval: String, start: Option[Long], end: Option[Long]) +GET /statistics/users controllers.StatisticsController.users(interval: String, start: Option[Long], end: Option[Long], limit: Int) + +#Organizations +GET /organizations controllers.OrganizationController.listAllOrganizations +GET /operatorData controllers.OrganizationController.getOperatorData + +#Timelogging +GET /time/allusers/:year/:month controllers.TimeController.getWorkingHoursOfAllUsers(year: Int, month: Int, startDay: Option[Int], endDay: Option[Int]) +GET /time/userlist/:year/:month controllers.TimeController.getWorkingHoursOfUsers(email: String, year: Int, month: Int, startDay: Option[Int], endDay: Option[Int]) +GET /time/user/:userId controllers.TimeController.getWorkingHoursOfUser(userId: String, startDate: Long, endDate: Long) diff --git a/conf/webknossos.routes b/conf/webknossos.routes deleted file mode 100644 index b9015252096..00000000000 --- a/conf/webknossos.routes +++ /dev/null @@ -1,162 +0,0 @@ -# Routes -# This file defines all application routes (Higher priority routes first) -# ~~~~ - -GET /api/buildinfo controllers.Application.buildInfo -GET /api/features controllers.Application.features -POST /api/analytics/:namespace controllers.Application.analytics(namespace) -POST /api/triggers/initialData controllers.InitialDataController.triggerInsert -GET /api/maintenance controllers.MaintenanceController.info -POST /api/maintenance controllers.MaintenanceController.initMaintenance -DELETE /api/maintenance controllers.MaintenanceController.closeMaintenance - -# Authentication -GET /api/auth/autoLogin controllers.Authentication.autoLogin -POST /api/auth/register controllers.Authentication.handleRegistration -POST /api/auth/login controllers.Authentication.authenticate -GET /api/auth/token controllers.Authentication.getToken -DELETE /api/auth/token controllers.Authentication.deleteToken -GET /api/auth/switch controllers.Authentication.switchTo(to: String) -POST /api/auth/startResetPassword controllers.Authentication.handleStartResetPassword -POST /api/auth/changePassword controllers.Authentication.changePassword -POST /api/auth/resetPassword controllers.Authentication.handleResetPassword -GET /api/auth/logout controllers.Authentication.logout -GET /api/auth/sso controllers.Authentication.singleSignOn(sso: String, sig: String) -POST /api/auth/createOrganizationWithAdmin controllers.Authentication.createOrganizationWithAdmin - -# Configurations -GET /api/user/userConfiguration controllers.ConfigurationController.read -PUT /api/user/userConfiguration controllers.ConfigurationController.update -GET /api/dataSetConfigurations/:organizationName/:dataSetName controllers.ConfigurationController.readDataSet(organizationName: String, dataSetName: String) -PUT /api/dataSetConfigurations/:organizationName/:dataSetName controllers.ConfigurationController.updateDataSet(organizationName: String, dataSetName: String) -GET /api/dataSetConfigurations/default/:organizationName/:dataSetName controllers.ConfigurationController.readDataSetDefault(organizationName: String, dataSetName: String) -PUT /api/dataSetConfigurations/default/:organizationName/:dataSetName controllers.ConfigurationController.updateDataSetDefault(organizationName: String, dataSetName: String) - -# Users -POST /api/user/tasks/request controllers.TaskController.request -GET /api/user/tasks/peek controllers.TaskController.peekNext - -GET /api/users controllers.UserController.list -GET /api/user controllers.UserController.current -GET /api/user/tasks controllers.UserController.tasks(isFinished: Option[Boolean], limit: Option[Int]) -GET /api/user/annotations controllers.UserController.annotations(isFinished: Option[Boolean], limit: Option[Int]) -GET /api/user/loggedTime controllers.UserController.loggedTime -GET /api/users/:id controllers.UserController.user(id: String) -PUT /api/users/:id controllers.UserController.update(id: String) -GET /api/users/:id/tasks controllers.UserController.userTasks(id: String, isFinished: Option[Boolean], limit: Option[Int]) -GET /api/users/:id/loggedTime controllers.UserController.userLoggedTime(id: String) -POST /api/users/loggedTime controllers.UserController.usersLoggedTime -GET /api/users/:id/annotations controllers.UserController.userAnnotations(id: String, isFinished: Option[Boolean], limit: Option[Int]) - -# Team -GET /api/teams controllers.TeamController.list -POST /api/teams controllers.TeamController.create -DELETE /api/teams/:id controllers.TeamController.delete(id: String) -GET /api/teams/:id/openTasksOverview controllers.ReportController.openTasksOverview(id: String) -GET /api/teams/:id/progressOverview controllers.ReportController.projectProgressOverview(id: String) - -# DataSets -POST /api/datasets/:organizationName/:dataSetName/createExplorational controllers.AnnotationController.createExplorational(organizationName: String, dataSetName: String) -GET /api/datasets controllers.DataSetController.list -POST /api/datasets controllers.DataSetController.create(typ: String) -POST /api/datasets/addForeign controllers.DataSetController.addForeignDataStoreAndDataSet -GET /api/datasets/disambiguate/:dataSetName/toNew controllers.DataSetController.getOrganizationForDataSet(dataSetName: String) -GET /api/datasets/:organizationName/:dataSetName/health controllers.DataSetController.health(organizationName: String, dataSetName: String, sharingToken: Option[String]) -PATCH /api/datasets/:organizationName/:dataSetName controllers.DataSetController.update(organizationName: String, dataSetName: String) -GET /api/datasets/:organizationName/:dataSetName/accessList controllers.DataSetController.accessList(organizationName: String, dataSetName: String) -GET /api/datasets/:organizationName/:dataSetName/sharingToken controllers.DataSetController.getSharingToken(organizationName: String, dataSetName: String) -DELETE /api/datasets/:organizationName/:dataSetName/sharingToken controllers.DataSetController.deleteSharingToken(organizationName: String, dataSetName: String) -PATCH /api/datasets/:organizationName/:dataSetName/teams controllers.DataSetController.updateTeams(organizationName: String, dataSetName: String) -GET /api/datasets/:organizationName/:dataSetName/layers/:layer/thumbnail controllers.DataSetController.thumbnail(organizationName: String, dataSetName: String, layer: String, w: Option[Int], h: Option[Int]) -GET /api/datasets/:organizationName/:dataSetName/isValidNewName controllers.DataSetController.isValidNewName(organizationName: String, dataSetName: String) -GET /api/datasets/:organizationName/:dataSetName controllers.DataSetController.read(organizationName: String, dataSetName: String, sharingToken: Option[String]) - -# Datastores -GET /api/datastores controllers.DataStoreController.list -PUT /api/datastores/:name/datasource controllers.WKDataStoreController.updateOne(name: String) -PUT /api/datastores/:name/datasources controllers.WKDataStoreController.updateAll(name: String) -PATCH /api/datastores/:name/status controllers.WKDataStoreController.statusUpdate(name: String) -POST /api/datastores/:name/verifyUpload controllers.WKDataStoreController.validateDataSetUpload(name: String) -POST /api/datastores/:name/validateUserAccess controllers.UserTokenController.validateAccessViaDatastore(name: String, token: String) - -# Tracingstores -GET /api/tracingstore controllers.WKTracingStoreController.listOne -POST /api/tracingstores/:name/handleTracingUpdateReport controllers.WKTracingStoreController.handleTracingUpdateReport(name: String) -POST /api/tracingstores/:name/validateUserAccess controllers.UserTokenController.validateAccessViaTracingstore(name: String, token: String) - -# User access tokens for datastore authentification -POST /api/userToken/generate controllers.UserTokenController.generateTokenForDataStore - -# Annotations -POST /api/annotations/upload controllers.AnnotationIOController.upload -POST /api/annotations/:typ/:id/duplicate controllers.AnnotationController.duplicate(typ: String, id: String) -PATCH /api/annotations/:typ/:id/edit controllers.AnnotationController.editAnnotation(typ: String, id: String) - -PATCH /api/annotations/:typ/:id/finish controllers.AnnotationController.finish(typ: String, id: String) -PATCH /api/annotations/:typ/finish controllers.AnnotationController.finishAll(typ: String) -PATCH /api/annotations/:typ/:id/reopen controllers.AnnotationController.reopen(typ: String, id: String) -PUT /api/annotations/:typ/:id/reset controllers.AnnotationController.reset(typ: String, id: String) -PATCH /api/annotations/:typ/:id/transfer controllers.AnnotationController.transfer(typ: String, id: String) - -GET /api/annotations/:typ/:id/info controllers.AnnotationController.info(typ: String, id: String) -PATCH /api/annotations/:typ/:id/makeHybrid controllers.AnnotationController.makeHybrid(typ: String, id: String) -DELETE /api/annotations/:typ/:id controllers.AnnotationController.cancel(typ: String, id: String) -POST /api/annotations/:typ/:id/merge/:mergedTyp/:mergedId controllers.AnnotationController.merge(typ: String, id: String, mergedTyp: String, mergedId: String) -GET /api/annotations/:typ/:id/download controllers.AnnotationIOController.download(typ: String, id: String) - -GET /api/annotations/:typ/:id/loggedTime controllers.AnnotationController.loggedTime(typ: String, id: String) - -# Tasks -POST /api/tasks controllers.TaskController.create -POST /api/tasks/createFromFiles controllers.TaskController.createFromFiles -POST /api/tasks/list controllers.TaskController.listTasks -GET /api/tasks/experienceDomains controllers.TaskController.listExperienceDomains -GET /api/tasks/:id controllers.TaskController.read(id: String) -DELETE /api/tasks/:id controllers.TaskController.delete(id: String) -PUT /api/tasks/:id controllers.TaskController.update(id: String) -GET /api/tasks/:id/annotations controllers.AnnotationController.annotationsForTask(id: String) - -# TaskTypes -GET /api/taskTypes controllers.TaskTypeController.list -POST /api/taskTypes controllers.TaskTypeController.create -DELETE /api/taskTypes/:id controllers.TaskTypeController.delete(id: String) -GET /api/taskTypes/:id/tasks controllers.TaskController.listTasksForType(id: String) -GET /api/taskTypes/:id controllers.TaskTypeController.get(id: String) -PUT /api/taskTypes/:id controllers.TaskTypeController.update(id: String) - -# Scripts -GET /api/scripts controllers.ScriptController.list -POST /api/scripts controllers.ScriptController.create -GET /api/scripts/:id controllers.ScriptController.get(id: String) -PUT /api/scripts/:id controllers.ScriptController.update(id: String) -DELETE /api/scripts/:id controllers.ScriptController.delete(id: String) - -# Projects -GET /api/projects controllers.ProjectController.list -GET /api/projects/assignments controllers.ProjectController.listWithStatus -POST /api/projects controllers.ProjectController.create -GET /api/projects/:name controllers.ProjectController.read(name: String) -DELETE /api/projects/:name controllers.ProjectController.delete(name: String) -PUT /api/projects/:name controllers.ProjectController.update(name: String) -GET /api/projects/:name/tasks controllers.ProjectController.tasksForProject(name: String) -PATCH /api/projects/:name/incrementEachTasksInstances controllers.ProjectController.incrementEachTasksInstances(name: String, delta: Option[Long]) -PATCH /api/projects/:name/pause controllers.ProjectController.pause(name: String) -PATCH /api/projects/:name/resume controllers.ProjectController.resume(name: String) -GET /api/projects/:name/usersWithActiveTasks controllers.ProjectController.usersWithActiveTasks(name:String) -POST /api/projects/:name/transferActiveTasks controllers.ProjectController.transferActiveTasks(name:String) - -# Statistics -GET /api/statistics/webknossos controllers.StatisticsController.webKnossos(interval: String, start: Option[Long], end: Option[Long]) -GET /api/statistics/users controllers.StatisticsController.users(interval: String, start: Option[Long], end: Option[Long], limit: Int) - -# Map static resources from the /public folder to the /public path -GET /assets/*file controllers.Assets.at(path="/public", file) - -#Organizations -GET /api/organizations controllers.OrganizationController.listAllOrganizations -GET /api/operatorData controllers.OrganizationController.getOperatorData - -#Timelogging -GET /api/time/allusers/:year/:month controllers.TimeController.getWorkingHoursOfAllUsers(year: Int, month: Int, startDay: Option[Int], endDay: Option[Int]) -GET /api/time/userlist/:year/:month controllers.TimeController.getWorkingHoursOfUsers(email: String, year: Int, month: Int, startDay: Option[Int], endDay: Option[Int]) -GET /api/time/user/:userId controllers.TimeController.getWorkingHoursOfUser(userId: String, startDate: Long, endDate: Long) diff --git a/conf/webknossos.versioned.routes b/conf/webknossos.versioned.routes new file mode 100644 index 00000000000..acb0d80ff63 --- /dev/null +++ b/conf/webknossos.versioned.routes @@ -0,0 +1,13 @@ +# API versioning is handled here. Higher-Priority routes first + +GET /assets/*file controllers.Assets.at(path="/public", file) + +# example: assume, the features route has changed, introducing v2. The older v1 needs to be provided in the legacyApiController +#-> /v2/ webknossos.Routes + + +# GET /v1/features controllers.LegacyApiController.v1features +-> /v1/ webknossos.latest.Routes + + +-> / webknossos.latest.Routes