CloudWatch: Use generated type from schema in backend (#66420)
* CloudWatch: Use generated type from schema in backend * address comments * don't explicity set default metric query type
This commit is contained in:
@@ -27,21 +27,13 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/query"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/clients"
|
||||
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/kinds/dataquery"
|
||||
"github.com/grafana/grafana/pkg/tsdb/cloudwatch/models"
|
||||
)
|
||||
|
||||
type DataQueryJson struct {
|
||||
QueryType string `json:"type,omitempty"`
|
||||
QueryMode string
|
||||
PrefixMatching bool
|
||||
Region string
|
||||
Namespace string
|
||||
MetricName string
|
||||
Dimensions map[string]interface{}
|
||||
Statistic *string
|
||||
Period string
|
||||
ActionPrefix string
|
||||
AlarmNamePrefix string
|
||||
dataquery.CloudWatchAnnotationQuery
|
||||
Type string `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
type DataSource struct {
|
||||
@@ -179,7 +171,7 @@ func (e *cloudWatchExecutor) QueryData(ctx context.Context, req *backend.QueryDa
|
||||
}
|
||||
|
||||
var result *backend.QueryDataResponse
|
||||
switch model.QueryType {
|
||||
switch model.Type {
|
||||
case annotationQuery:
|
||||
result, err = e.executeAnnotationQuery(req.PluginContext, model, q)
|
||||
case logAction:
|
||||
|
||||
Reference in New Issue
Block a user