From 38b6c00a54b40f064e371aeae6460f0f5aa7b18a Mon Sep 17 00:00:00 2001 From: Gaius Date: Thu, 7 Sep 2023 15:28:35 +0800 Subject: [PATCH] feat: add cluster rest api to open api (#2707) Signed-off-by: Gaius --- manager/router/router.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manager/router/router.go b/manager/router/router.go index 1932d9089..4accbf6c1 100644 --- a/manager/router/router.go +++ b/manager/router/router.go @@ -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")