Alerting: Add is_paused attr to the POST alert rule group endpoint (#62253)

Add is_paused attr to the POST alert rule group endpoint
This commit is contained in:
Alex Moreno 2023-01-27 10:50:06 +01:00 committed by GitHub
parent 83ff974b86
commit 3ccafe3a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 7 deletions

View File

@ -97,6 +97,7 @@ func validateRuleNode(
RuleGroup: groupName,
NoDataState: noDataState,
ExecErrState: errorState,
IsPaused: ruleNode.GrafanaManagedAlert.IsPaused,
}
newAlertRule.For, err = validateForInterval(ruleNode)

View File

@ -2005,6 +2005,9 @@
],
"type": "string"
},
"is_paused": {
"type": "boolean"
},
"no_data_state": {
"enum": [
"Alerting",
@ -3495,7 +3498,6 @@
"type": "object"
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"properties": {
"annotations": {
"$ref": "#/definitions/labelSet"

View File

@ -374,6 +374,7 @@ type PostableGrafanaRule struct {
UID string `json:"uid" yaml:"uid"`
NoDataState NoDataState `json:"no_data_state" yaml:"no_data_state"`
ExecErrState ExecutionErrorState `json:"exec_err_state" yaml:"exec_err_state"`
IsPaused bool `json:"is_paused" yaml:"is_paused"`
}
// swagger:model

View File

@ -2005,6 +2005,9 @@
],
"type": "string"
},
"is_paused": {
"type": "boolean"
},
"no_data_state": {
"enum": [
"Alerting",
@ -3155,6 +3158,7 @@
"type": "object"
},
"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.",
"properties": {
"ForceQuery": {
"type": "boolean"
@ -3190,7 +3194,7 @@
"$ref": "#/definitions/Userinfo"
}
},
"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).",
"type": "object"
},
"Userinfo": {
@ -3496,7 +3500,6 @@
"type": "object"
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"properties": {
"annotations": {
"$ref": "#/definitions/labelSet"
@ -3606,6 +3609,7 @@
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
},

View File

@ -4501,6 +4501,9 @@
"Error"
]
},
"is_paused": {
"type": "boolean"
},
"no_data_state": {
"type": "string",
"enum": [
@ -5887,7 +5890,6 @@
"$ref": "#/definitions/alertGroup"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"type": "array",
"items": {
"$ref": "#/definitions/alertGroup"
@ -5993,7 +5995,6 @@
}
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"type": "object",
"required": [
"labels",
@ -6050,6 +6051,7 @@
"$ref": "#/definitions/gettableAlert"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"type": "array",
"items": {
"$ref": "#/definitions/gettableAlert"
@ -6057,6 +6059,7 @@
"$ref": "#/definitions/gettableAlerts"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"type": "object",
"required": [
"comment",
@ -6106,6 +6109,7 @@
"$ref": "#/definitions/gettableSilence"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"type": "array",
"items": {
"$ref": "#/definitions/gettableSilence"
@ -6296,7 +6300,6 @@
"$ref": "#/definitions/postableSilence"
},
"receiver": {
"description": "Receiver receiver",
"type": "object",
"required": [
"active",

View File

@ -15561,6 +15561,9 @@
"Error"
]
},
"is_paused": {
"type": "boolean"
},
"no_data_state": {
"type": "string",
"enum": [
@ -18796,7 +18799,6 @@
}
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"type": "object",
"required": [
"labels",