Alerting: Add endpoint for querying state history (#62166)
* Define endpoint and generate * Wire up and register endpoint * Cleanup, define authorization * Forgot the leading slash * Wire up query and SignedInUser * Wire up timerange query params * Add todo for label queries * Drop comment * Update path to rules subtree
This commit is contained in:
@@ -3931,7 +3931,6 @@
|
||||
"type": "object"
|
||||
},
|
||||
"receiver": {
|
||||
"description": "Receiver receiver",
|
||||
"properties": {
|
||||
"active": {
|
||||
"description": "active",
|
||||
@@ -4885,4 +4884,4 @@
|
||||
}
|
||||
},
|
||||
"swagger": "2.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package definitions
|
||||
|
||||
import "github.com/grafana/grafana-plugin-sdk-go/data"
|
||||
|
||||
// swagger:route GET /api/v1/rules/history history RouteGetStateHistory
|
||||
//
|
||||
// Query state history.
|
||||
//
|
||||
// Produces:
|
||||
// - application/json
|
||||
//
|
||||
// Responses:
|
||||
// 200: StateHistory
|
||||
|
||||
type StateHistory struct {
|
||||
Results *data.Frame `json:"results"`
|
||||
}
|
||||
@@ -6642,6 +6642,23 @@
|
||||
"testing"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/rules/history": {
|
||||
"get": {
|
||||
"operationId": "RouteGetStateHistory",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/StateHistory"
|
||||
}
|
||||
},
|
||||
"summary": "Query state history.",
|
||||
"tags": [
|
||||
"history"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"produces": [
|
||||
|
||||
@@ -2632,6 +2632,23 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/rules/history": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"history"
|
||||
],
|
||||
"summary": "Query state history.",
|
||||
"operationId": "RouteGetStateHistory",
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/StateHistory"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
@@ -6330,6 +6347,7 @@
|
||||
"$ref": "#/definitions/gettableAlert"
|
||||
},
|
||||
"gettableAlerts": {
|
||||
"description": "GettableAlerts gettable alerts",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/gettableAlert"
|
||||
@@ -6708,4 +6726,4 @@
|
||||
"type": "basic"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user