Alerting: Provisioning API respects global rule quota (#52180)

* Inject interface for quota service and create mock

* Check quota and return 403 if limit exceeded

* Implement tests for quota being exceeded
This commit is contained in:
Alexander Weaver
2022-07-13 17:36:17 -05:00
committed by GitHub
parent eb5a96eae9
commit 2d7389c34d
10 changed files with 209 additions and 22 deletions

View File

@@ -23,6 +23,7 @@ var (
ErrRuleGroupNamespaceNotFound = errors.New("rule group not found under this namespace")
ErrAlertRuleFailedValidation = errors.New("invalid alert rule")
ErrAlertRuleUniqueConstraintViolation = errors.New("a conflicting alert rule is found: rule title under the same organisation and folder should be unique")
ErrQuotaReached = errors.New("quota has been exceeded")
)
// swagger:enum NoDataState