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

Method DeleteRuleGroup

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

Source from the content-addressed store, hash-verified

657}
658
659func (a *API) DeleteRuleGroup(w http.ResponseWriter, req *http.Request) {
660 logger := util_log.WithContext(req.Context(), a.logger)
661
662 userID, namespace, groupName, err := parseRequest(req, true, true)
663 if err != nil {
664 util_api.RespondError(logger, w, v1.ErrBadData, err.Error(), http.StatusBadRequest)
665 return
666 }
667
668 err = a.store.DeleteRuleGroup(req.Context(), userID, namespace, groupName)
669 if err != nil {
670 if err == rulestore.ErrGroupNotFound {
671 http.Error(w, err.Error(), http.StatusNotFound)
672 return
673 }
674 util_api.RespondError(logger, w, v1.ErrServer, err.Error(), http.StatusInternalServerError)
675 return
676 }
677
678 respondAccepted(w, logger)
679}

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected