mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Remove id and org_id from grafana alert rule API model (#100139)
This commit is contained in:
parent
0fe4b15d00
commit
f7d476e408
@ -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),
|
||||
|
@ -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"
|
||||
},
|
||||
|
@ -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"`
|
||||
|
@ -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"
|
||||
},
|
||||
|
@ -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"
|
||||
},
|
||||
|
@ -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":[
|
||||
|
@ -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": [
|
||||
|
@ -12,8 +12,6 @@
|
||||
"annotation": "test-annotation"
|
||||
},
|
||||
"grafana_alert": {
|
||||
"id": 3,
|
||||
"orgId": 1,
|
||||
"title": "Rule3",
|
||||
"condition": "A",
|
||||
"data": [
|
||||
|
@ -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": [
|
||||
|
@ -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"
|
||||
},
|
||||
|
@ -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"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user