ngalert openapi: Add X-Disable-Provenance to missing operations (#79278)

Swagger(ngalert): Add `X-Disable-Provenance` to missing operations
I added all functions that call the `determineProvenance` function

Schema changes are from:
`make` in `pkg/services/ngalert/api/tooling`
`make swagger-clean && make openapi3-gen` in root
This commit is contained in:
Julien Duchesne
2023-12-13 10:55:59 -05:00
committed by GitHub
parent 03da1a3f3f
commit 884e0427e6
10 changed files with 251 additions and 9 deletions

View File

@@ -4252,7 +4252,6 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
},
@@ -4413,7 +4412,6 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
},
@@ -4898,6 +4896,11 @@
"name": "UID",
"required": true,
"type": "string"
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -5067,6 +5070,11 @@
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -5185,6 +5193,11 @@
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -5246,6 +5259,11 @@
],
"operationId": "RoutePutAlertRuleGroup",
"parameters": [
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
},
{
"in": "path",
"name": "FolderUID",
@@ -5367,6 +5385,11 @@
"schema": {
"$ref": "#/definitions/MuteTimeInterval"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -5496,6 +5519,11 @@
"schema": {
"$ref": "#/definitions/MuteTimeInterval"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -5611,6 +5639,11 @@
"schema": {
"$ref": "#/definitions/Route"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -5744,6 +5777,11 @@
"schema": {
"$ref": "#/definitions/NotificationTemplateContent"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {

View File

@@ -103,7 +103,7 @@ type AlertRulePayload struct {
Body ProvisionedAlertRule
}
// swagger:parameters RoutePostAlertRule RoutePutAlertRule
// swagger:parameters RoutePostAlertRule RoutePutAlertRule RouteDeleteAlertRule RoutePutAlertRuleGroup
type AlertRuleHeaders struct {
// in:header
XDisableProvenance string `json:"X-Disable-Provenance"`

View File

@@ -75,6 +75,12 @@ type ContactPointPayload struct {
// swagger:model
type ContactPoints []EmbeddedContactPoint
// swagger:parameters RoutePostContactpoints RoutePutContactpoint
type ContactPointHeaders struct {
// in:header
XDisableProvenance string `json:"X-Disable-Provenance"`
}
// EmbeddedContactPoint is the contact point type that is used
// by grafanas embedded alertmanager implementation.
// swagger:model

View File

@@ -82,6 +82,12 @@ type MuteTimingPayload struct {
Body MuteTimeInterval
}
// swagger:parameters RoutePostMuteTiming RoutePutMuteTiming
type MuteTimingHeaders struct {
// in:header
XDisableProvenance string `json:"X-Disable-Provenance"`
}
// swagger:model
type MuteTimeInterval struct {
config.MuteTimeInterval `json:",inline" yaml:",inline"`

View File

@@ -48,6 +48,12 @@ type Policytree struct {
Body Route
}
// swagger:parameters RoutePutPolicyTree
type PolicyTreeHeaders struct {
// in:header
XDisableProvenance string `json:"X-Disable-Provenance"`
}
// NotificationPolicyExport is the provisioned file export of alerting.NotificiationPolicyV1.
type NotificationPolicyExport struct {
OrgID int64 `json:"orgId" yaml:"orgId"`

View File

@@ -61,6 +61,12 @@ type NotificationTemplatePayload struct {
Body NotificationTemplateContent
}
// swagger:parameters RoutePutTemplate
type NotificationTemplateHeaders struct {
// in:header
XDisableProvenance string `json:"X-Disable-Provenance"`
}
func (t *NotificationTemplate) ResourceType() string {
return "template"
}

View File

@@ -4419,6 +4419,7 @@
"type": "array"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"properties": {
"comment": {
"description": "comment",
@@ -4473,7 +4474,6 @@
"type": "array"
},
"integration": {
"description": "Integration integration",
"properties": {
"lastNotifyAttempt": {
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
@@ -4617,6 +4617,7 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
@@ -6875,6 +6876,11 @@
"name": "UID",
"required": true,
"type": "string"
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -7044,6 +7050,11 @@
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -7162,6 +7173,11 @@
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -7223,6 +7239,11 @@
],
"operationId": "RoutePutAlertRuleGroup",
"parameters": [
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
},
{
"in": "path",
"name": "FolderUID",
@@ -7344,6 +7365,11 @@
"schema": {
"$ref": "#/definitions/MuteTimeInterval"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -7473,6 +7499,11 @@
"schema": {
"$ref": "#/definitions/MuteTimeInterval"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -7588,6 +7619,11 @@
"schema": {
"$ref": "#/definitions/Route"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {
@@ -7721,6 +7757,11 @@
"schema": {
"$ref": "#/definitions/NotificationTemplateContent"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"type": "string"
}
],
"responses": {

View File

@@ -2200,6 +2200,11 @@
"name": "UID",
"in": "path",
"required": true
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@@ -2300,6 +2305,11 @@
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@@ -2396,6 +2406,11 @@
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@@ -2484,6 +2499,11 @@
"summary": "Update the interval of a rule group.",
"operationId": "RoutePutAlertRuleGroup",
"parameters": [
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
},
{
"type": "string",
"name": "FolderUID",
@@ -2608,6 +2628,11 @@
"schema": {
"$ref": "#/definitions/MuteTimeInterval"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@@ -2719,6 +2744,11 @@
"schema": {
"$ref": "#/definitions/MuteTimeInterval"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@@ -2841,6 +2871,11 @@
"schema": {
"$ref": "#/definitions/Route"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@@ -2976,6 +3011,11 @@
"schema": {
"$ref": "#/definitions/NotificationTemplateContent"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@@ -7576,6 +7616,7 @@
"$ref": "#/definitions/gettableAlerts"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"type": "object",
"required": [
"comment",
@@ -7632,7 +7673,6 @@
"$ref": "#/definitions/gettableSilences"
},
"integration": {
"description": "Integration integration",
"type": "object",
"required": [
"name",
@@ -7777,6 +7817,7 @@
}
},
"postableSilence": {
"description": "PostableSilence postable silence",
"type": "object",
"required": [
"comment",