blob: 4520444a791ac689206904f0a9b575a120f65e52 [file] [log] [blame]
Serge Bazanski7d311e92020-10-10 17:57:44 +02001// This file was generated by https://github.com/grafana/dashboard-spec
2
3{
4 new(
5 datasource='default',
6 description=null,
7 repeat=null,
8 repeatDirection=null,
9 title=null,
10 transparent=false,
11 ):: {
12 [if datasource != null then 'datasource']: datasource,
13 [if description != null then 'description']: description,
14 [if repeat != null then 'repeat']: repeat,
15 [if repeatDirection != null then 'repeatDirection']: repeatDirection,
16 [if title != null then 'title']: title,
17 [if transparent != null then 'transparent']: transparent,
18 type: 'gauge',
19
20 setFieldConfig(
21 max=null,
22 min=null,
23 thresholdMode='absolute',
24 unit=null,
25 ):: self {}
26 + { fieldConfig+: { defaults+: { [if max != null then 'max']: max } } }
27 + { fieldConfig+: { defaults+: { [if min != null then 'min']: min } } }
28 + { fieldConfig+: { defaults+: { thresholds+: { [if thresholdMode != null then 'mode']: thresholdMode } } } }
29 + { fieldConfig+: { defaults+: { [if unit != null then 'unit']: unit } } }
30 ,
31
32 setGridPos(
33 h=8,
34 w=12,
35 x=null,
36 y=null,
37 ):: self {}
38 + { gridPos+: { [if h != null then 'h']: h } }
39 + { gridPos+: { [if w != null then 'w']: w } }
40 + { gridPos+: { [if x != null then 'x']: x } }
41 + { gridPos+: { [if y != null then 'y']: y } }
42 ,
43
44 setOptions(
45 calcs=['mean'],
46 fields=null,
47 orientation='auto',
48 showThresholdLabels=false,
49 showThresholdMarkers=true,
50 values=false,
51 ):: self {}
52 + { options+: { reduceOptions+: { [if calcs != null then 'calcs']: calcs } } }
53 + { options+: { reduceOptions+: { [if fields != null then 'fields']: fields } } }
54 + { options+: { [if orientation != null then 'orientation']: orientation } }
55 + { options+: { [if showThresholdLabels != null then 'showThresholdLabels']: showThresholdLabels } }
56 + { options+: { [if showThresholdMarkers != null then 'showThresholdMarkers']: showThresholdMarkers } }
57 + { options+: { reduceOptions+: { [if values != null then 'values']: values } } }
58 ,
59
60
61 addDataLink(
62 targetBlank=true,
63 title=null,
64 url=null,
65 ):: self {}
66 + { fieldConfig+: { defaults+: { links+: [
67 {
68 [if targetBlank != null then 'targetBlank']: targetBlank,
69 [if title != null then 'title']: title,
70 [if url != null then 'url']: url,
71 },
72 ] } } },
73
74 addPanelLink(
75 targetBlank=true,
76 title=null,
77 url=null,
78 ):: self {}
79 + { links+: [
80 {
81 [if targetBlank != null then 'targetBlank']: targetBlank,
82 [if title != null then 'title']: title,
83 [if url != null then 'url']: url,
84 },
85 ] },
86
87 addMapping(
88 from=null,
89 id=null,
90 operator=null,
91 text=null,
92 to=null,
93 type=null,
94 value=null,
95 ):: self {}
96 + { fieldConfig+: { defaults+: { mappings+: [
97 {
98 [if from != null then 'from']: from,
99 [if id != null then 'id']: id,
100 [if operator != null then 'operator']: operator,
101 [if text != null then 'text']: text,
102 [if to != null then 'to']: to,
103 [if type != null then 'type']: type,
104 [if value != null then 'value']: value,
105 },
106 ] } } },
107
108 addOverride(
109 matcher=null,
110 properties=null,
111 ):: self {}
112 + { fieldConfig+: { overrides+: [
113 {
114 [if matcher != null then 'matcher']: matcher,
115 [if properties != null then 'properties']: properties,
116 },
117 ] } },
118
119 addThresholdStep(
120 color=null,
121 value=null,
122 ):: self {}
123 + { fieldConfig+: { defaults+: { thresholds+: { steps+: [
124 {
125 [if color != null then 'color']: color,
126 [if value != null then 'value']: value,
127 },
128 ] } } } },
129
130 addTarget(
131 target
132 ):: self {}
133 + { targets+: [
134 target,
135 ] },
136
137 },
138}