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 Oct 28, 2024
1 parent 968dfcb commit f3f7455
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 141 deletions.
72 changes: 52 additions & 20 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 @@ -4435,22 +4451,6 @@
"type": "object"
},
"alertGroup": {
"description": "AlertGroup alert group",
"properties": {
"alerts": {
"description": "alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
},
"type": "array"
},
"labels": {
"$ref": "#/definitions/labelSet"
},
"receiver": {
"$ref": "#/definitions/receiver"
}
},
"required": [
"alerts",
"labels",
Expand All @@ -4461,7 +4461,8 @@
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
"$ref": "#/definitions/alertGroup",
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -4564,6 +4565,7 @@
"type": "object"
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"properties": {
"annotations": {
"$ref": "#/definitions/labelSet"
Expand Down Expand Up @@ -4621,11 +4623,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,11 +4705,13 @@
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
"$ref": "#/definitions/gettableSilence",
"type": "object"
},
"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",
Expand Down Expand Up @@ -4824,6 +4855,7 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
Expand Down
142 changes: 89 additions & 53 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 @@ -4460,8 +4476,10 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
"$ref": "#/definitions/alertGroup",
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -4564,49 +4582,6 @@
"type": "object"
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"properties": {
"annotations": {
"$ref": "#/definitions/labelSet"
},
"endsAt": {
"description": "ends at",
"format": "date-time",
"type": "string"
},
"fingerprint": {
"description": "fingerprint",
"type": "string"
},
"generatorURL": {
"description": "generator URL\nFormat: uri",
"format": "uri",
"type": "string"
},
"labels": {
"$ref": "#/definitions/labelSet"
},
"receivers": {
"description": "receivers",
"items": {
"$ref": "#/definitions/receiver"
},
"type": "array"
},
"startsAt": {
"description": "starts at",
"format": "date-time",
"type": "string"
},
"status": {
"$ref": "#/definitions/alertStatus"
},
"updatedAt": {
"description": "updated at",
"format": "date-time",
"type": "string"
}
},
"required": [
"labels",
"annotations",
Expand All @@ -4622,13 +4597,24 @@
"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 +4635,9 @@
"matchers": {
"$ref": "#/definitions/matchers"
},
"metadata": {
"$ref": "#/definitions/SilenceMetadata"
},
"startsAt": {
"description": "starts at",
"format": "date-time",
Expand All @@ -4675,13 +4664,34 @@
],
"type": "object"
},
"gettableGrafanaSilences": {
"items": {
"$ref": "#/definitions/gettableGrafanaSilence"
},
"type": "array"
},
"gettableSilence": {
"required": [
"comment",
"createdBy",
"endsAt",
"matchers",
"startsAt",
"id",
"status",
"updatedAt"
],
"type": "object"
},
"gettableSilences": {
"items": {
"$ref": "#/definitions/gettableSilence"
"$ref": "#/definitions/gettableSilence",
"type": "object"
},
"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",
Expand Down Expand Up @@ -4825,6 +4835,7 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
Expand Down Expand Up @@ -4862,6 +4873,7 @@
"type": "object"
},
"receiver": {
"description": "Receiver receiver",
"properties": {
"active": {
"description": "active",
Expand Down Expand Up @@ -5146,9 +5158,9 @@
],
"responses": {
"200": {
"description": "gettableSilence",
"description": "gettableGrafanaSilence",
"schema": {
"$ref": "#/definitions/gettableSilence"
"$ref": "#/definitions/gettableGrafanaSilence"
}
},
"400": {
Expand All @@ -5175,13 +5187,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 +5825,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 f3f7455

Please sign in to comment.