Scopes: Adapt for new API (#87841)

* Implement changes for new Scopes API

* Update from linkID to linkId

* Fixes

* Fix tests

* prom/scopes: change query model to recieve []ScopeSpec

* Move to basic backend service

---------

Co-authored-by: Kyle Brandt <kyle@grafana.com>
This commit is contained in:
Bogdan Matei
2024-05-15 16:28:09 +03:00
committed by GitHub
parent 6c1e9a9717
commit 6127dfd322
14 changed files with 665 additions and 331 deletions
+49 -45
View File
@@ -172,55 +172,59 @@
},
"additionalProperties": false
},
"scope": {
"scopes": {
"description": "A set of filters applied to apply to the query",
"type": "object",
"required": [
"title",
"type",
"description",
"category",
"filters"
],
"properties": {
"category": {
"type": "string"
},
"description": {
"type": "string"
},
"filters": {
"type": "array",
"items": {
"description": "ScopeFilter is a hand copy of the ScopeFilter struct from pkg/apis/scope/v0alpha1/types.go to avoid import (temp fix)",
"type": "object",
"required": [
"key",
"value",
"operator"
],
"properties": {
"key": {
"type": "string"
"type": "array",
"items": {
"description": "ScopeSpec is a hand copy of the ScopeSpec struct from pkg/apis/scope/v0alpha1/types.go to avoid import (temp fix)",
"type": "object",
"required": [
"title",
"type",
"description",
"category",
"filters"
],
"properties": {
"category": {
"type": "string"
},
"description": {
"type": "string"
},
"filters": {
"type": "array",
"items": {
"description": "ScopeFilter is a hand copy of the ScopeFilter struct from pkg/apis/scope/v0alpha1/types.go to avoid import (temp fix)",
"type": "object",
"required": [
"key",
"value",
"operator"
],
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"value": {
"type": "string"
}
},
"operator": {
"type": "string"
},
"value": {
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false
}
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false
}
},
"timeRange": {
"description": "TimeRange represents the query range\nNOTE: unlike generic /ds/query, we can now send explicit time values in each query\nNOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly",