Browse Source

stop version

tags/v1.22.3.2^2
lewis 3 years ago
parent
commit
3daf44428f
3 changed files with 7 additions and 4 deletions
  1. +5
    -2
      routers/api/v1/api.go
  2. +2
    -1
      routers/repo/cloudbrain.go
  3. +0
    -1
      routers/routes/routes.go

+ 5
- 2
routers/api/v1/api.go View File

@@ -62,10 +62,10 @@ import (
"net/http"
"strings"

"code.gitea.io/gitea/routers/authentication"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/auth"

"code.gitea.io/gitea/modules/cloudbrain"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
@@ -77,6 +77,7 @@ import (
"code.gitea.io/gitea/routers/api/v1/repo"
_ "code.gitea.io/gitea/routers/api/v1/swagger" // for swagger generation
"code.gitea.io/gitea/routers/api/v1/user"
"code.gitea.io/gitea/routers/authentication"
repo_ext "code.gitea.io/gitea/routers/repo"

"gitea.com/macaron/binding"
@@ -884,7 +885,9 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/:id/log", repo.CloudbrainGetLog)
m.Group("/train-job", func() {
m.Group("/:jobid", func() {
m.Get("", repo.GetModelArtsTrainJobVersion)
m.Get("/model_list", repo.CloudBrainModelList)
m.Post("/stop_version", cloudbrain.AdminOrOwnerOrJobCreaterRightForTrain, repo_ext.CloudBrainStop)
})
})
}, reqRepoReader(models.UnitTypeCloudBrain))


+ 2
- 1
routers/repo/cloudbrain.go View File

@@ -544,11 +544,12 @@ func CloudBrainStop(ctx *context.Context) {
break
}

ctx.JSON(200, map[string]string{
ctx.JSON(200, map[string]interface{}{
"result_code": resultCode,
"error_msg": errorMsg,
"status": status,
"id": ID,
"StatusOK": 0,
})
}



+ 0
- 1
routers/routes/routes.go View File

@@ -1020,7 +1020,6 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/train-job", func() {
m.Group("/:jobid", func() {
m.Get("", reqRepoCloudBrainReader, repo.CloudBrainTrainJobShow)
m.Post("/stop_version", cloudbrain.AdminOrOwnerOrJobCreaterRightForTrain, repo.CloudBrainStop)
m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRightForTrain, repo.CloudBrainTrainJobDel)
//m.Get("/models", reqRepoCloudBrainReader, repo.CloudBrainShowModels)
m.Get("/download_model", cloudbrain.AdminOrOwnerOrJobCreaterRightForTrain, repo.CloudBrainDownloadModel)


Loading…
Cancel
Save