feat: add cluster rest api to open api (#2707)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2023-09-07 15:28:35 +08:00 committed by GitHub
parent 6c07550032
commit 38b6c00a54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -237,6 +237,14 @@ func Init(cfg *config.Config, logDir string, service service.Service, database *
ojob.GET(":id", h.GetJob)
ojob.GET("", h.GetJobs)
// Cluster.
oc := oapiv1.Group("/clusters", personalAccessToken)
oc.POST("", h.CreateCluster)
oc.DELETE(":id", h.DestroyCluster)
oc.PATCH(":id", h.UpdateCluster)
oc.GET(":id", h.GetCluster)
oc.GET("", h.GetClusters)
// TODO Remove this api.
// Compatible with the V1 preheat.
pv1 := r.Group("/preheats")