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

Method GetRuleGroup

integration/e2ecortex/client.go:855–870  ·  view source on GitHub ↗

GetRuleGroup gets a rule group.

(namespace string, groupName string)

Source from the content-addressed store, hash-verified

853
854// GetRuleGroup gets a rule group.
855func (c *Client) GetRuleGroup(namespace string, groupName string) (*http.Response, error) {
856 // Create HTTP request
857 req, err := http.NewRequest("GET", fmt.Sprintf("http://%s/api/prom/rules/%s/%s", c.rulerAddress, url.PathEscape(namespace), url.PathEscape(groupName)), nil)
858 if err != nil {
859 return nil, err
860 }
861
862 req.Header.Set("Content-Type", "application/yaml")
863 req.Header.Set("X-Scope-OrgID", c.orgID)
864
865 ctx, cancel := context.WithTimeout(context.Background(), c.timeout)
866 defer cancel()
867
868 // Execute HTTP request
869 return c.httpClient.Do(req.WithContext(ctx))
870}
871
872// DeleteRuleGroup deletes a rule group.
873func (c *Client) DeleteRuleGroup(namespace string, groupName string) error {

Callers 1

TestRulerAPIFunction · 0.95

Calls 2

SetMethod · 0.65
DoMethod · 0.65

Tested by 1

TestRulerAPIFunction · 0.76