From e15fc984c33cc35770663b67cff6f2a34739a8c3 Mon Sep 17 00:00:00 2001 From: Yuri Tseretyan Date: Tue, 14 Jan 2025 17:22:01 -0500 Subject: [PATCH] Alerting: Deprecate Alertmanager config and receivers APIs (#98918) --- .../api/tooling/definitions/alertmanager.go | 16 ++++++++++ .../api/tooling/definitions/receivers.go | 6 ++++ .../api/tooling/definitions/time_intervals.go | 6 ++++ pkg/services/ngalert/api/tooling/post.json | 30 +++++++++++++++---- pkg/services/ngalert/api/tooling/spec.json | 30 +++++++++++++++---- 5 files changed, 76 insertions(+), 12 deletions(-) diff --git a/pkg/services/ngalert/api/tooling/definitions/alertmanager.go b/pkg/services/ngalert/api/tooling/definitions/alertmanager.go index 304a4edcae9..84d29dcb249 100644 --- a/pkg/services/ngalert/api/tooling/definitions/alertmanager.go +++ b/pkg/services/ngalert/api/tooling/definitions/alertmanager.go @@ -21,6 +21,9 @@ import ( // // sets an Alerting config // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true // Responses: // 201: Ack // 400: ValidationError @@ -38,6 +41,10 @@ import ( // // gets an Alerting config // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true +// // Responses: // 200: GettableUserConfig // 400: ValidationError @@ -55,6 +62,9 @@ import ( // // gets Alerting configurations that were successfully applied in the past // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true // Responses: // 200: GettableHistoricUserConfigs @@ -62,6 +72,9 @@ import ( // // revert Alerting configuration to the historical configuration specified by the given id // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true // Responses: // 202: Ack // 400: ValidationError @@ -71,6 +84,9 @@ import ( // // deletes the Alerting config for a tenant // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true // Responses: // 200: Ack // 400: ValidationError diff --git a/pkg/services/ngalert/api/tooling/definitions/receivers.go b/pkg/services/ngalert/api/tooling/definitions/receivers.go index 3e89f819e98..5a0aac70aef 100644 --- a/pkg/services/ngalert/api/tooling/definitions/receivers.go +++ b/pkg/services/ngalert/api/tooling/definitions/receivers.go @@ -4,6 +4,9 @@ package definitions // // Get a receiver by name. // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true // Responses: // 200: GetReceiverResponse // 403: PermissionDenied @@ -13,6 +16,9 @@ package definitions // // Get all receivers. // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true // Responses: // 200: GetReceiversResponse // 403: PermissionDenied diff --git a/pkg/services/ngalert/api/tooling/definitions/time_intervals.go b/pkg/services/ngalert/api/tooling/definitions/time_intervals.go index 38ce816b7c3..ac51ab6a3e2 100644 --- a/pkg/services/ngalert/api/tooling/definitions/time_intervals.go +++ b/pkg/services/ngalert/api/tooling/definitions/time_intervals.go @@ -4,6 +4,9 @@ package definitions // // Get all the time intervals // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true // Responses: // 200: GetAllIntervalsResponse // 403: ForbiddenError @@ -12,6 +15,9 @@ package definitions // // Get a time interval by name. // +// This API is designated to internal use only and can be removed or changed at any time without prior notice. +// +// Deprecated: true // Responses: // 200: GetIntervalsByNameResponse // 404: NotFound diff --git a/pkg/services/ngalert/api/tooling/post.json b/pkg/services/ngalert/api/tooling/post.json index f23b4673ecb..b0c7b79ac8a 100644 --- a/pkg/services/ngalert/api/tooling/post.json +++ b/pkg/services/ngalert/api/tooling/post.json @@ -5471,7 +5471,8 @@ }, "/alertmanager/grafana/config/api/v1/alerts": { "delete": { - "description": "deletes the Alerting config for a tenant", + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RouteDeleteGrafanaAlertingConfig", "responses": { "200": { @@ -5487,12 +5488,14 @@ } } }, + "summary": "deletes the Alerting config for a tenant", "tags": [ "alertmanager" ] }, "get": { - "description": "gets an Alerting config", + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RouteGetGrafanaAlertingConfig", "responses": { "200": { @@ -5508,12 +5511,14 @@ } } }, + "summary": "gets an Alerting config", "tags": [ "alertmanager" ] }, "post": { - "description": "sets an Alerting config", + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RoutePostGrafanaAlertingConfig", "parameters": [ { @@ -5538,6 +5543,7 @@ } } }, + "summary": "sets an Alerting config", "tags": [ "alertmanager" ] @@ -5668,7 +5674,8 @@ }, "/alertmanager/grafana/config/history": { "get": { - "description": "gets Alerting configurations that were successfully applied in the past", + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RouteGetGrafanaAlertingConfigHistory", "parameters": [ { @@ -5684,6 +5691,7 @@ "$ref": "#/responses/GettableHistoricUserConfigs" } }, + "summary": "gets Alerting configurations that were successfully applied in the past", "tags": [ "alertmanager" ] @@ -5691,7 +5699,8 @@ }, "/alertmanager/grafana/config/history/{id}/_activate": { "post": { - "description": "revert Alerting configuration to the historical configuration specified by the given id", + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RoutePostGrafanaAlertingConfigHistoryActivate", "parameters": [ { @@ -5723,6 +5732,7 @@ } } }, + "summary": "revert Alerting configuration to the historical configuration specified by the given id", "tags": [ "alertmanager" ] @@ -7261,6 +7271,8 @@ }, "/v1/notifications/receivers": { "get": { + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RouteGetReceivers", "parameters": [ { @@ -7308,6 +7320,8 @@ }, "/v1/notifications/receivers/{Name}": { "get": { + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RouteGetReceiver", "parameters": [ { @@ -7347,7 +7361,8 @@ }, "/v1/notifications/time-intervals": { "get": { - "description": "Get all the time intervals", + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RouteNotificationsGetTimeIntervals", "responses": { "200": { @@ -7360,6 +7375,7 @@ } } }, + "summary": "Get all the time intervals", "tags": [ "notifications" ] @@ -7367,6 +7383,8 @@ }, "/v1/notifications/time-intervals/{name}": { "get": { + "deprecated": true, + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "operationId": "RouteNotificationsGetTimeInterval", "parameters": [ { diff --git a/pkg/services/ngalert/api/tooling/spec.json b/pkg/services/ngalert/api/tooling/spec.json index a3ac020c228..c041526254d 100644 --- a/pkg/services/ngalert/api/tooling/spec.json +++ b/pkg/services/ngalert/api/tooling/spec.json @@ -299,11 +299,13 @@ }, "/alertmanager/grafana/config/api/v1/alerts": { "get": { - "description": "gets an Alerting config", + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "alertmanager" ], + "summary": "gets an Alerting config", "operationId": "RouteGetGrafanaAlertingConfig", + "deprecated": true, "responses": { "200": { "description": "GettableUserConfig", @@ -320,11 +322,13 @@ } }, "post": { - "description": "sets an Alerting config", + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "alertmanager" ], + "summary": "sets an Alerting config", "operationId": "RoutePostGrafanaAlertingConfig", + "deprecated": true, "parameters": [ { "name": "Body", @@ -350,11 +354,13 @@ } }, "delete": { - "description": "deletes the Alerting config for a tenant", + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "alertmanager" ], + "summary": "deletes the Alerting config for a tenant", "operationId": "RouteDeleteGrafanaAlertingConfig", + "deprecated": true, "responses": { "200": { "description": "Ack", @@ -496,11 +502,13 @@ }, "/alertmanager/grafana/config/history": { "get": { - "description": "gets Alerting configurations that were successfully applied in the past", + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "alertmanager" ], + "summary": "gets Alerting configurations that were successfully applied in the past", "operationId": "RouteGetGrafanaAlertingConfigHistory", + "deprecated": true, "parameters": [ { "type": "integer", @@ -519,11 +527,13 @@ }, "/alertmanager/grafana/config/history/{id}/_activate": { "post": { - "description": "revert Alerting configuration to the historical configuration specified by the given id", + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "alertmanager" ], + "summary": "revert Alerting configuration to the historical configuration specified by the given id", "operationId": "RoutePostGrafanaAlertingConfigHistoryActivate", + "deprecated": true, "parameters": [ { "type": "integer", @@ -2089,11 +2099,13 @@ }, "/v1/notifications/receivers": { "get": { + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "notifications" ], "summary": "Get all receivers.", "operationId": "RouteGetReceivers", + "deprecated": true, "parameters": [ { "type": "array", @@ -2136,11 +2148,13 @@ }, "/v1/notifications/receivers/{Name}": { "get": { + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "notifications" ], "summary": "Get a receiver by name.", "operationId": "RouteGetReceiver", + "deprecated": true, "parameters": [ { "type": "string", @@ -2175,11 +2189,13 @@ }, "/v1/notifications/time-intervals": { "get": { - "description": "Get all the time intervals", + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "notifications" ], + "summary": "Get all the time intervals", "operationId": "RouteNotificationsGetTimeIntervals", + "deprecated": true, "responses": { "200": { "$ref": "#/responses/GetAllIntervalsResponse" @@ -2195,11 +2211,13 @@ }, "/v1/notifications/time-intervals/{name}": { "get": { + "description": "This API is designated to internal use only and can be removed or changed at any time without prior notice.", "tags": [ "notifications" ], "summary": "Get a time interval by name.", "operationId": "RouteNotificationsGetTimeInterval", + "deprecated": true, "parameters": [ { "type": "string",