Alerting: Remove id and org_id from grafana alert rule API model (#100139)

This commit is contained in:
Yuri Tseretyan 2025-02-05 16:13:22 -05:00 committed by GitHub
parent 0fe4b15d00
commit f7d476e408
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 0 additions and 75 deletions

View File

@ -585,8 +585,6 @@ func toGettableExtendedRuleNode(r ngmodels.AlertRule, provenanceRecords map[stri
gettableExtendedRuleNode := apimodels.GettableExtendedRuleNode{
GrafanaManagedAlert: &apimodels.GettableGrafanaRule{
ID: r.ID,
OrgID: r.OrgID,
Title: r.Title,
Condition: r.Condition,
Data: ApiAlertQueriesFromAlertQueries(r.Data),

View File

@ -1593,10 +1593,6 @@
],
"type": "string"
},
"id": {
"format": "int64",
"type": "integer"
},
"intervalSeconds": {
"format": "int64",
"type": "integer"
@ -1621,10 +1617,6 @@
"notification_settings": {
"$ref": "#/definitions/AlertRuleNotificationSettings"
},
"orgId": {
"format": "int64",
"type": "integer"
},
"provenance": {
"$ref": "#/definitions/Provenance"
},

View File

@ -550,8 +550,6 @@ type PostableGrafanaRule struct {
// swagger:model
type GettableGrafanaRule struct {
ID int64 `json:"id" yaml:"id"`
OrgID int64 `json:"orgId" yaml:"orgId"`
Title string `json:"title" yaml:"title"`
Condition string `json:"condition" yaml:"condition"`
Data []AlertQuery `json:"data" yaml:"data"`

View File

@ -1593,10 +1593,6 @@
],
"type": "string"
},
"id": {
"format": "int64",
"type": "integer"
},
"intervalSeconds": {
"format": "int64",
"type": "integer"
@ -1621,10 +1617,6 @@
"notification_settings": {
"$ref": "#/definitions/AlertRuleNotificationSettings"
},
"orgId": {
"format": "int64",
"type": "integer"
},
"provenance": {
"$ref": "#/definitions/Provenance"
},

View File

@ -5281,10 +5281,6 @@
"Error"
]
},
"id": {
"type": "integer",
"format": "int64"
},
"intervalSeconds": {
"type": "integer",
"format": "int64"
@ -5309,10 +5305,6 @@
"notification_settings": {
"$ref": "#/definitions/AlertRuleNotificationSettings"
},
"orgId": {
"type": "integer",
"format": "int64"
},
"provenance": {
"$ref": "#/definitions/Provenance"
},

View File

@ -1143,8 +1143,6 @@ func TestIntegrationRulerRulesFilterByDashboard(t *testing.T) {
"__panelId__": "1"
},
"grafana_alert": {
"id": 1,
"orgId": 1,
"title": "AlwaysFiring",
"condition": "A",
"data": [{
@ -1186,8 +1184,6 @@ func TestIntegrationRulerRulesFilterByDashboard(t *testing.T) {
"expr": "",
"for":"0s",
"grafana_alert": {
"id": 2,
"orgId": 1,
"title": "AlwaysFiringButSilenced",
"condition": "A",
"data": [{
@ -1241,8 +1237,6 @@ func TestIntegrationRulerRulesFilterByDashboard(t *testing.T) {
"__panelId__": "1"
},
"grafana_alert": {
"id": 1,
"orgId": 1,
"title": "AlwaysFiring",
"condition": "A",
"data": [{
@ -1583,7 +1577,6 @@ func TestIntegrationRuleCreate(t *testing.T) {
},
},
GrafanaManagedAlert: &apimodels.GettableGrafanaRule{
OrgID: 1,
Title: "test1 rule1",
Condition: "A",
Data: []apimodels.AlertQuery{
@ -2526,8 +2519,6 @@ func TestIntegrationQuota(t *testing.T) {
"expr":"",
"for": "2m",
"grafana_alert":{
"id":1,
"orgId":1,
"title":"Updated alert rule",
"condition":"A",
"data":[
@ -2641,8 +2632,6 @@ func TestIntegrationDeleteFolderWithRules(t *testing.T) {
"annotation1": "val1"
},
"grafana_alert": {
"id": 1,
"orgId": 1,
"title": "rule under folder default",
"condition": "A",
"data": [
@ -3124,8 +3113,6 @@ func TestIntegrationAlertRuleCRUD(t *testing.T) {
"label1": "val1"
},
"grafana_alert":{
"id":1,
"orgId":1,
"title":"AlwaysFiring",
"condition":"A",
"data":[
@ -3170,8 +3157,6 @@ func TestIntegrationAlertRuleCRUD(t *testing.T) {
"expr":"",
"for": "0s",
"grafana_alert":{
"id":2,
"orgId":1,
"title":"AlwaysFiringButSilenced",
"condition":"A",
"data":[
@ -3488,8 +3473,6 @@ func TestIntegrationAlertRuleCRUD(t *testing.T) {
"label2": "val2"
},
"grafana_alert":{
"id":1,
"orgId":1,
"title":"AlwaysNormal",
"condition":"A",
"data":[
@ -3607,8 +3590,6 @@ func TestIntegrationAlertRuleCRUD(t *testing.T) {
"expr":"",
"for": "30s",
"grafana_alert":{
"id":1,
"orgId":1,
"title":"AlwaysNormal",
"condition":"A",
"data":[
@ -3705,8 +3686,6 @@ func TestIntegrationAlertRuleCRUD(t *testing.T) {
"expr":"",
"for": "30s",
"grafana_alert":{
"id":1,
"orgId":1,
"title":"AlwaysNormal",
"condition":"A",
"data":[

View File

@ -12,8 +12,6 @@
"annotation": "test-annotation"
},
"grafana_alert": {
"id": 1,
"orgId": 1,
"title": "Rule1",
"condition": "A",
"data": [
@ -60,8 +58,6 @@
"annotation": "test-annotation"
},
"grafana_alert": {
"id": 2,
"orgId": 1,
"title": "Rule2",
"condition": "A",
"data": [

View File

@ -12,8 +12,6 @@
"annotation": "test-annotation"
},
"grafana_alert": {
"id": 3,
"orgId": 1,
"title": "Rule3",
"condition": "A",
"data": [

View File

@ -12,8 +12,6 @@
"annotation": "test-annotation"
},
"grafana_alert": {
"id": 1,
"orgId": 1,
"title": "Rule1",
"condition": "A",
"data": [
@ -60,8 +58,6 @@
"annotation": "test-annotation"
},
"grafana_alert": {
"id": 2,
"orgId": 1,
"title": "Rule2",
"condition": "A",
"data": [

View File

@ -16013,10 +16013,6 @@
"Error"
]
},
"id": {
"type": "integer",
"format": "int64"
},
"intervalSeconds": {
"type": "integer",
"format": "int64"
@ -16041,10 +16037,6 @@
"notification_settings": {
"$ref": "#/definitions/AlertRuleNotificationSettings"
},
"orgId": {
"type": "integer",
"format": "int64"
},
"provenance": {
"$ref": "#/definitions/Provenance"
},

View File

@ -6087,10 +6087,6 @@
],
"type": "string"
},
"id": {
"format": "int64",
"type": "integer"
},
"intervalSeconds": {
"format": "int64",
"type": "integer"
@ -6115,10 +6111,6 @@
"notification_settings": {
"$ref": "#/components/schemas/AlertRuleNotificationSettings"
},
"orgId": {
"format": "int64",
"type": "integer"
},
"provenance": {
"$ref": "#/components/schemas/Provenance"
},