mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 03:13:49 +08:00

* ngalert openapi: Use same `basePath` as rest of Grafana Currently, there are two issues that prevent easily merging `ngalert` and grafana openapi specs: - The basePath is different. `grafana` has `/api` and `ngalert` has `/api/v1`. I changed `ngalert` to use `/api` - The `ngalert` endpoints have their basePath in the each operation path. The basePath should actually be omitted --------- Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
46 lines
733 B
Go
46 lines
733 B
Go
// Grafana Alerting API.
|
|
//
|
|
// Package definitions includes the types required for generating or consuming an OpenAPI
|
|
// spec for the Grafana Alerting API.
|
|
//
|
|
// Schemes: http, https
|
|
// BasePath: /api
|
|
// Version: 1.1.0
|
|
//
|
|
// Consumes:
|
|
// - application/json
|
|
//
|
|
// Produces:
|
|
// - application/json
|
|
//
|
|
// Security:
|
|
// - basic
|
|
//
|
|
// SecurityDefinitions:
|
|
// basic:
|
|
// type: basic
|
|
//
|
|
// swagger:meta
|
|
package definitions
|
|
|
|
type Backend int
|
|
|
|
const (
|
|
GrafanaBackend Backend = iota
|
|
AlertmanagerBackend
|
|
LoTexRulerBackend
|
|
)
|
|
|
|
func (b Backend) String() string {
|
|
switch b {
|
|
case GrafanaBackend:
|
|
return "grafana"
|
|
case AlertmanagerBackend:
|
|
return "alertmanager"
|
|
case LoTexRulerBackend:
|
|
return "lotex"
|
|
default:
|
|
return ""
|
|
}
|
|
}
|