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
pull/79429/head
Julien Duchesne 1 year ago committed by GitHub
parent 03da1a3f3f
commit 884e0427e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      pkg/services/ngalert/api/tooling/api.json
  2. 2
      pkg/services/ngalert/api/tooling/definitions/provisioning_alert_rules.go
  3. 6
      pkg/services/ngalert/api/tooling/definitions/provisioning_contactpoints.go
  4. 6
      pkg/services/ngalert/api/tooling/definitions/provisioning_mute_timings.go
  5. 6
      pkg/services/ngalert/api/tooling/definitions/provisioning_policies.go
  6. 6
      pkg/services/ngalert/api/tooling/definitions/provisioning_templates.go
  7. 43
      pkg/services/ngalert/api/tooling/post.json
  8. 43
      pkg/services/ngalert/api/tooling/spec.json
  9. 42
      public/api-merged.json
  10. 64
      public/openapi3.json

@ -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": {

@ -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"`

@ -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

@ -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"`

@ -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"`

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

@ -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": {

@ -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",

@ -2664,6 +2664,11 @@
"name": "UID",
"in": "path",
"required": true
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@ -2761,6 +2766,11 @@
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@ -2855,6 +2865,11 @@
"schema": {
"$ref": "#/definitions/EmbeddedContactPoint"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@ -2940,6 +2955,11 @@
"summary": "Update the interval of a rule group.",
"operationId": "RoutePutAlertRuleGroup",
"parameters": [
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
},
{
"type": "string",
"name": "FolderUID",
@ -3061,6 +3081,11 @@
"schema": {
"$ref": "#/definitions/MuteTimeInterval"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@ -3169,6 +3194,11 @@
"schema": {
"$ref": "#/definitions/MuteTimeInterval"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@ -3287,6 +3317,11 @@
"schema": {
"$ref": "#/definitions/Route"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@ -3417,6 +3452,11 @@
"schema": {
"$ref": "#/definitions/NotificationTemplateContent"
}
},
{
"type": "string",
"name": "X-Disable-Provenance",
"in": "header"
}
],
"responses": {
@ -20671,7 +20711,6 @@
}
},
"alertGroups": {
"description": "AlertGroups alert groups",
"type": "array",
"items": {
"$ref": "#/definitions/alertGroup"
@ -20860,7 +20899,6 @@
}
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"type": "array",
"items": {
"$ref": "#/definitions/gettableAlert"

@ -11602,7 +11602,6 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/components/schemas/alertGroup"
},
@ -11791,7 +11790,6 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/components/schemas/gettableAlert"
},
@ -14976,6 +14974,13 @@
"schema": {
"type": "string"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"schema": {
"type": "string"
}
}
],
"responses": {
@ -15174,6 +15179,15 @@
},
"post": {
"operationId": "RoutePostContactpoints",
"parameters": [
{
"in": "header",
"name": "X-Disable-Provenance",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
@ -15315,6 +15329,13 @@
"schema": {
"type": "string"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"schema": {
"type": "string"
}
}
],
"requestBody": {
@ -15399,6 +15420,13 @@
"put": {
"operationId": "RoutePutAlertRuleGroup",
"parameters": [
{
"in": "header",
"name": "X-Disable-Provenance",
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "FolderUID",
@ -15546,6 +15574,15 @@
},
"post": {
"operationId": "RoutePostMuteTiming",
"parameters": [
{
"in": "header",
"name": "X-Disable-Provenance",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
@ -15703,6 +15740,13 @@
"schema": {
"type": "string"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"schema": {
"type": "string"
}
}
],
"requestBody": {
@ -15844,6 +15888,15 @@
},
"put": {
"operationId": "RoutePutPolicyTree",
"parameters": [
{
"in": "header",
"name": "X-Disable-Provenance",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
@ -16006,6 +16059,13 @@
"schema": {
"type": "string"
}
},
{
"in": "header",
"name": "X-Disable-Provenance",
"schema": {
"type": "string"
}
}
],
"requestBody": {

Loading…
Cancel
Save