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 -114
View File
@@ -2508,27 +2508,6 @@
"Ack": {
"type": "object"
},
"AddApiKeyCommand": {
"description": "COMMANDS",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"role": {
"type": "string",
"enum": [
"Viewer",
"Editor",
"Admin"
]
},
"secondsToLive": {
"type": "integer",
"format": "int64"
}
}
},
"Alert": {
"type": "object",
"title": "Alert has info for an alert.",
@@ -2663,95 +2642,6 @@
}
}
},
"AlertRule": {
"type": "object",
"title": "AlertRule is the model for alert rules in unified alerting.",
"properties": {
"Annotations": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"Condition": {
"type": "string"
},
"DashboardUID": {
"type": "string"
},
"Data": {
"type": "array",
"items": {
"$ref": "#/definitions/AlertQuery"
}
},
"ExecErrState": {
"type": "string",
"enum": [
"Alerting",
"Error",
"OK"
]
},
"For": {
"$ref": "#/definitions/Duration"
},
"ID": {
"type": "integer",
"format": "int64"
},
"IntervalSeconds": {
"type": "integer",
"format": "int64"
},
"Labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"NamespaceUID": {
"type": "string"
},
"NoDataState": {
"type": "string",
"enum": [
"Alerting",
"NoData",
"OK"
]
},
"OrgID": {
"type": "integer",
"format": "int64"
},
"PanelID": {
"type": "integer",
"format": "int64"
},
"RuleGroup": {
"type": "string"
},
"RuleGroupIndex": {
"type": "integer",
"format": "int64"
},
"Title": {
"type": "string"
},
"UID": {
"type": "string"
},
"Updated": {
"type": "string",
"format": "date-time"
},
"Version": {
"type": "integer",
"format": "int64"
}
}
},
"AlertRuleGroup": {
"type": "object",
"properties": {
@@ -2765,7 +2655,7 @@
"rules": {
"type": "array",
"items": {
"$ref": "#/definitions/AlertRule"
"$ref": "#/definitions/ProvisionedAlertRule"
}
},
"title": {
@@ -3499,6 +3389,12 @@
"$ref": "#/definitions/SNSConfig"
}
},
"telegram_configs": {
"type": "array",
"items": {
"$ref": "#/definitions/TelegramConfig"
}
},
"victorops_configs": {
"type": "array",
"items": {
@@ -3799,6 +3695,9 @@
"smtp_smarthost": {
"$ref": "#/definitions/HostPort"
},
"telegram_api_url": {
"$ref": "#/definitions/URL"
},
"victorops_api_key": {
"$ref": "#/definitions/Secret"
},
@@ -4483,6 +4382,12 @@
"$ref": "#/definitions/SNSConfig"
}
},
"telegram_configs": {
"type": "array",
"items": {
"$ref": "#/definitions/TelegramConfig"
}
},
"victorops_configs": {
"type": "array",
"items": {
@@ -4977,6 +4882,12 @@
"$ref": "#/definitions/SNSConfig"
}
},
"telegram_configs": {
"type": "array",
"items": {
"$ref": "#/definitions/TelegramConfig"
}
},
"victorops_configs": {
"type": "array",
"items": {
@@ -5486,6 +5397,37 @@
}
}
},
"TelegramConfig": {
"type": "object",
"title": "TelegramConfig configures notifications via Telegram.",
"properties": {
"api_url": {
"$ref": "#/definitions/URL"
},
"chat": {
"type": "integer",
"format": "int64"
},
"disable_notifications": {
"type": "boolean"
},
"http_config": {
"$ref": "#/definitions/HTTPClientConfig"
},
"message": {
"type": "string"
},
"parse_mode": {
"type": "string"
},
"send_resolved": {
"type": "boolean"
},
"token": {
"$ref": "#/definitions/Secret"
}
}
},
"TestReceiverConfigResult": {
"type": "object",
"properties": {
@@ -5886,7 +5828,6 @@
}
},
"alertGroup": {
"description": "AlertGroup alert group",
"type": "object",
"required": [
"alerts",
@@ -5911,7 +5852,6 @@
"$ref": "#/definitions/alertGroup"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"type": "array",
"items": {
"$ref": "#/definitions/alertGroup"
@@ -6084,7 +6024,6 @@
"$ref": "#/definitions/gettableAlerts"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"type": "object",
"required": [
"comment",
@@ -6134,6 +6073,7 @@
"$ref": "#/definitions/gettableSilence"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"type": "array",
"items": {
"$ref": "#/definitions/gettableSilence"
@@ -6245,6 +6185,7 @@
}
},
"postableSilence": {
"description": "PostableSilence postable silence",
"type": "object",
"required": [
"comment",