Alerting: Provisioning API - Contact points (#47197) (#47743)

(cherry picked from commit 388ecb4037)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-04-13 22:28:20 +02:00
committed by GitHub
co-authored by Jean-Philippe Quéméner
parent b8039a80b7
commit 21404f4169
20 changed files with 1384 additions and 41 deletions
+147 -14
View File
@@ -558,6 +558,36 @@
"type": "object",
"x-go-package": "github.com/prometheus/alertmanager/config"
},
"EmbeddedContactPoint": {
"description": "EmbeddedContactPoint is the contact point type that is used\nby grafanas embedded alertmanager implementation.",
"properties": {
"disableResolveMessage": {
"type": "boolean",
"x-go-name": "DisableResolveMessage"
},
"name": {
"type": "string",
"x-go-name": "Name"
},
"provanance": {
"type": "string",
"x-go-name": "Provenance"
},
"settings": {
"$ref": "#/definitions/Json"
},
"type": {
"type": "string",
"x-go-name": "Type"
},
"uid": {
"type": "string",
"x-go-name": "UID"
}
},
"type": "object",
"x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
},
"ErrorType": {
"title": "ErrorType models the different API error types.",
"type": "string",
@@ -3034,6 +3064,7 @@
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"alertGroup": {
"description": "AlertGroup alert group",
"properties": {
"alerts": {
"description": "alerts",
@@ -3055,17 +3086,14 @@
"labels",
"receiver"
],
"type": "object",
"x-go-name": "AlertGroup",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
},
"type": "array",
"x-go-name": "AlertGroups",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
"type": "array"
},
"alertStatus": {
"description": "AlertStatus alert status",
@@ -3255,6 +3283,7 @@
"type": "array"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"properties": {
"comment": {
"description": "comment",
@@ -3306,17 +3335,14 @@
"status",
"updatedAt"
],
"type": "object",
"x-go-name": "GettableSilence",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
},
"type": "array",
"x-go-name": "GettableSilences",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
"type": "array"
},
"labelSet": {
"additionalProperties": {
@@ -3445,7 +3471,6 @@
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
@@ -3485,7 +3510,9 @@
"matchers",
"startsAt"
],
"type": "object"
"type": "object",
"x-go-name": "PostableSilence",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"receiver": {
"properties": {
@@ -4733,6 +4760,112 @@
]
}
},
"/api/provisioning/contact-points": {
"get": {
"operationId": "RouteGetContactpoints",
"responses": {
"200": {
"description": "Route",
"schema": {
"$ref": "#/definitions/Route"
}
},
"400": {
"description": "ValidationError",
"schema": {
"$ref": "#/definitions/ValidationError"
}
}
},
"summary": "Get all the contact points.",
"tags": [
"provisioning"
]
},
"post": {
"consumes": [
"application/json"
],
"operationId": "RoutePostContactpoints",
"parameters": [
{
"in": "body",
"name": "Body",
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
}
],
"responses": {
"202": {
"$ref": "#/responses/Accepted"
},
"400": {
"description": "ValidationError",
"schema": {
"$ref": "#/definitions/ValidationError"
}
}
},
"summary": "Create a contact point.",
"tags": [
"provisioning"
]
},
"put": {
"consumes": [
"application/json"
],
"operationId": "RoutePutContactpoints",
"parameters": [
{
"in": "body",
"name": "Body",
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
}
],
"responses": {
"202": {
"$ref": "#/responses/Accepted"
},
"400": {
"description": "ValidationError",
"schema": {
"$ref": "#/definitions/ValidationError"
}
}
},
"summary": "Update an existing contact point.",
"tags": [
"provisioning"
]
}
},
"/api/provisioning/contact-points/{ID}": {
"delete": {
"consumes": [
"application/json"
],
"operationId": "RouteDeleteContactpoints",
"responses": {
"202": {
"$ref": "#/responses/Accepted"
},
"400": {
"description": "ValidationError",
"schema": {
"$ref": "#/definitions/ValidationError"
}
}
},
"summary": "Delete a contact point.",
"tags": [
"provisioning"
]
}
},
"/api/provisioning/policies": {
"get": {
"operationId": "RouteGetPolicyTree",