Skip to content

Commit

Permalink
chore: update alerting swagger spec
Browse files Browse the repository at this point in the history
  • Loading branch information
megan-godfrey authored Jul 22, 2024
1 parent 968dfcb commit 168aa00
Show file tree
Hide file tree
Showing 3 changed files with 291 additions and 101 deletions.
79 changes: 51 additions & 28 deletions pkg/services/ngalert/api/tooling/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,9 @@
},
"type": "object"
},
"EvalQueriesResponse": {},
"EvalQueriesResponse": {
"type": "object"
},
"ExplorePanelsState": {
"description": "This is an object constructed with the keys as the values of the enum VisType and the value being a bag of properties"
},
Expand Down Expand Up @@ -3655,6 +3657,20 @@
},
"type": "object"
},
"SilenceMetadata": {
"properties": {
"folder_uid": {
"type": "string"
},
"rule_title": {
"type": "string"
},
"rule_uid": {
"type": "string"
}
},
"type": "object"
},
"SlackAction": {
"description": "See https://api.slack.com/docs/message-attachments#action_fields and https://api.slack.com/docs/message-buttons\nfor more information.",
"properties": {
Expand Down Expand Up @@ -4459,9 +4475,9 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
"$ref": "#/definitions/alertGroup",
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -4564,6 +4580,7 @@
"type": "object"
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"properties": {
"annotations": {
"$ref": "#/definitions/labelSet"
Expand Down Expand Up @@ -4621,11 +4638,38 @@
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
"$ref": "#/definitions/gettableAlert",
"type": "object"
},
"type": "array"
},
"gettableGrafanaSilence": {
"properties": {
"accessControl": {
"additionalProperties": {
"type": "boolean"
},
"example": {
"create": false,
"read": true,
"write": false
},
"type": "object"
},
"metadata": {
"$ref": "#/definitions/SilenceMetadata"
}
},
"type": "object"
},
"gettableGrafanaSilences": {
"items": {
"$ref": "#/definitions/gettableGrafanaSilence"
},
"type": "array"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"properties": {
"comment": {
"description": "comment",
Expand Down Expand Up @@ -4676,34 +4720,12 @@
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
"$ref": "#/definitions/gettableSilence",
"type": "object"
},
"type": "array"
},
"integration": {
"properties": {
"lastNotifyAttempt": {
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
"format": "date-time",
"type": "string"
},
"lastNotifyAttemptDuration": {
"description": "Duration of the last attempt to deliver a notification in humanized format (`1s` or `15ms`, etc).",
"type": "string"
},
"lastNotifyAttemptError": {
"description": "Error string for the last attempt to deliver a notification. Empty if the last attempt was successful.",
"type": "string"
},
"name": {
"description": "name",
"type": "string"
},
"sendResolved": {
"description": "send resolved",
"type": "boolean"
}
},
"required": [
"name",
"sendResolved"
Expand Down Expand Up @@ -4824,6 +4846,7 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
Expand Down
143 changes: 116 additions & 27 deletions pkg/services/ngalert/api/tooling/post.json
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,9 @@
},
"type": "object"
},
"EvalQueriesResponse": {},
"EvalQueriesResponse": {
"type": "object"
},
"ExplorePanelsState": {
"description": "This is an object constructed with the keys as the values of the enum VisType and the value being a bag of properties"
},
Expand Down Expand Up @@ -3655,6 +3657,20 @@
},
"type": "object"
},
"SilenceMetadata": {
"properties": {
"folder_uid": {
"type": "string"
},
"rule_title": {
"type": "string"
},
"rule_uid": {
"type": "string"
}
},
"type": "object"
},
"SlackAction": {
"description": "See https://api.slack.com/docs/message-attachments#action_fields and https://api.slack.com/docs/message-buttons\nfor more information.",
"properties": {
Expand Down Expand Up @@ -4194,7 +4210,6 @@
"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\nThe Host field contains the host and port subcomponents of the URL.\nWhen the port is present, it is separated from the host with a colon.\nWhen the host is an IPv6 address, it must be enclosed in square brackets:\n\"[fe80::1]:80\". The [net.JoinHostPort] function combines a host and port\ninto a string suitable for the Host field, adding square brackets to\nthe host when necessary.\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 the [URL.EscapedPath] method, which preserves\nthe original encoding of Path.\n\nThe RawPath field is an optional field which is only set when the default\nencoding of Path is different from the escaped path. See the EscapedPath method\nfor more details.\n\nURL's String method uses the EscapedPath method to obtain the path.",
"properties": {
"ForceQuery": {
"type": "boolean"
Expand Down Expand Up @@ -4230,7 +4245,7 @@
"$ref": "#/definitions/Userinfo"
}
},
"title": "A URL represents a parsed URL (technically, a URI reference).",
"title": "URL is a custom URL type that allows validation at configuration load time.",
"type": "object"
},
"UpdateRuleGroupResponse": {
Expand Down Expand Up @@ -4461,7 +4476,8 @@
},
"alertGroups": {
"items": {
"$ref": "#/definitions/alertGroup"
"$ref": "#/definitions/alertGroup",
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -4620,15 +4636,25 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
"$ref": "#/definitions/gettableAlert",
"type": "object"
},
"type": "array"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"gettableGrafanaSilence": {
"properties": {
"accessControl": {
"additionalProperties": {
"type": "boolean"
},
"example": {
"create": false,
"read": true,
"write": false
},
"type": "object"
},
"comment": {
"description": "comment",
"type": "string"
Expand All @@ -4649,6 +4675,9 @@
"matchers": {
"$ref": "#/definitions/matchers"
},
"metadata": {
"$ref": "#/definitions/SilenceMetadata"
},
"startsAt": {
"description": "starts at",
"format": "date-time",
Expand All @@ -4675,36 +4704,70 @@
],
"type": "object"
},
"gettableSilences": {
"gettableGrafanaSilences": {
"items": {
"$ref": "#/definitions/gettableSilence"
"$ref": "#/definitions/gettableGrafanaSilence"
},
"type": "array"
},
"integration": {
"gettableSilence": {
"description": "GettableSilence gettable silence",
"properties": {
"lastNotifyAttempt": {
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
"format": "date-time",
"comment": {
"description": "comment",
"type": "string"
},
"lastNotifyAttemptDuration": {
"description": "Duration of the last attempt to deliver a notification in humanized format (`1s` or `15ms`, etc).",
"createdBy": {
"description": "created by",
"type": "string"
},
"lastNotifyAttemptError": {
"description": "Error string for the last attempt to deliver a notification. Empty if the last attempt was successful.",
"endsAt": {
"description": "ends at",
"format": "date-time",
"type": "string"
},
"name": {
"description": "name",
"id": {
"description": "id",
"type": "string"
},
"sendResolved": {
"description": "send resolved",
"type": "boolean"
"matchers": {
"$ref": "#/definitions/matchers"
},
"startsAt": {
"description": "starts at",
"format": "date-time",
"type": "string"
},
"status": {
"$ref": "#/definitions/silenceStatus"
},
"updatedAt": {
"description": "updated at",
"format": "date-time",
"type": "string"
}
},
"required": [
"comment",
"createdBy",
"endsAt",
"matchers",
"startsAt",
"id",
"status",
"updatedAt"
],
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence",
"type": "object"
},
"type": "array"
},
"integration": {
"required": [
"name",
"sendResolved"
Expand Down Expand Up @@ -4825,6 +4888,7 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
Expand Down Expand Up @@ -4862,6 +4926,7 @@
"type": "object"
},
"receiver": {
"description": "Receiver receiver",
"properties": {
"active": {
"description": "active",
Expand Down Expand Up @@ -5146,9 +5211,9 @@
],
"responses": {
"200": {
"description": "gettableSilence",
"description": "gettableGrafanaSilence",
"schema": {
"$ref": "#/definitions/gettableSilence"
"$ref": "#/definitions/gettableGrafanaSilence"
}
},
"400": {
Expand All @@ -5175,13 +5240,25 @@
},
"name": "filter",
"type": "array"
},
{
"description": "Return rule metadata with silence.",
"in": "query",
"name": "ruleMetadata",
"type": "boolean"
},
{
"description": "Return access control metadata with silence.",
"in": "query",
"name": "accesscontrol",
"type": "boolean"
}
],
"responses": {
"200": {
"description": "gettableSilences",
"description": "gettableGrafanaSilences",
"schema": {
"$ref": "#/definitions/gettableSilences"
"$ref": "#/definitions/gettableGrafanaSilences"
}
},
"400": {
Expand Down Expand Up @@ -5801,6 +5878,18 @@
"name": "filter",
"type": "array"
},
{
"description": "Return rule metadata with silence.",
"in": "query",
"name": "ruleMetadata",
"type": "boolean"
},
{
"description": "Return access control metadata with silence.",
"in": "query",
"name": "accesscontrol",
"type": "boolean"
},
{
"description": "DatasoureUID should be the datasource UID identifier",
"in": "path",
Expand Down
Loading

0 comments on commit 168aa00

Please sign in to comment.