blob: 1bd2152c4a768bd1f2d9d427c6cad111285bad6a [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: 'table',
19
20 setFieldConfig(
21 displayName=null,
22 max=0,
23 min=0,
24 thresholdMode='absolute',
25 noValue=null,
26 unit='short',
27 width=null,
28 ):: self {}
29 + { fieldConfig+: { defaults+: { [if displayName != null then 'displayName']: displayName } } }
30 + { fieldConfig+: { defaults+: { [if max != null then 'max']: max } } }
31 + { fieldConfig+: { defaults+: { [if min != null then 'min']: min } } }
32 + { fieldConfig+: { defaults+: { thresholds+: { [if thresholdMode != null then 'mode']: thresholdMode } } } }
33 + { fieldConfig+: { defaults+: { [if noValue != null then 'noValue']: noValue } } }
34 + { fieldConfig+: { defaults+: { [if unit != null then 'unit']: unit } } }
35 + { fieldConfig+: { defaults+: { custom+: { [if width != null then 'width']: width } } } }
36 ,
37
38 setGridPos(
39 h=8,
40 w=12,
41 x=null,
42 y=null,
43 ):: self {}
44 + { gridPos+: { [if h != null then 'h']: h } }
45 + { gridPos+: { [if w != null then 'w']: w } }
46 + { gridPos+: { [if x != null then 'x']: x } }
47 + { gridPos+: { [if y != null then 'y']: y } }
48 ,
49
50 setOptions(
51 showHeader=true,
52 ):: self {}
53 + { options+: { [if showHeader != null then 'showHeader']: showHeader } }
54 ,
55
56
57 addDataLink(
58 targetBlank=true,
59 title=null,
60 url=null,
61 ):: self {}
62 + { fieldConfig+: { defaults+: { links+: [
63 {
64 [if targetBlank != null then 'targetBlank']: targetBlank,
65 [if title != null then 'title']: title,
66 [if url != null then 'url']: url,
67 },
68 ] } } },
69
70 addPanelLink(
71 targetBlank=true,
72 title=null,
73 url=null,
74 ):: self {}
75 + { links+: [
76 {
77 [if targetBlank != null then 'targetBlank']: targetBlank,
78 [if title != null then 'title']: title,
79 [if url != null then 'url']: url,
80 },
81 ] },
82
83 addMapping(
84 from=null,
85 id=null,
86 operator=null,
87 text=null,
88 to=null,
89 type=null,
90 value=null,
91 ):: self {}
92 + { fieldConfig+: { defaults+: { mappings+: [
93 {
94 [if from != null then 'from']: from,
95 [if id != null then 'id']: id,
96 [if operator != null then 'operator']: operator,
97 [if text != null then 'text']: text,
98 [if to != null then 'to']: to,
99 [if type != null then 'type']: type,
100 [if value != null then 'value']: value,
101 },
102 ] } } },
103
104 addOverride(
105 matcher=null,
106 properties=null,
107 ):: self {}
108 + { fieldConfig+: { overrides+: [
109 {
110 [if matcher != null then 'matcher']: matcher,
111 [if properties != null then 'properties']: properties,
112 },
113 ] } },
114
115 addThresholdStep(
116 color=null,
117 value=null,
118 ):: self {}
119 + { fieldConfig+: { defaults+: { thresholds+: { steps+: [
120 {
121 [if color != null then 'color']: color,
122 [if value != null then 'value']: value,
123 },
124 ] } } } },
125
126 addTarget(
127 target
128 ):: self {}
129 + { targets+: [
130 target,
131 ] },
132
133 },
134}