Alerting: Remove transitional notifications API endpoints (#102713)

* Remove transitional notifications API endpoints

* Fix openapi spec

* Fix path test

* Remove API tests related to removed endpoints
This commit is contained in:
William Wernert
2025-03-26 12:26:50 -04:00
committed by GitHub
parent 44c471d10c
commit 88d23fe5be
16 changed files with 1 additions and 1901 deletions
-117
View File
@@ -1789,26 +1789,6 @@
],
"type": "object"
},
"GettableTimeIntervals": {
"properties": {
"name": {
"type": "string"
},
"provenance": {
"$ref": "#/definitions/Provenance"
},
"time_intervals": {
"items": {
"$ref": "#/definitions/TimeIntervalItem"
},
"type": "array"
},
"version": {
"type": "string"
}
},
"type": "object"
},
"GettableUserConfig": {
"properties": {
"alertmanager_config": {
@@ -2950,23 +2930,6 @@
},
"type": "object"
},
"PostableTimeIntervals": {
"properties": {
"name": {
"type": "string"
},
"time_intervals": {
"items": {
"$ref": "#/definitions/TimeIntervalItem"
},
"type": "array"
},
"version": {
"type": "string"
}
},
"type": "object"
},
"PostableUserConfig": {
"properties": {
"alertmanager_config": {
@@ -4492,55 +4455,6 @@
"title": "TimeInterval represents a named set of time intervals for which a route should be muted.",
"type": "object"
},
"TimeIntervalItem": {
"properties": {
"days_of_month": {
"items": {
"type": "string"
},
"type": "array"
},
"location": {
"type": "string"
},
"months": {
"items": {
"type": "string"
},
"type": "array"
},
"times": {
"items": {
"$ref": "#/definitions/TimeIntervalTimeRange"
},
"type": "array"
},
"weekdays": {
"items": {
"type": "string"
},
"type": "array"
},
"years": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"TimeIntervalTimeRange": {
"properties": {
"end_time": {
"type": "string"
},
"start_time": {
"type": "string"
}
},
"type": "object"
},
"TimeRange": {
"description": "Redefining this to avoid an import cycle",
"properties": {
@@ -5120,7 +5034,6 @@
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence",
"type": "object"
@@ -6561,36 +6474,6 @@
"application/json"
],
"responses": {
"GetAllIntervalsResponse": {
"description": "",
"schema": {
"items": {
"$ref": "#/definitions/GettableTimeIntervals"
},
"type": "array"
}
},
"GetIntervalsByNameResponse": {
"description": "",
"schema": {
"$ref": "#/definitions/GettableTimeIntervals"
}
},
"GetReceiverResponse": {
"description": "",
"schema": {
"$ref": "#/definitions/GettableApiReceiver"
}
},
"GetReceiversResponse": {
"description": "",
"schema": {
"items": {
"$ref": "#/definitions/GettableApiReceiver"
},
"type": "array"
}
},
"GettableHistoricUserConfigs": {
"description": "",
"schema": {
@@ -1,62 +0,0 @@
package definitions
// swagger:route GET /v1/notifications/receivers/{Name} notifications RouteGetReceiver
//
// 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
// 404: NotFound
// swagger:route GET /v1/notifications/receivers notifications RouteGetReceivers
//
// 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
// swagger:parameters RouteGetReceiver
type GetReceiverParams struct {
// in:path
// required: true
Name string `json:"name"`
// in:query
// required: false
Decrypt bool `json:"decrypt"`
}
// swagger:parameters RouteGetReceivers
type GetReceiversParams struct {
// in:query
// required: false
Names []string `json:"names"`
// in:query
// required: false
Limit int `json:"limit"`
// in:query
// required: false
Offset int `json:"offset"`
// in:query
// required: false
Decrypt bool `json:"decrypt"`
}
// swagger:response GetReceiverResponse
type GetReceiverResponse struct {
// in:body
Body GettableApiReceiver
}
// swagger:response GetReceiversResponse
type GetReceiversResponse struct {
// in:body
Body []GettableApiReceiver
}
@@ -1,72 +0,0 @@
package definitions
// swagger:route GET /v1/notifications/time-intervals notifications RouteNotificationsGetTimeIntervals
//
// 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
// swagger:route GET /v1/notifications/time-intervals/{name} notifications RouteNotificationsGetTimeInterval
//
// 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
// 403: ForbiddenError
// swagger:parameters RouteNotificationsGetTimeInterval
type RouteTimeIntervalNameParam struct {
// Time interval name
// in:path
Name string `json:"name"`
}
// swagger:response GetAllIntervalsResponse
type GetAllIntervalsResponse struct {
// in:body
Body []GettableTimeIntervals
}
// swagger:response GetIntervalsByNameResponse
type GetIntervalsByNameResponse struct {
// in:body
Body GettableTimeIntervals
}
// swagger:model
type PostableTimeIntervals struct {
Name string `json:"name" hcl:"name"`
Version string `json:"version,omitempty"`
TimeIntervals []TimeIntervalItem `json:"time_intervals" hcl:"intervals,block"`
}
type TimeIntervalItem struct {
Times []TimeIntervalTimeRange `json:"times,omitempty" hcl:"times,block"`
Weekdays *[]string `json:"weekdays,omitempty" hcl:"weekdays"`
DaysOfMonth *[]string `json:"days_of_month,omitempty" hcl:"days_of_month"`
Months *[]string `json:"months,omitempty" hcl:"months"`
Years *[]string `json:"years,omitempty" hcl:"years"`
Location *string `json:"location,omitempty" hcl:"location"`
}
type TimeIntervalTimeRange struct {
StartMinute string `json:"start_time" hcl:"start"`
EndMinute string `json:"end_time" hcl:"end"`
}
// swagger:model
type GettableTimeIntervals struct {
Name string `json:"name" hcl:"name"`
TimeIntervals []TimeIntervalItem `json:"time_intervals" hcl:"intervals,block"`
Version string `json:"version,omitempty"`
Provenance Provenance `json:"provenance,omitempty"`
}
-265
View File
@@ -1789,26 +1789,6 @@
],
"type": "object"
},
"GettableTimeIntervals": {
"properties": {
"name": {
"type": "string"
},
"provenance": {
"$ref": "#/definitions/Provenance"
},
"time_intervals": {
"items": {
"$ref": "#/definitions/TimeIntervalItem"
},
"type": "array"
},
"version": {
"type": "string"
}
},
"type": "object"
},
"GettableUserConfig": {
"properties": {
"alertmanager_config": {
@@ -2950,23 +2930,6 @@
},
"type": "object"
},
"PostableTimeIntervals": {
"properties": {
"name": {
"type": "string"
},
"time_intervals": {
"items": {
"$ref": "#/definitions/TimeIntervalItem"
},
"type": "array"
},
"version": {
"type": "string"
}
},
"type": "object"
},
"PostableUserConfig": {
"properties": {
"alertmanager_config": {
@@ -4492,55 +4455,6 @@
"title": "TimeInterval represents a named set of time intervals for which a route should be muted.",
"type": "object"
},
"TimeIntervalItem": {
"properties": {
"days_of_month": {
"items": {
"type": "string"
},
"type": "array"
},
"location": {
"type": "string"
},
"months": {
"items": {
"type": "string"
},
"type": "array"
},
"times": {
"items": {
"$ref": "#/definitions/TimeIntervalTimeRange"
},
"type": "array"
},
"weekdays": {
"items": {
"type": "string"
},
"type": "array"
},
"years": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"TimeIntervalTimeRange": {
"properties": {
"end_time": {
"type": "string"
},
"start_time": {
"type": "string"
}
},
"type": "object"
},
"TimeRange": {
"description": "Redefining this to avoid an import cycle",
"properties": {
@@ -8029,155 +7943,6 @@
]
}
},
"/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": [
{
"in": "query",
"items": {
"type": "string"
},
"name": "names",
"type": "array"
},
{
"format": "int64",
"in": "query",
"name": "limit",
"type": "integer"
},
{
"format": "int64",
"in": "query",
"name": "offset",
"type": "integer"
},
{
"in": "query",
"name": "decrypt",
"type": "boolean"
}
],
"responses": {
"200": {
"$ref": "#/responses/GetReceiversResponse"
},
"403": {
"description": "PermissionDenied",
"schema": {
"$ref": "#/definitions/PermissionDenied"
}
}
},
"summary": "Get all receivers.",
"tags": [
"notifications"
]
}
},
"/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": [
{
"in": "path",
"name": "name",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "decrypt",
"type": "boolean"
}
],
"responses": {
"200": {
"$ref": "#/responses/GetReceiverResponse"
},
"403": {
"description": "PermissionDenied",
"schema": {
"$ref": "#/definitions/PermissionDenied"
}
},
"404": {
"description": "NotFound",
"schema": {
"$ref": "#/definitions/NotFound"
}
}
},
"summary": "Get a receiver by name.",
"tags": [
"notifications"
]
}
},
"/v1/notifications/time-intervals": {
"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": "RouteNotificationsGetTimeIntervals",
"responses": {
"200": {
"$ref": "#/responses/GetAllIntervalsResponse"
},
"403": {
"description": "ForbiddenError",
"schema": {
"$ref": "#/definitions/ForbiddenError"
}
}
},
"summary": "Get all the time intervals",
"tags": [
"notifications"
]
}
},
"/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": [
{
"description": "Time interval name",
"in": "path",
"name": "name",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"$ref": "#/responses/GetIntervalsByNameResponse"
},
"403": {
"description": "ForbiddenError",
"schema": {
"$ref": "#/definitions/ForbiddenError"
}
},
"404": {
"description": "NotFound",
"schema": {
"$ref": "#/definitions/NotFound"
}
}
},
"summary": "Get a time interval by name.",
"tags": [
"notifications"
]
}
},
"/v1/provisioning/alert-rules": {
"get": {
"operationId": "RouteGetAlertRules",
@@ -9557,36 +9322,6 @@
"application/json"
],
"responses": {
"GetAllIntervalsResponse": {
"description": "",
"schema": {
"items": {
"$ref": "#/definitions/GettableTimeIntervals"
},
"type": "array"
}
},
"GetIntervalsByNameResponse": {
"description": "",
"schema": {
"$ref": "#/definitions/GettableTimeIntervals"
}
},
"GetReceiverResponse": {
"description": "",
"schema": {
"$ref": "#/definitions/GettableApiReceiver"
}
},
"GetReceiversResponse": {
"description": "",
"schema": {
"items": {
"$ref": "#/definitions/GettableApiReceiver"
},
"type": "array"
}
},
"GettableHistoricUserConfigs": {
"description": "",
"schema": {
-265
View File
@@ -2671,155 +2671,6 @@
}
}
},
"/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",
"items": {
"type": "string"
},
"name": "names",
"in": "query"
},
{
"type": "integer",
"format": "int64",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"format": "int64",
"name": "offset",
"in": "query"
},
{
"type": "boolean",
"name": "decrypt",
"in": "query"
}
],
"responses": {
"200": {
"$ref": "#/responses/GetReceiversResponse"
},
"403": {
"description": "PermissionDenied",
"schema": {
"$ref": "#/definitions/PermissionDenied"
}
}
}
}
},
"/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",
"name": "name",
"in": "path",
"required": true
},
{
"type": "boolean",
"name": "decrypt",
"in": "query"
}
],
"responses": {
"200": {
"$ref": "#/responses/GetReceiverResponse"
},
"403": {
"description": "PermissionDenied",
"schema": {
"$ref": "#/definitions/PermissionDenied"
}
},
"404": {
"description": "NotFound",
"schema": {
"$ref": "#/definitions/NotFound"
}
}
}
}
},
"/v1/notifications/time-intervals": {
"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 the time intervals",
"operationId": "RouteNotificationsGetTimeIntervals",
"deprecated": true,
"responses": {
"200": {
"$ref": "#/responses/GetAllIntervalsResponse"
},
"403": {
"description": "ForbiddenError",
"schema": {
"$ref": "#/definitions/ForbiddenError"
}
}
}
}
},
"/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",
"description": "Time interval name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/GetIntervalsByNameResponse"
},
"403": {
"description": "ForbiddenError",
"schema": {
"$ref": "#/definitions/ForbiddenError"
}
},
"404": {
"description": "NotFound",
"schema": {
"$ref": "#/definitions/NotFound"
}
}
}
}
},
"/v1/provisioning/alert-rules": {
"get": {
"tags": [
@@ -6013,26 +5864,6 @@
}
}
},
"GettableTimeIntervals": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"provenance": {
"$ref": "#/definitions/Provenance"
},
"time_intervals": {
"type": "array",
"items": {
"$ref": "#/definitions/TimeIntervalItem"
}
},
"version": {
"type": "string"
}
}
},
"GettableUserConfig": {
"type": "object",
"properties": {
@@ -7175,23 +7006,6 @@
}
}
},
"PostableTimeIntervals": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"time_intervals": {
"type": "array",
"items": {
"$ref": "#/definitions/TimeIntervalItem"
}
},
"version": {
"type": "string"
}
}
},
"PostableUserConfig": {
"type": "object",
"properties": {
@@ -8717,55 +8531,6 @@
}
}
},
"TimeIntervalItem": {
"type": "object",
"properties": {
"days_of_month": {
"type": "array",
"items": {
"type": "string"
}
},
"location": {
"type": "string"
},
"months": {
"type": "array",
"items": {
"type": "string"
}
},
"times": {
"type": "array",
"items": {
"$ref": "#/definitions/TimeIntervalTimeRange"
}
},
"weekdays": {
"type": "array",
"items": {
"type": "string"
}
},
"years": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"TimeIntervalTimeRange": {
"type": "object",
"properties": {
"end_time": {
"type": "string"
},
"start_time": {
"type": "string"
}
}
},
"TimeRange": {
"description": "Redefining this to avoid an import cycle",
"type": "object",
@@ -9595,36 +9360,6 @@
}
},
"responses": {
"GetAllIntervalsResponse": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/GettableTimeIntervals"
}
}
},
"GetIntervalsByNameResponse": {
"description": "",
"schema": {
"$ref": "#/definitions/GettableTimeIntervals"
}
},
"GetReceiverResponse": {
"description": "",
"schema": {
"$ref": "#/definitions/GettableApiReceiver"
}
},
"GetReceiversResponse": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/GettableApiReceiver"
}
}
},
"GettableHistoricUserConfigs": {
"description": "",
"schema": {