From 3bbc24a235daa5092eedbeef5c845aafa6527e19 Mon Sep 17 00:00:00 2001 From: dhia-gharsallaoui Date: Mon, 17 Feb 2025 01:04:59 +0000 Subject: [PATCH] chore: update alerting swagger spec --- pkg/services/ngalert/api/tooling/api.json | 35 +++++++++++++--------- pkg/services/ngalert/api/tooling/post.json | 34 ++++++++++++--------- pkg/services/ngalert/api/tooling/spec.json | 34 ++++++++++++--------- 3 files changed, 61 insertions(+), 42 deletions(-) diff --git a/pkg/services/ngalert/api/tooling/api.json b/pkg/services/ngalert/api/tooling/api.json index 965cee8114fd4..312b310830147 100644 --- a/pkg/services/ngalert/api/tooling/api.json +++ b/pkg/services/ngalert/api/tooling/api.json @@ -165,6 +165,9 @@ }, "AlertRuleEditorSettings": { "properties": { + "simplified_notifications_section": { + "type": "boolean" + }, "simplified_query_and_expressions_section": { "type": "boolean" } @@ -755,7 +758,7 @@ "type": "string" }, "ErrorSource": { - "$ref": "#/definitions/ErrorSource" + "$ref": "#/definitions/Source" }, "Frames": { "$ref": "#/definitions/Frames" @@ -965,10 +968,6 @@ }, "type": "object" }, - "ErrorSource": { - "description": "ErrorSource type defines the source of the error", - "type": "string" - }, "ErrorType": { "title": "ErrorType models the different API error types.", "type": "string" @@ -3606,6 +3605,9 @@ }, "RuleDiscovery": { "properties": { + "groupNextToken": { + "type": "string" + }, "groups": { "items": { "$ref": "#/definitions/RuleGroup" @@ -3975,6 +3977,10 @@ "SmtpNotEnabled": { "$ref": "#/definitions/ResponseDetails" }, + "Source": { + "title": "Source type defines the status source.", + "type": "string" + }, "Span": { "properties": { "Length": { @@ -4376,7 +4382,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" @@ -4412,7 +4417,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": { @@ -4803,6 +4808,7 @@ "type": "object" }, "gettableAlerts": { + "description": "GettableAlerts gettable alerts", "items": { "$ref": "#/definitions/gettableAlert", "type": "object" @@ -4927,6 +4933,7 @@ "type": "object" }, "gettableSilences": { + "description": "GettableSilences gettable silences", "items": { "$ref": "#/definitions/gettableSilence", "type": "object" @@ -6240,7 +6247,7 @@ } } }, - "summary": "Get all notification templates.", + "summary": "Get all notification template groups.", "tags": [ "provisioning" ] @@ -6251,7 +6258,7 @@ "operationId": "RouteDeleteTemplate", "parameters": [ { - "description": "Template name", + "description": "Template group name", "in": "path", "name": "name", "required": true, @@ -6275,7 +6282,7 @@ } } }, - "summary": "Delete a template.", + "summary": "Delete a notification template group.", "tags": [ "provisioning" ] @@ -6284,7 +6291,7 @@ "operationId": "RouteGetTemplate", "parameters": [ { - "description": "Template Name", + "description": "Template group name", "in": "path", "name": "name", "required": true, @@ -6305,7 +6312,7 @@ } } }, - "summary": "Get a notification template.", + "summary": "Get a notification template group.", "tags": [ "provisioning" ] @@ -6317,7 +6324,7 @@ "operationId": "RoutePutTemplate", "parameters": [ { - "description": "Template Name", + "description": "Template group name", "in": "path", "name": "name", "required": true, @@ -6356,7 +6363,7 @@ } } }, - "summary": "Updates an existing notification template.", + "summary": "Updates an existing notification template group.", "tags": [ "provisioning" ] diff --git a/pkg/services/ngalert/api/tooling/post.json b/pkg/services/ngalert/api/tooling/post.json index eae46145ba81e..f0945e24e5d25 100644 --- a/pkg/services/ngalert/api/tooling/post.json +++ b/pkg/services/ngalert/api/tooling/post.json @@ -165,6 +165,9 @@ }, "AlertRuleEditorSettings": { "properties": { + "simplified_notifications_section": { + "type": "boolean" + }, "simplified_query_and_expressions_section": { "type": "boolean" } @@ -755,7 +758,7 @@ "type": "string" }, "ErrorSource": { - "$ref": "#/definitions/ErrorSource" + "$ref": "#/definitions/Source" }, "Frames": { "$ref": "#/definitions/Frames" @@ -965,10 +968,6 @@ }, "type": "object" }, - "ErrorSource": { - "description": "ErrorSource type defines the source of the error", - "type": "string" - }, "ErrorType": { "title": "ErrorType models the different API error types.", "type": "string" @@ -3606,6 +3605,9 @@ }, "RuleDiscovery": { "properties": { + "groupNextToken": { + "type": "string" + }, "groups": { "items": { "$ref": "#/definitions/RuleGroup" @@ -3975,6 +3977,10 @@ "SmtpNotEnabled": { "$ref": "#/definitions/ResponseDetails" }, + "Source": { + "title": "Source type defines the status source.", + "type": "string" + }, "Span": { "properties": { "Length": { @@ -4376,6 +4382,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\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" @@ -4411,7 +4418,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" }, "UpdateRuleGroupResponse": { @@ -4927,7 +4934,6 @@ "type": "object" }, "gettableSilences": { - "description": "GettableSilences gettable silences", "items": { "$ref": "#/definitions/gettableSilence", "type": "object" @@ -8452,7 +8458,7 @@ } } }, - "summary": "Get all notification templates.", + "summary": "Get all notification template groups.", "tags": [ "provisioning" ] @@ -8463,7 +8469,7 @@ "operationId": "RouteDeleteTemplate", "parameters": [ { - "description": "Template name", + "description": "Template group name", "in": "path", "name": "name", "required": true, @@ -8487,7 +8493,7 @@ } } }, - "summary": "Delete a template.", + "summary": "Delete a notification template group.", "tags": [ "provisioning" ] @@ -8496,7 +8502,7 @@ "operationId": "RouteGetTemplate", "parameters": [ { - "description": "Template Name", + "description": "Template group name", "in": "path", "name": "name", "required": true, @@ -8517,7 +8523,7 @@ } } }, - "summary": "Get a notification template.", + "summary": "Get a notification template group.", "tags": [ "provisioning" ] @@ -8529,7 +8535,7 @@ "operationId": "RoutePutTemplate", "parameters": [ { - "description": "Template Name", + "description": "Template group name", "in": "path", "name": "name", "required": true, @@ -8568,7 +8574,7 @@ } } }, - "summary": "Updates an existing notification template.", + "summary": "Updates an existing notification template group.", "tags": [ "provisioning" ] diff --git a/pkg/services/ngalert/api/tooling/spec.json b/pkg/services/ngalert/api/tooling/spec.json index 95716ea1899df..1e8d3bdc5e4aa 100644 --- a/pkg/services/ngalert/api/tooling/spec.json +++ b/pkg/services/ngalert/api/tooling/spec.json @@ -3306,7 +3306,7 @@ "provisioning", "stable" ], - "summary": "Get all notification templates.", + "summary": "Get all notification template groups.", "operationId": "RouteGetTemplates", "responses": { "200": { @@ -3324,12 +3324,12 @@ "provisioning", "stable" ], - "summary": "Get a notification template.", + "summary": "Get a notification template group.", "operationId": "RouteGetTemplate", "parameters": [ { "type": "string", - "description": "Template Name", + "description": "Template group name", "name": "name", "in": "path", "required": true @@ -3358,12 +3358,12 @@ "provisioning", "stable" ], - "summary": "Updates an existing notification template.", + "summary": "Updates an existing notification template group.", "operationId": "RoutePutTemplate", "parameters": [ { "type": "string", - "description": "Template Name", + "description": "Template group name", "name": "name", "in": "path", "required": true @@ -3407,12 +3407,12 @@ "provisioning", "stable" ], - "summary": "Delete a template.", + "summary": "Delete a notification template group.", "operationId": "RouteDeleteTemplate", "parameters": [ { "type": "string", - "description": "Template name", + "description": "Template group name", "name": "name", "in": "path", "required": true @@ -3797,6 +3797,9 @@ "AlertRuleEditorSettings": { "type": "object", "properties": { + "simplified_notifications_section": { + "type": "boolean" + }, "simplified_query_and_expressions_section": { "type": "boolean" } @@ -4388,7 +4391,7 @@ "type": "string" }, "ErrorSource": { - "$ref": "#/definitions/ErrorSource" + "$ref": "#/definitions/Source" }, "Frames": { "$ref": "#/definitions/Frames" @@ -4597,10 +4600,6 @@ } } }, - "ErrorSource": { - "description": "ErrorSource type defines the source of the error", - "type": "string" - }, "ErrorType": { "type": "string", "title": "ErrorType models the different API error types." @@ -7243,6 +7242,9 @@ "groups" ], "properties": { + "groupNextToken": { + "type": "string" + }, "groups": { "type": "array", "items": { @@ -7608,6 +7610,10 @@ "SmtpNotEnabled": { "$ref": "#/definitions/ResponseDetails" }, + "Source": { + "type": "string", + "title": "Source type defines the status source." + }, "Span": { "type": "object", "title": "A Span defines a continuous sequence of buckets.", @@ -8009,8 +8015,9 @@ } }, "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.", "type": "object", - "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).", "properties": { "ForceQuery": { "type": "boolean" @@ -8560,7 +8567,6 @@ } }, "gettableSilences": { - "description": "GettableSilences gettable silences", "type": "array", "items": { "type": "object",