Alerting: Fix API specification (#42282)

* Alerting: Fix API specification
This commit is contained in:
Sofia Papagiannaki
2021-11-30 20:55:54 +01:00
committed by GitHub
parent 1d4b2593ec
commit 9c7b52fd36
10 changed files with 459 additions and 62 deletions
@@ -138,12 +138,15 @@ type MultiStatus struct{}
// swagger:parameters RoutePostTestReceivers
type TestReceiversConfigParams struct {
// in:body
Alert *TestReceiversConfigAlertParams `yaml:"alert,omitempty" json:"alert,omitempty"`
// in:body
Receivers []*PostableApiReceiver `yaml:"receivers,omitempty" json:"receivers,omitempty"`
Body TestReceiversConfigBodyParams
}
func (c *TestReceiversConfigParams) ProcessConfig(encrypt EncryptFn) error {
type TestReceiversConfigBodyParams struct {
Alert *TestReceiversConfigAlertParams `yaml:"alert,omitempty" json:"alert,omitempty"`
Receivers []*PostableApiReceiver `yaml:"receivers,omitempty" json:"receivers,omitempty"`
}
func (c *TestReceiversConfigBodyParams) ProcessConfig(encrypt EncryptFn) error {
return processReceiverConfigs(c.Receivers, encrypt)
}
@@ -1,6 +1,8 @@
// Grafana Alerting API.
//
// Package definitions includes the types required for generating or consuming an OpenAPI
// spec for the Unified Alerting API.
// Documentation of the API.
// spec for the Grafana Alerting API.
//
//
// Schemes: http, https
// BasePath: /api/v1