Commit 4a2a2b16 by Ryan McKinley Committed by GitHub

Query: make queryType a top level property (#23412)

parent 4a3399e9
...@@ -370,6 +370,11 @@ export interface DataQueryResponse { ...@@ -370,6 +370,11 @@ export interface DataQueryResponse {
state?: LoadingState; state?: LoadingState;
} }
/**
* These are the common properties avaliable to all queries in all datasources
* Specific implementations will extend this interface adding the required properties
* for the given context
*/
export interface DataQuery { export interface DataQuery {
/** /**
* A - Z * A - Z
...@@ -377,7 +382,7 @@ export interface DataQuery { ...@@ -377,7 +382,7 @@ export interface DataQuery {
refId: string; refId: string;
/** /**
* true if query is disabled (ie not executed / sent to TSDB) * true if query is disabled (ie should not be returned to the dashboard)
*/ */
hide?: boolean; hide?: boolean;
...@@ -387,6 +392,11 @@ export interface DataQuery { ...@@ -387,6 +392,11 @@ export interface DataQuery {
key?: string; key?: string;
/** /**
* Specify the query flavor
*/
queryType?: string;
/**
* For mixed data sources the selected datasource is on the query level. * For mixed data sources the selected datasource is on the query level.
* For non mixed scenarios this is undefined. * For non mixed scenarios this is undefined.
*/ */
......
...@@ -3,7 +3,6 @@ import { DataQuery, DataSourceJsonData, DataSourceSettings } from '@grafana/data ...@@ -3,7 +3,6 @@ import { DataQuery, DataSourceJsonData, DataSourceSettings } from '@grafana/data
export type AzureDataSourceSettings = DataSourceSettings<AzureDataSourceJsonData, AzureDataSourceSecureJsonData>; export type AzureDataSourceSettings = DataSourceSettings<AzureDataSourceJsonData, AzureDataSourceSecureJsonData>;
export interface AzureMonitorQuery extends DataQuery { export interface AzureMonitorQuery extends DataQuery {
refId: string;
format: string; format: string;
subscription: string; subscription: string;
azureMonitor: AzureMetricQuery; azureMonitor: AzureMetricQuery;
......
...@@ -78,8 +78,7 @@ export interface SLOQuery { ...@@ -78,8 +78,7 @@ export interface SLOQuery {
} }
export interface StackdriverQuery extends DataQuery { export interface StackdriverQuery extends DataQuery {
datasourceId?: number; datasourceId?: number; // Should not be necessary anymore
refId: string;
queryType: QueryType; queryType: QueryType;
metricQuery: MetricQuery; metricQuery: MetricQuery;
sloQuery?: SLOQuery; sloQuery?: SLOQuery;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment