Skip to content

Commit

Permalink
feat(api): 为 CRD资源添加 describe 接口
Browse files Browse the repository at this point in the history
- 在 CRD 相关的 API 路由中添加了新的 POST 方法
- 新增路由用于描述特定的 CRD资源
- 其他 API 路由保持不变
  • Loading branch information
weibaohui committed Dec 16, 2024
1 parent a202c4e commit f6daf4a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,14 @@ func main() {
api.POST("/yaml/apply", dynamic.Apply)
api.POST("/yaml/delete", dynamic.Delete)
// CRD
api.GET("/:kind/group/:group/version/:version/ns/:ns/name/:name", dynamic.Fetch) // CRD
api.GET("/:kind/group/:group/version/:version/ns/:ns/name/:name/event", dynamic.Event) // CRD
api.POST("/:kind/group/:group/version/:version/remove/ns/:ns/name/:name", dynamic.Remove) // CRD
api.POST("/:kind/group/:group/version/:version/remove/ns/:ns/names", dynamic.BatchRemove) // CRD
api.POST("/:kind/group/:group/version/:version/update/ns/:ns/name/:name", dynamic.Save) // CRD
api.GET("/:kind/group/:group/version/:version/list/ns/:ns", dynamic.List) // CRD
api.GET("/:kind/group/:group/version/:version/list", dynamic.List) // CRD
api.GET("/:kind/group/:group/version/:version/ns/:ns/name/:name", dynamic.Fetch) // CRD
api.GET("/:kind/group/:group/version/:version/ns/:ns/name/:name/event", dynamic.Event) // CRD
api.POST("/:kind/group/:group/version/:version/remove/ns/:ns/name/:name", dynamic.Remove) // CRD
api.POST("/:kind/group/:group/version/:version/remove/ns/:ns/names", dynamic.BatchRemove) // CRD
api.POST("/:kind/group/:group/version/:version/update/ns/:ns/name/:name", dynamic.Save) // CRD
api.POST("/:kind/group/:group/version/:version/describe/ns/:ns/name/:name", dynamic.Describe) // CRD
api.GET("/:kind/group/:group/version/:version/list/ns/:ns", dynamic.List) // CRD
api.GET("/:kind/group/:group/version/:version/list", dynamic.List) // CRD
// k8s pod
api.GET("/pod/logs/sse/ns/:ns/pod_name/:pod_name/container/:container_name", pod.StreamLogs)
api.GET("/pod/logs/download/ns/:ns/pod_name/:pod_name/container/:container_name", pod.DownloadLogs)
Expand Down

0 comments on commit f6daf4a

Please sign in to comment.