support clean up the notification configure when delete cluster (#5077)
This commit is contained in:
@@ -67,9 +67,9 @@ func AddToContainer(
|
||||
// apis for global notification config, receiver, and secret
|
||||
ws.Route(ws.GET("/{resources}").
|
||||
To(h.ListResource).
|
||||
Doc("list the notification configs or receivers").
|
||||
Doc("list the notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences, configmaps")).
|
||||
Param(ws.QueryParameter(query.ParameterName, "name used for filtering").Required(false)).
|
||||
Param(ws.QueryParameter(query.ParameterLabelSelector, "label selector used for filtering").Required(false)).
|
||||
Param(ws.QueryParameter("type", "config or receiver type, known values include dingtalk, email, feishu, slack, webhook, wechat").Required(false)).
|
||||
@@ -81,43 +81,43 @@ func AddToContainer(
|
||||
|
||||
ws.Route(ws.GET("/{resources}/{name}").
|
||||
To(h.GetResource).
|
||||
Doc("get the specified notification config or receiver").
|
||||
Doc("get the specified notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences, configmaps")).
|
||||
Param(ws.PathParameter(query.ParameterName, "the name of the resource")).
|
||||
Param(ws.QueryParameter("type", "config or receiver type, known values include dingtalk, feishu, email, slack, webhook, wechat").Required(false)).
|
||||
Returns(http.StatusOK, api.StatusOK, nil))
|
||||
|
||||
ws.Route(ws.POST("/{resources}").
|
||||
To(h.CreateResource).
|
||||
Doc("create a notification config or receiver").
|
||||
Doc("create a notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences, configmaps")).
|
||||
Returns(http.StatusOK, api.StatusOK, nil))
|
||||
|
||||
ws.Route(ws.PUT("/{resources}/{name}").
|
||||
To(h.UpdateResource).
|
||||
Doc("update the specified notification config or receiver").
|
||||
Doc("update the specified notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences, configmaps")).
|
||||
Param(ws.PathParameter(query.ParameterName, "the name of the resource")).
|
||||
Returns(http.StatusOK, api.StatusOK, nil))
|
||||
|
||||
ws.Route(ws.DELETE("/{resources}/{name}").
|
||||
To(h.DeleteResource).
|
||||
Doc("delete the specified notification config or receiver").
|
||||
Doc("delete the specified notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, routers, silences, configmaps")).
|
||||
Param(ws.PathParameter(query.ParameterName, "the name of the resource")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None))
|
||||
|
||||
// apis for tenant notification config and receiver
|
||||
ws.Route(ws.GET("/users/{user}/{resources}").
|
||||
To(h.ListResource).
|
||||
Doc("list the notification configs or receivers").
|
||||
Doc("list the notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("user", "user name")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences, configmaps")).
|
||||
Param(ws.QueryParameter(query.ParameterName, "name used for filtering").Required(false)).
|
||||
Param(ws.QueryParameter(query.ParameterLabelSelector, "label selector used for filtering").Required(false)).
|
||||
Param(ws.QueryParameter("type", "config or receiver type, known values include dingtalk, email, feishu, slack, webhook, wechat").Required(false)).
|
||||
@@ -129,37 +129,37 @@ func AddToContainer(
|
||||
|
||||
ws.Route(ws.GET("/users/{user}/{resources}/{name}").
|
||||
To(h.GetResource).
|
||||
Doc("get the specified notification config or receiver").
|
||||
Doc("get the specified notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("user", "user name")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences, configmaps")).
|
||||
Param(ws.PathParameter(query.ParameterName, "the name of the resource")).
|
||||
Param(ws.QueryParameter("type", "config or receiver type, known values include dingtalk, email, feishu, slack, webhook, wechat").Required(false)).
|
||||
Returns(http.StatusOK, api.StatusOK, nil))
|
||||
|
||||
ws.Route(ws.POST("/users/{user}/{resources}").
|
||||
To(h.CreateResource).
|
||||
Doc("create the specified notification config or receiver").
|
||||
Doc("create the specified notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("user", "user name")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences, configmaps")).
|
||||
Returns(http.StatusOK, api.StatusOK, nil))
|
||||
|
||||
ws.Route(ws.PUT("/users/{user}/{resources}/{name}").
|
||||
To(h.UpdateResource).
|
||||
Doc("update the specified notification config or receiver").
|
||||
Doc("update the specified notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("user", "user name")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences, configmaps")).
|
||||
Param(ws.PathParameter(query.ParameterName, "the name of the resource")).
|
||||
Returns(http.StatusOK, api.StatusOK, nil))
|
||||
|
||||
ws.Route(ws.DELETE("/users/{user}/{resources}/{name}").
|
||||
To(h.DeleteResource).
|
||||
Doc("delete the specified notification config or receiver").
|
||||
Doc("delete the specified notification resources").
|
||||
Metadata(KeyOpenAPITags, []string{constants.NotificationTag}).
|
||||
Param(ws.PathParameter("user", "user name")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences")).
|
||||
Param(ws.PathParameter("resources", "known values include configs, receivers, secrets, silences, configmaps")).
|
||||
Param(ws.PathParameter(query.ParameterName, "the name of the resource")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user