mirror of
https://github.com/prometheus/prometheus.git
synced 2024-09-19 23:37:31 -07:00
Rename max_rule_groups to max_groups
Signed-off-by: Raphael Silva <rapphil@gmail.com>
This commit is contained in:
parent
b9c0c847f9
commit
11c20b8d4d
|
@ -1589,12 +1589,12 @@ func parseListRulesPaginationRequest(r *http.Request) (*listRulesPaginationReque
|
|||
err error
|
||||
)
|
||||
|
||||
if r.URL.Query().Get("max_rule_groups") != "" {
|
||||
maxRuleGroups, err = strconv.ParseInt(r.URL.Query().Get("max_rule_groups"), 10, 32)
|
||||
if r.URL.Query().Get("max_groups") != "" {
|
||||
maxRuleGroups, err = strconv.ParseInt(r.URL.Query().Get("max_groups"), 10, 32)
|
||||
if err != nil || maxRuleGroups < 0 {
|
||||
return nil, &parsePaginationError{
|
||||
err: fmt.Errorf("max_rule_groups need to be a valid number greater than or equal to 0: %w", err),
|
||||
parameter: "max_rule_groups",
|
||||
err: fmt.Errorf("max_groups need to be a valid number greater than or equal to 0: %w", err),
|
||||
parameter: "max_groups",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2744,7 +2744,7 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E
|
|||
{
|
||||
endpoint: api.rules,
|
||||
query: url.Values{
|
||||
"max_rule_groups": []string{"1"},
|
||||
"max_groups": []string{"1"},
|
||||
},
|
||||
response: &RuleDiscovery{
|
||||
NextToken: getRuleGroupNextToken("/path/to/file", "grp2"),
|
||||
|
@ -2840,8 +2840,8 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E
|
|||
{
|
||||
endpoint: api.rules,
|
||||
query: url.Values{
|
||||
"max_rule_groups": []string{"1"},
|
||||
"next_token": []string{getRuleGroupNextToken("/path/to/file", "grp2")},
|
||||
"max_groups": []string{"1"},
|
||||
"next_token": []string{getRuleGroupNextToken("/path/to/file", "grp2")},
|
||||
},
|
||||
response: &RuleDiscovery{
|
||||
RuleGroups: []*RuleGroup{
|
||||
|
|
Loading…
Reference in a new issue