annotations api and page

This commit is contained in:
allanice001
2025-09-03 23:10:23 +01:00
parent 4e254fc569
commit d831e911fd
6 changed files with 3030 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import (
httpPprof "net/http/pprof"
"github.com/glueops/autoglue/internal/config"
"github.com/glueops/autoglue/internal/handlers/annotations"
"github.com/glueops/autoglue/internal/handlers/authn"
"github.com/glueops/autoglue/internal/handlers/health"
"github.com/glueops/autoglue/internal/handlers/labels"
@@ -54,6 +55,18 @@ func RegisterRoutes(r chi.Router) {
})
})
v1.Route("/annotations", func(a chi.Router) {
a.Use(authMW)
a.Get("/", annotations.ListAnnotations)
a.Post("/", annotations.CreateAnnotation)
a.Get("/{id}", annotations.GetAnnotation)
a.Patch("/{id}", annotations.UpdateAnnotation)
a.Delete("/{id}", annotations.DeleteAnnotation)
a.Get("/{id}/node_pools", annotations.ListNodePoolsWithAnnotation)
a.Post("/{id}/node_pools", annotations.AddAnnotationToNodePools)
a.Delete("/{id}/node_pools/{poolId}", annotations.RemoveAnnotationFromNodePool)
})
v1.Route("/orgs", func(o chi.Router) {
o.Use(authMW)
o.Post("/", orgs.CreateOrganization)