Skip to content

Commit f49c6af

Browse files
authored
chore: update alerting swagger spec
1 parent bf9f6c2 commit f49c6af

File tree

2 files changed

+180
-4
lines changed

2 files changed

+180
-4
lines changed

pkg/services/ngalert/api/tooling/api.json

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,6 +1530,12 @@
15301530
},
15311531
"type": "array"
15321532
},
1533+
"msteamsv2_configs": {
1534+
"items": {
1535+
"$ref": "#/definitions/MSTeamsV2Config"
1536+
},
1537+
"type": "array"
1538+
},
15331539
"name": {
15341540
"description": "A unique identifier for this receiver.",
15351541
"type": "string"
@@ -2114,6 +2120,32 @@
21142120
"title": "InspectType is a type for the Inspect property of a Notice.",
21152121
"type": "integer"
21162122
},
2123+
"IntegrationStatus": {
2124+
"properties": {
2125+
"lastNotifyAttempt": {
2126+
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
2127+
"format": "date-time",
2128+
"type": "string"
2129+
},
2130+
"lastNotifyAttemptDuration": {
2131+
"description": "Duration of the last attempt to deliver a notification in humanized format (`1s` or `15ms`, etc).",
2132+
"type": "string"
2133+
},
2134+
"lastNotifyAttemptError": {
2135+
"description": "Error string for the last attempt to deliver a notification. Empty if the last attempt was successful.",
2136+
"type": "string"
2137+
},
2138+
"name": {
2139+
"description": "Name of the integration.",
2140+
"type": "string"
2141+
},
2142+
"sendResolved": {
2143+
"description": "Whether the integration is configured to send resolved notifications.",
2144+
"type": "boolean"
2145+
}
2146+
},
2147+
"type": "object"
2148+
},
21172149
"InternalDataLink": {
21182150
"description": "InternalDataLink definition to allow Explore links to be constructed in the backend",
21192151
"properties": {
@@ -2263,6 +2295,29 @@
22632295
},
22642296
"type": "object"
22652297
},
2298+
"MSTeamsV2Config": {
2299+
"properties": {
2300+
"http_config": {
2301+
"$ref": "#/definitions/HTTPClientConfig"
2302+
},
2303+
"send_resolved": {
2304+
"type": "boolean"
2305+
},
2306+
"text": {
2307+
"type": "string"
2308+
},
2309+
"title": {
2310+
"type": "string"
2311+
},
2312+
"webhook_url": {
2313+
"$ref": "#/definitions/SecretURL"
2314+
},
2315+
"webhook_url_file": {
2316+
"type": "string"
2317+
}
2318+
},
2319+
"type": "object"
2320+
},
22662321
"MatchRegexps": {
22672322
"additionalProperties": {
22682323
"type": "string"
@@ -2803,6 +2858,12 @@
28032858
},
28042859
"type": "array"
28052860
},
2861+
"msteamsv2_configs": {
2862+
"items": {
2863+
"$ref": "#/definitions/MSTeamsV2Config"
2864+
},
2865+
"type": "array"
2866+
},
28062867
"name": {
28072868
"description": "A unique identifier for this receiver.",
28082869
"type": "string"
@@ -3557,6 +3618,12 @@
35573618
},
35583619
"type": "array"
35593620
},
3621+
"msteamsv2_configs": {
3622+
"items": {
3623+
"$ref": "#/definitions/MSTeamsV2Config"
3624+
},
3625+
"type": "array"
3626+
},
35603627
"name": {
35613628
"description": "A unique identifier for this receiver.",
35623629
"type": "string"
@@ -3643,6 +3710,26 @@
36433710
"title": "ReceiverExport is the provisioned file export of alerting.ReceiverV1.",
36443711
"type": "object"
36453712
},
3713+
"ReceiverStatus": {
3714+
"properties": {
3715+
"active": {
3716+
"description": "Whether the receiver is used in a route or not.",
3717+
"type": "boolean"
3718+
},
3719+
"integrations": {
3720+
"description": "Integrations configured for this receiver.",
3721+
"items": {
3722+
"$ref": "#/definitions/IntegrationStatus"
3723+
},
3724+
"type": "array"
3725+
},
3726+
"name": {
3727+
"description": "Name of the receiver.",
3728+
"type": "string"
3729+
}
3730+
},
3731+
"type": "object"
3732+
},
36463733
"Record": {
36473734
"properties": {
36483735
"from": {
@@ -4682,6 +4769,7 @@
46824769
"type": "object"
46834770
},
46844771
"URL": {
4772+
"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.",
46854773
"properties": {
46864774
"ForceQuery": {
46874775
"type": "boolean"
@@ -4717,7 +4805,7 @@
47174805
"$ref": "#/definitions/Userinfo"
47184806
}
47194807
},
4720-
"title": "URL is a custom URL type that allows validation at configuration load time.",
4808+
"title": "A URL represents a parsed URL (technically, a URI reference).",
47214809
"type": "object"
47224810
},
47234811
"UpdateNamespaceRulesRequest": {
@@ -7314,7 +7402,7 @@
73147402
"description": "",
73157403
"schema": {
73167404
"items": {
7317-
"$ref": "#/definitions/Receiver"
7405+
"$ref": "#/definitions/ReceiverStatus"
73187406
},
73197407
"type": "array"
73207408
}

pkg/services/ngalert/api/tooling/spec.json

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5834,6 +5834,12 @@
58345834
"$ref": "#/definitions/MSTeamsConfig"
58355835
}
58365836
},
5837+
"msteamsv2_configs": {
5838+
"type": "array",
5839+
"items": {
5840+
"$ref": "#/definitions/MSTeamsV2Config"
5841+
}
5842+
},
58375843
"name": {
58385844
"description": "A unique identifier for this receiver.",
58395845
"type": "string"
@@ -6417,6 +6423,32 @@
64176423
"format": "int64",
64186424
"title": "InspectType is a type for the Inspect property of a Notice."
64196425
},
6426+
"IntegrationStatus": {
6427+
"type": "object",
6428+
"properties": {
6429+
"lastNotifyAttempt": {
6430+
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
6431+
"type": "string",
6432+
"format": "date-time"
6433+
},
6434+
"lastNotifyAttemptDuration": {
6435+
"description": "Duration of the last attempt to deliver a notification in humanized format (`1s` or `15ms`, etc).",
6436+
"type": "string"
6437+
},
6438+
"lastNotifyAttemptError": {
6439+
"description": "Error string for the last attempt to deliver a notification. Empty if the last attempt was successful.",
6440+
"type": "string"
6441+
},
6442+
"name": {
6443+
"description": "Name of the integration.",
6444+
"type": "string"
6445+
},
6446+
"sendResolved": {
6447+
"description": "Whether the integration is configured to send resolved notifications.",
6448+
"type": "boolean"
6449+
}
6450+
}
6451+
},
64206452
"InternalDataLink": {
64216453
"description": "InternalDataLink definition to allow Explore links to be constructed in the backend",
64226454
"type": "object",
@@ -6566,6 +6598,29 @@
65666598
}
65676599
}
65686600
},
6601+
"MSTeamsV2Config": {
6602+
"type": "object",
6603+
"properties": {
6604+
"http_config": {
6605+
"$ref": "#/definitions/HTTPClientConfig"
6606+
},
6607+
"send_resolved": {
6608+
"type": "boolean"
6609+
},
6610+
"text": {
6611+
"type": "string"
6612+
},
6613+
"title": {
6614+
"type": "string"
6615+
},
6616+
"webhook_url": {
6617+
"$ref": "#/definitions/SecretURL"
6618+
},
6619+
"webhook_url_file": {
6620+
"type": "string"
6621+
}
6622+
}
6623+
},
65696624
"MatchRegexps": {
65706625
"type": "object",
65716626
"title": "MatchRegexps represents a map of Regexp.",
@@ -7108,6 +7163,12 @@
71087163
"$ref": "#/definitions/MSTeamsConfig"
71097164
}
71107165
},
7166+
"msteamsv2_configs": {
7167+
"type": "array",
7168+
"items": {
7169+
"$ref": "#/definitions/MSTeamsV2Config"
7170+
}
7171+
},
71117172
"name": {
71127173
"description": "A unique identifier for this receiver.",
71137174
"type": "string"
@@ -7863,6 +7924,12 @@
78637924
"$ref": "#/definitions/MSTeamsConfig"
78647925
}
78657926
},
7927+
"msteamsv2_configs": {
7928+
"type": "array",
7929+
"items": {
7930+
"$ref": "#/definitions/MSTeamsV2Config"
7931+
}
7932+
},
78667933
"name": {
78677934
"description": "A unique identifier for this receiver.",
78687935
"type": "string"
@@ -7947,6 +8014,26 @@
79478014
}
79488015
}
79498016
},
8017+
"ReceiverStatus": {
8018+
"type": "object",
8019+
"properties": {
8020+
"active": {
8021+
"description": "Whether the receiver is used in a route or not.",
8022+
"type": "boolean"
8023+
},
8024+
"integrations": {
8025+
"description": "Integrations configured for this receiver.",
8026+
"type": "array",
8027+
"items": {
8028+
"$ref": "#/definitions/IntegrationStatus"
8029+
}
8030+
},
8031+
"name": {
8032+
"description": "Name of the receiver.",
8033+
"type": "string"
8034+
}
8035+
}
8036+
},
79508037
"Record": {
79518038
"type": "object",
79528039
"required": [
@@ -8986,8 +9073,9 @@
89869073
}
89879074
},
89889075
"URL": {
9076+
"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.",
89899077
"type": "object",
8990-
"title": "URL is a custom URL type that allows validation at configuration load time.",
9078+
"title": "A URL represents a parsed URL (technically, a URI reference).",
89919079
"properties": {
89929080
"ForceQuery": {
89939081
"type": "boolean"
@@ -9851,7 +9939,7 @@
98519939
"schema": {
98529940
"type": "array",
98539941
"items": {
9854-
"$ref": "#/definitions/Receiver"
9942+
"$ref": "#/definitions/ReceiverStatus"
98559943
}
98569944
}
98579945
}

0 commit comments

Comments
 (0)