Alerting: Time interval Delete API to check for usages in alert rules (#90500)
* Check if a time interval is used in alert rules before deleting it * Add time interval to parameters of ListAlertRulesQuery and ListNotificationSettings of DbStore == Refacorings == * refactor isMuteTimeInUse to accept a single route * update getMuteTiming to not return err * update delete to get the mute timing from config first
This commit is contained in:
@@ -240,6 +240,17 @@ type apiClient struct {
|
||||
url string
|
||||
}
|
||||
|
||||
type LegacyApiClient struct {
|
||||
apiClient
|
||||
}
|
||||
|
||||
func NewAlertingLegacyAPIClient(host, user, pass string) LegacyApiClient {
|
||||
cli := newAlertingApiClient(host, user, pass)
|
||||
return LegacyApiClient{
|
||||
apiClient: cli,
|
||||
}
|
||||
}
|
||||
|
||||
func newAlertingApiClient(host, user, pass string) apiClient {
|
||||
if len(user) == 0 && len(pass) == 0 {
|
||||
return apiClient{url: fmt.Sprintf("http://%s", host)}
|
||||
|
||||
Reference in New Issue
Block a user