mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08: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
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
if r.URL.Query().Get("max_rule_groups") != "" {
|
if r.URL.Query().Get("max_groups") != "" {
|
||||||
maxRuleGroups, err = strconv.ParseInt(r.URL.Query().Get("max_rule_groups"), 10, 32)
|
maxRuleGroups, err = strconv.ParseInt(r.URL.Query().Get("max_groups"), 10, 32)
|
||||||
if err != nil || maxRuleGroups < 0 {
|
if err != nil || maxRuleGroups < 0 {
|
||||||
return nil, &parsePaginationError{
|
return nil, &parsePaginationError{
|
||||||
err: fmt.Errorf("max_rule_groups need to be a valid number greater than or equal to 0: %w", err),
|
err: fmt.Errorf("max_groups need to be a valid number greater than or equal to 0: %w", err),
|
||||||
parameter: "max_rule_groups",
|
parameter: "max_groups",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2744,7 +2744,7 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E
|
||||||
{
|
{
|
||||||
endpoint: api.rules,
|
endpoint: api.rules,
|
||||||
query: url.Values{
|
query: url.Values{
|
||||||
"max_rule_groups": []string{"1"},
|
"max_groups": []string{"1"},
|
||||||
},
|
},
|
||||||
response: &RuleDiscovery{
|
response: &RuleDiscovery{
|
||||||
NextToken: getRuleGroupNextToken("/path/to/file", "grp2"),
|
NextToken: getRuleGroupNextToken("/path/to/file", "grp2"),
|
||||||
|
@ -2840,7 +2840,7 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E
|
||||||
{
|
{
|
||||||
endpoint: api.rules,
|
endpoint: api.rules,
|
||||||
query: url.Values{
|
query: url.Values{
|
||||||
"max_rule_groups": []string{"1"},
|
"max_groups": []string{"1"},
|
||||||
"next_token": []string{getRuleGroupNextToken("/path/to/file", "grp2")},
|
"next_token": []string{getRuleGroupNextToken("/path/to/file", "grp2")},
|
||||||
},
|
},
|
||||||
response: &RuleDiscovery{
|
response: &RuleDiscovery{
|
||||||
|
|
Loading…
Reference in a new issue