Alerting: Fix incorrect embedded DTO being returned when handling rule groups (#53701)

* Fix DTO embedding when getting/putting alert rule groups

* Drop usage of word 'Domain'

* Rename var as well
This commit is contained in:
Alexander Weaver
2022-08-12 16:36:50 -05:00
committed by GitHub
parent a19b3136c9
commit f093c249ac
9 changed files with 225 additions and 359 deletions
+55 -112
View File
@@ -7,27 +7,6 @@
"Ack": {
"type": "object"
},
"AddApiKeyCommand": {
"description": "COMMANDS",
"properties": {
"name": {
"type": "string"
},
"role": {
"enum": [
"Viewer",
"Editor",
"Admin"
],
"type": "string"
},
"secondsToLive": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"Alert": {
"properties": {
"activeAt": {
@@ -162,95 +141,6 @@
],
"type": "object"
},
"AlertRule": {
"properties": {
"Annotations": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"Condition": {
"type": "string"
},
"DashboardUID": {
"type": "string"
},
"Data": {
"items": {
"$ref": "#/definitions/AlertQuery"
},
"type": "array"
},
"ExecErrState": {
"enum": [
"Alerting",
"Error",
"OK"
],
"type": "string"
},
"For": {
"$ref": "#/definitions/Duration"
},
"ID": {
"format": "int64",
"type": "integer"
},
"IntervalSeconds": {
"format": "int64",
"type": "integer"
},
"Labels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"NamespaceUID": {
"type": "string"
},
"NoDataState": {
"enum": [
"Alerting",
"NoData",
"OK"
],
"type": "string"
},
"OrgID": {
"format": "int64",
"type": "integer"
},
"PanelID": {
"format": "int64",
"type": "integer"
},
"RuleGroup": {
"type": "string"
},
"RuleGroupIndex": {
"format": "int64",
"type": "integer"
},
"Title": {
"type": "string"
},
"UID": {
"type": "string"
},
"Updated": {
"format": "date-time",
"type": "string"
},
"Version": {
"format": "int64",
"type": "integer"
}
},
"title": "AlertRule is the model for alert rules in unified alerting.",
"type": "object"
},
"AlertRuleGroup": {
"properties": {
"folderUid": {
@@ -262,7 +152,7 @@
},
"rules": {
"items": {
"$ref": "#/definitions/AlertRule"
"$ref": "#/definitions/ProvisionedAlertRule"
},
"type": "array"
},
@@ -994,6 +884,12 @@
},
"type": "array"
},
"telegram_configs": {
"items": {
"$ref": "#/definitions/TelegramConfig"
},
"type": "array"
},
"victorops_configs": {
"items": {
"$ref": "#/definitions/VictorOpsConfig"
@@ -1294,6 +1190,9 @@
"smtp_smarthost": {
"$ref": "#/definitions/HostPort"
},
"telegram_api_url": {
"$ref": "#/definitions/URL"
},
"victorops_api_key": {
"$ref": "#/definitions/Secret"
},
@@ -1977,6 +1876,12 @@
},
"type": "array"
},
"telegram_configs": {
"items": {
"$ref": "#/definitions/TelegramConfig"
},
"type": "array"
},
"victorops_configs": {
"items": {
"$ref": "#/definitions/VictorOpsConfig"
@@ -2470,6 +2375,12 @@
},
"type": "array"
},
"telegram_configs": {
"items": {
"$ref": "#/definitions/TelegramConfig"
},
"type": "array"
},
"victorops_configs": {
"items": {
"$ref": "#/definitions/VictorOpsConfig"
@@ -2981,6 +2892,37 @@
"title": "TLSConfig configures the options for TLS connections.",
"type": "object"
},
"TelegramConfig": {
"properties": {
"api_url": {
"$ref": "#/definitions/URL"
},
"chat": {
"format": "int64",
"type": "integer"
},
"disable_notifications": {
"type": "boolean"
},
"http_config": {
"$ref": "#/definitions/HTTPClientConfig"
},
"message": {
"type": "string"
},
"parse_mode": {
"type": "string"
},
"send_resolved": {
"type": "boolean"
},
"token": {
"$ref": "#/definitions/Secret"
}
},
"title": "TelegramConfig configures notifications via Telegram.",
"type": "object"
},
"TestReceiverConfigResult": {
"properties": {
"error": {
@@ -3568,6 +3510,7 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
},
@@ -3622,7 +3565,6 @@
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
},
@@ -3770,6 +3712,7 @@
"type": "object"
},
"receiver": {
"description": "Receiver receiver",
"properties": {
"name": {
"description": "name",