Alerting: Add provisioning endpoint to fetch all rules (#59989)

* Domain layer api for fetching all rules

* Add endpoint for getting all rules
This commit is contained in:
Alexander Weaver
2022-12-13 11:54:08 +01:00
committed by GitHub
parent d6bd3c4fb6
commit e97b43cd58
10 changed files with 163 additions and 18 deletions
+26 -4
View File
@@ -2164,6 +2164,12 @@
],
"type": "object"
},
"ProvisionedAlertRules": {
"items": {
"$ref": "#/definitions/ProvisionedAlertRule"
},
"type": "array"
},
"PushoverConfig": {
"properties": {
"expire": {
@@ -3077,7 +3083,6 @@
"type": "object"
},
"URL": {
"description": "The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use RawPath, an optional field which only gets\nset if the default encoding is different from Path.\n\nURL's String method uses the EscapedPath method to obtain the path. See the\nEscapedPath method for more details.",
"properties": {
"ForceQuery": {
"type": "boolean"
@@ -3088,6 +3093,9 @@
"Host": {
"type": "string"
},
"OmitHost": {
"type": "boolean"
},
"Opaque": {
"type": "string"
},
@@ -3110,7 +3118,7 @@
"$ref": "#/definitions/Userinfo"
}
},
"title": "A URL represents a parsed URL (technically, a URI reference).",
"title": "URL is a custom URL type that allows validation at configuration load time.",
"type": "object"
},
"Userinfo": {
@@ -3395,6 +3403,7 @@
"type": "object"
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"properties": {
"annotations": {
"$ref": "#/definitions/labelSet"
@@ -3513,7 +3522,6 @@
"type": "array"
},
"integration": {
"description": "Integration integration",
"properties": {
"lastNotifyAttempt": {
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
@@ -3657,7 +3665,6 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
@@ -3815,6 +3822,21 @@
},
"paths": {
"/api/v1/provisioning/alert-rules": {
"get": {
"operationId": "RouteGetAlertRules",
"responses": {
"200": {
"description": "ProvisionedAlertRules",
"schema": {
"$ref": "#/definitions/ProvisionedAlertRules"
}
}
},
"summary": "Get all the alert rules.",
"tags": [
"provisioning"
]
},
"post": {
"consumes": [
"application/json"