[Alerting]: Extend quota service to optionally set limits on alerts (#33283)

* Quota: Extend service to set limit on alerts

* Add test for applying quota to alert rules

* Apply suggestions from code review

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Get used alert quota only if naglert is enabled

* Set alert limit to zero if nglalert is not enabled
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
Sofia Papagiannaki
2021-05-04 19:16:28 +03:00
committed by GitHub
co-authored by Diana Payton
parent 985331e813
commit 540f110220
17 changed files with 464 additions and 89 deletions
+20 -15
View File
@@ -44,33 +44,38 @@ type GlobalQuotaDTO struct {
}
type GetOrgQuotaByTargetQuery struct {
Target string
OrgId int64
Default int64
Result *OrgQuotaDTO
Target string
OrgId int64
Default int64
IsNgAlertEnabled bool
Result *OrgQuotaDTO
}
type GetOrgQuotasQuery struct {
OrgId int64
Result []*OrgQuotaDTO
OrgId int64
IsNgAlertEnabled bool
Result []*OrgQuotaDTO
}
type GetUserQuotaByTargetQuery struct {
Target string
UserId int64
Default int64
Result *UserQuotaDTO
Target string
UserId int64
Default int64
IsNgAlertEnabled bool
Result *UserQuotaDTO
}
type GetUserQuotasQuery struct {
UserId int64
Result []*UserQuotaDTO
UserId int64
IsNgAlertEnabled bool
Result []*UserQuotaDTO
}
type GetGlobalQuotaByTargetQuery struct {
Target string
Default int64
Result *GlobalQuotaDTO
Target string
Default int64
IsNgAlertEnabled bool
Result *GlobalQuotaDTO
}
type UpdateOrgQuotaCmd struct {