Rules implements the rules service
(ctx context.Context, in *RulesRequest)
| 1527 | |
| 1528 | // Rules implements the rules service |
| 1529 | func (r *Ruler) Rules(ctx context.Context, in *RulesRequest) (*RulesResponse, error) { |
| 1530 | userID, err := users.TenantID(ctx) |
| 1531 | |
| 1532 | if err != nil { |
| 1533 | return nil, fmt.Errorf("no user id found in context") |
| 1534 | } |
| 1535 | |
| 1536 | response, err := r.getLocalRules(userID, *in, r.cfg.RulesBackupEnabled()) |
| 1537 | if err != nil { |
| 1538 | return nil, err |
| 1539 | } |
| 1540 | |
| 1541 | return &response, nil |
| 1542 | } |
| 1543 | |
| 1544 | // HasMaxRuleGroupsLimit check if RulerMaxRuleGroupsPerTenant limit is set for the userID. |
| 1545 | func (r *Ruler) HasMaxRuleGroupsLimit(userID string) bool { |
nothing calls this directly
no test coverage detected