Add POST /api/v1/alerts (#10)
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
This commit is contained in:
@@ -38,6 +38,14 @@ import (
|
||||
// 200: GettableAlerts
|
||||
// 400: ValidationError
|
||||
|
||||
// swagger:route POST /api/v1/alerts alertmanager RoutePostAmAlerts
|
||||
//
|
||||
// create alertmanager alerts
|
||||
//
|
||||
// Responses:
|
||||
// 200: Ack
|
||||
// 400: ValidationError
|
||||
|
||||
// swagger:route GET /api/v1/alerts/groups alertmanager RouteGetAmAlertGroups
|
||||
//
|
||||
// get alertmanager alerts
|
||||
@@ -136,6 +144,12 @@ type AlertsParams struct {
|
||||
Receivers []string `json:"receivers"`
|
||||
}
|
||||
|
||||
// swagger:parameters RoutePostAmAlerts
|
||||
type PostableAlerts struct {
|
||||
// in:body
|
||||
PostableAlerts []amv2.PostableAlert `yaml:"" json:""`
|
||||
}
|
||||
|
||||
// swagger:parameters RoutePostAlertingConfig
|
||||
type BodyAlertingConfig struct {
|
||||
// in:body
|
||||
|
||||
@@ -80,6 +80,39 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"description": "create alertmanager alerts",
|
||||
"tags": [
|
||||
"alertmanager"
|
||||
],
|
||||
"operationId": "RoutePostAmAlerts",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "PostableAlerts",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/postableAlert"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Ack",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/Ack"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "ValidationError",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/ValidationError"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/alerts/groups": {
|
||||
@@ -2296,8 +2329,9 @@
|
||||
"x-go-package": "github.com/prometheus/common/config"
|
||||
},
|
||||
"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.",
|
||||
"type": "object",
|
||||
"title": "URL is a custom URL type that allows validation at configuration load time.",
|
||||
"title": "A URL represents a parsed URL (technically, a URI reference).",
|
||||
"properties": {
|
||||
"ForceQuery": {
|
||||
"type": "boolean"
|
||||
@@ -2330,7 +2364,7 @@
|
||||
"$ref": "#/definitions/Userinfo"
|
||||
}
|
||||
},
|
||||
"x-go-package": "github.com/prometheus/common/config"
|
||||
"x-go-package": "net/url"
|
||||
},
|
||||
"UpdateDashboardAclCommand": {
|
||||
"type": "object",
|
||||
|
||||
Reference in New Issue
Block a user