You can now get alert rules for a dashboard or a panel using /api/v1/rules endpoints. (#39476)

Get alert rules for a dashboard and panel in /api/v1/rules
This commit is contained in:
George Robinson
2021-10-04 16:33:55 +01:00
committed by GitHub
parent a3783a4eb7
commit 2a4c1b1aa6
14 changed files with 918 additions and 17 deletions

View File

@@ -722,7 +722,7 @@ func TestDeleteFolderWithRules(t *testing.T) {
b, err := ioutil.ReadAll(resp.Body)
require.NoError(t, err)
assert.Equal(t, 202, resp.StatusCode)
assert.Equal(t, 200, resp.StatusCode)
re := regexp.MustCompile(`"uid":"([\w|-]+)"`)
b = re.ReplaceAll(b, []byte(`"uid":""`))
@@ -833,7 +833,7 @@ func TestDeleteFolderWithRules(t *testing.T) {
b, err := ioutil.ReadAll(resp.Body)
require.NoError(t, err)
assert.Equal(t, 202, resp.StatusCode)
assert.Equal(t, 200, resp.StatusCode)
assert.JSONEq(t, "{}", string(b))
}
}