Alerting/Expr: New SSE Request/QueryType, alerting move data source UID (#33282)
This commit is contained in:
@@ -90,8 +90,8 @@ func TestAlertAndGroupsQuery(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 > 1"
|
||||
}`),
|
||||
@@ -208,8 +208,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 > 1"
|
||||
}`),
|
||||
@@ -238,8 +238,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 > 1"
|
||||
}`),
|
||||
@@ -268,8 +268,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 > 1"
|
||||
}`),
|
||||
@@ -299,8 +299,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 > 1"
|
||||
}`),
|
||||
@@ -368,8 +368,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 > 1"
|
||||
}`),
|
||||
@@ -388,8 +388,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 > 1"
|
||||
}`),
|
||||
@@ -474,8 +474,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from":18000,
|
||||
"to":10800
|
||||
},
|
||||
"datasourceUid":"-100",
|
||||
"model":{
|
||||
"datasourceUid":"-100",
|
||||
"expression":"2 + 3 \u003e 1",
|
||||
"intervalMs":1000,
|
||||
"maxDataPoints":100,
|
||||
@@ -509,8 +509,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from":18000,
|
||||
"to":10800
|
||||
},
|
||||
"datasourceUid":"-100",
|
||||
"model":{
|
||||
"datasourceUid":"-100",
|
||||
"expression":"2 + 3 \u003e 1",
|
||||
"intervalMs":1000,
|
||||
"maxDataPoints":100,
|
||||
@@ -567,8 +567,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 < 1"
|
||||
}`),
|
||||
@@ -651,8 +651,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
From: ngmodels.Duration(time.Duration(5) * time.Hour),
|
||||
To: ngmodels.Duration(time.Duration(3) * time.Hour),
|
||||
},
|
||||
DatasourceUID: "-100",
|
||||
Model: json.RawMessage(`{
|
||||
"datasourceUid": "-100",
|
||||
"type": "math",
|
||||
"expression": "2 + 3 < 1"
|
||||
}`),
|
||||
@@ -733,8 +733,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from":18000,
|
||||
"to":10800
|
||||
},
|
||||
"model":{
|
||||
"datasourceUid":"-100",
|
||||
"datasourceUid":"-100",
|
||||
"model":{
|
||||
"expression":"2 + 3 \u003C 1",
|
||||
"intervalMs":1000,
|
||||
"maxDataPoints":100,
|
||||
@@ -817,8 +817,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from": 18000,
|
||||
"to": 10800
|
||||
},
|
||||
"datasourceUid":"-100",
|
||||
"model": {
|
||||
"datasourceUid": "-100",
|
||||
"type":"math",
|
||||
"expression":"1 < 2"
|
||||
}
|
||||
@@ -868,8 +868,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from": 18000,
|
||||
"to": 10800
|
||||
},
|
||||
"datasourceUid": "-100",
|
||||
"model": {
|
||||
"datasourceUid": "-100",
|
||||
"type":"math",
|
||||
"expression":"1 > 2"
|
||||
}
|
||||
@@ -919,8 +919,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from": 18000,
|
||||
"to": 10800
|
||||
},
|
||||
"datasourceUid": "-100",
|
||||
"model": {
|
||||
"datasourceUid": "-100",
|
||||
"type":"math",
|
||||
"expression":"1 > 2"
|
||||
}
|
||||
@@ -946,8 +946,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from": 18000,
|
||||
"to": 10800
|
||||
},
|
||||
"datasourceUid": "unknown",
|
||||
"model": {
|
||||
"datasourceUid": "unknown"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -997,8 +997,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from": 18000,
|
||||
"to": 10800
|
||||
},
|
||||
"datasourceUid": "-100",
|
||||
"model": {
|
||||
"datasourceUid": "-100",
|
||||
"type":"math",
|
||||
"expression":"1 < 2"
|
||||
}
|
||||
@@ -1050,8 +1050,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from": 18000,
|
||||
"to": 10800
|
||||
},
|
||||
"datasourceUid": "-100",
|
||||
"model": {
|
||||
"datasourceUid": "-100",
|
||||
"type":"math",
|
||||
"expression":"1 > 2"
|
||||
}
|
||||
@@ -1103,8 +1103,8 @@ func TestAlertRuleCRUD(t *testing.T) {
|
||||
"from": 18000,
|
||||
"to": 10800
|
||||
},
|
||||
"datasourceUid": "unknown",
|
||||
"model": {
|
||||
"datasourceUid": "unknown"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user