Alerting: Extend PUT rule-group route to write the entire rule group rather than top-level fields only (#53078)
* Wire up to full alert rule struct * Extract group change detection logic to dedicated file * GroupDiff -> GroupDelta for consistency * Calculate deltas and handle backwards compatible requests * Separate changes and insert/update/delete as needed * Regenerate files * Don't touch the DB if there are no changes * Quota checking, delete unused file * Mark modified records as provisioned * Validation + a couple API layer tests * Address linter errors * Fix issue with UID assignment and rule creation * Propagate top level group fields to all rules * Tests for repeated updates and versioning * Tests for quota and provenance checks * Fix linter errors * Regenerate * Factor out some shared logic * Drop unnecessary multiple nilchecks * Use alternative strategy for rolling UIDs on inserted rules * Fix tests, add back nilcheck, refresh UIDs during test * Address feedback * Add missing nil-check
This commit is contained in:
@@ -3513,7 +3513,6 @@
|
||||
"$ref": "#/definitions/Duration"
|
||||
},
|
||||
"gettableAlert": {
|
||||
"description": "GettableAlert gettable alert",
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"$ref": "#/definitions/labelSet"
|
||||
@@ -3569,7 +3568,6 @@
|
||||
"type": "object"
|
||||
},
|
||||
"gettableAlerts": {
|
||||
"description": "GettableAlerts gettable alerts",
|
||||
"items": {
|
||||
"$ref": "#/definitions/gettableAlert"
|
||||
},
|
||||
@@ -3735,7 +3733,6 @@
|
||||
"type": "array"
|
||||
},
|
||||
"postableSilence": {
|
||||
"description": "PostableSilence postable silence",
|
||||
"properties": {
|
||||
"comment": {
|
||||
"description": "comment",
|
||||
@@ -4183,15 +4180,15 @@
|
||||
"in": "body",
|
||||
"name": "Body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/AlertRuleGroupMetadata"
|
||||
"$ref": "#/definitions/AlertRuleGroup"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "AlertRuleGroupMetadata",
|
||||
"description": "AlertRuleGroup",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/AlertRuleGroupMetadata"
|
||||
"$ref": "#/definitions/AlertRuleGroup"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
|
||||
Reference in New Issue
Block a user