Files
Julien Duchesne c9211fbd69 ngalert openapi: Use same basePath as rest of Grafana (#79025)
* 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>
2024-01-17 11:53:16 -05:00

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 ""
}
}