AlertingNG/SSE: Datasource UID and UID/ID only (drop name) (#33039)
SSE still will support ID until dashboard/frontend always requests UID update *.http examples Co-authored-by: gotjosh <josue@grafana.com>
This commit is contained in:
+13
-1
@@ -30,7 +30,7 @@ type rawNode struct {
|
||||
func (rn *rawNode) GetDatasourceName() (string, error) {
|
||||
rawDs, ok := rn.Query["datasource"]
|
||||
if !ok {
|
||||
return "", fmt.Errorf("no datasource in query for refId %v", rn.RefID)
|
||||
return "", nil
|
||||
}
|
||||
dsName, ok := rawDs.(string)
|
||||
if !ok {
|
||||
@@ -39,6 +39,18 @@ func (rn *rawNode) GetDatasourceName() (string, error) {
|
||||
return dsName, nil
|
||||
}
|
||||
|
||||
func (rn *rawNode) GetDatasourceUid() (string, error) {
|
||||
rawDs, ok := rn.Query["datasourceUid"]
|
||||
if !ok {
|
||||
return "", nil
|
||||
}
|
||||
dsUID, ok := rawDs.(string)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("expected datasource identifier to be a string, got %T", rawDs)
|
||||
}
|
||||
return dsUID, nil
|
||||
}
|
||||
|
||||
func (rn *rawNode) GetCommandType() (c CommandType, err error) {
|
||||
rawType, ok := rn.Query["type"]
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user