MCPcopy Index your code
hub / github.com/cortexproject/cortex / DeleteNamespace

Method DeleteNamespace

pkg/ruler/api.go:637–657  ·  view source on GitHub ↗
(w http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

635}
636
637func (a *API) DeleteNamespace(w http.ResponseWriter, req *http.Request) {
638 logger := util_log.WithContext(req.Context(), a.logger)
639
640 userID, namespace, _, err := parseRequest(req, true, false)
641 if err != nil {
642 util_api.RespondError(logger, w, v1.ErrBadData, err.Error(), http.StatusBadRequest)
643 return
644 }
645
646 err = a.store.DeleteNamespace(req.Context(), userID, namespace)
647 if err != nil {
648 if err == rulestore.ErrGroupNamespaceNotFound {
649 http.Error(w, err.Error(), http.StatusNotFound)
650 return
651 }
652 util_api.RespondError(logger, w, v1.ErrServer, err.Error(), http.StatusInternalServerError)
653 return
654 }
655
656 respondAccepted(w, logger)
657}
658
659func (a *API) DeleteRuleGroup(w http.ResponseWriter, req *http.Request) {
660 logger := util_log.WithContext(req.Context(), a.logger)

Callers

nothing calls this directly

Calls 5

parseRequestFunction · 0.85
respondAcceptedFunction · 0.85
DeleteNamespaceMethod · 0.65
ContextMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected