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

Method DeleteRuleNamespace

integration/e2ecortex/client.go:897–916  ·  view source on GitHub ↗

DeleteRuleNamespace deletes all the rule groups (and the namespace itself).

(namespace string)

Source from the content-addressed store, hash-verified

895
896// DeleteRuleNamespace deletes all the rule groups (and the namespace itself).
897func (c *Client) DeleteRuleNamespace(namespace string) error {
898 // Create HTTP request
899 req, err := http.NewRequest("DELETE", fmt.Sprintf("http://%s/api/prom/rules/%s", c.rulerAddress, url.PathEscape(namespace)), nil)
900 if err != nil {
901 return err
902 }
903
904 req.Header.Set("X-Scope-OrgID", c.orgID)
905
906 ctx, cancel := context.WithTimeout(context.Background(), c.timeout)
907 defer cancel()
908
909 // Execute HTTP request
910 _, err = c.httpClient.Do(req.WithContext(ctx))
911 if err != nil {
912 return err
913 }
914
915 return nil
916}
917
918// userConfig is used to communicate a users alertmanager configs
919type userConfig struct {

Callers 1

TestRulerAPIFunction · 0.95

Calls 2

SetMethod · 0.65
DoMethod · 0.65

Tested by 1

TestRulerAPIFunction · 0.76