1export type GrafanaTemplateVariableQueryType =
2  | 'AppInsightsMetricNameQuery'
3  | 'AppInsightsGroupByQuery'
4  | 'SubscriptionsQuery'
5  | 'ResourceGroupsQuery'
6  | 'MetricDefinitionsQuery'
7  | 'ResourceNamesQuery'
8  | 'MetricNamespaceQuery'
9  | 'MetricNamesQuery'
10  | 'WorkspacesQuery'
11  | 'UnknownQuery';
12
13interface BaseGrafanaTemplateVariableQuery {
14  rawQuery?: string;
15}
16
17export interface UnknownQuery extends BaseGrafanaTemplateVariableQuery {
18  kind: 'UnknownQuery';
19}
20export interface AppInsightsMetricNameQuery extends BaseGrafanaTemplateVariableQuery {
21  kind: 'AppInsightsMetricNameQuery';
22}
23export interface AppInsightsGroupByQuery extends BaseGrafanaTemplateVariableQuery {
24  kind: 'AppInsightsGroupByQuery';
25  metricName: string;
26}
27export interface SubscriptionsQuery extends BaseGrafanaTemplateVariableQuery {
28  kind: 'SubscriptionsQuery';
29}
30export interface ResourceGroupsQuery extends BaseGrafanaTemplateVariableQuery {
31  kind: 'ResourceGroupsQuery';
32  subscription: string;
33}
34export interface MetricDefinitionsQuery extends BaseGrafanaTemplateVariableQuery {
35  kind: 'MetricDefinitionsQuery';
36  subscription: string;
37  resourceGroup: string;
38}
39export interface ResourceNamesQuery extends BaseGrafanaTemplateVariableQuery {
40  kind: 'ResourceNamesQuery';
41  subscription: string;
42  resourceGroup: string;
43  metricDefinition: string;
44}
45export interface MetricNamespaceQuery extends BaseGrafanaTemplateVariableQuery {
46  kind: 'MetricNamespaceQuery';
47  subscription: string;
48  resourceGroup: string;
49  metricDefinition: string;
50  resourceName: string;
51}
52export interface MetricNamesQuery extends BaseGrafanaTemplateVariableQuery {
53  kind: 'MetricNamesQuery';
54  subscription: string;
55  resourceGroup: string;
56  metricDefinition: string;
57  resourceName: string;
58  metricNamespace: string;
59}
60export interface WorkspacesQuery extends BaseGrafanaTemplateVariableQuery {
61  kind: 'WorkspacesQuery';
62  subscription: string;
63}
64
65export type GrafanaTemplateVariableQuery =
66  | AppInsightsMetricNameQuery
67  | AppInsightsGroupByQuery
68  | SubscriptionsQuery
69  | ResourceGroupsQuery
70  | MetricDefinitionsQuery
71  | ResourceNamesQuery
72  | MetricNamespaceQuery
73  | MetricNamesQuery
74  | WorkspacesQuery
75  | UnknownQuery;
76