@intentius/chant-lexicon-grafana 0.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +50 -0
  2. package/dist/build.d.ts +116 -0
  3. package/dist/build.d.ts.map +1 -0
  4. package/dist/catalog.d.ts +26 -0
  5. package/dist/catalog.d.ts.map +1 -0
  6. package/dist/codegen/docs-cli.d.ts +3 -0
  7. package/dist/codegen/docs-cli.d.ts.map +1 -0
  8. package/dist/codegen/docs.d.ts +8 -0
  9. package/dist/codegen/docs.d.ts.map +1 -0
  10. package/dist/codegen/generate-cli.d.ts +3 -0
  11. package/dist/codegen/generate-cli.d.ts.map +1 -0
  12. package/dist/codegen/generate.d.ts +21 -0
  13. package/dist/codegen/generate.d.ts.map +1 -0
  14. package/dist/codegen/package.d.ts +7 -0
  15. package/dist/codegen/package.d.ts.map +1 -0
  16. package/dist/codegen/schema-types.d.ts +41 -0
  17. package/dist/codegen/schema-types.d.ts.map +1 -0
  18. package/dist/composites/agent-dashboard.d.ts +70 -0
  19. package/dist/composites/agent-dashboard.d.ts.map +1 -0
  20. package/dist/composites/catalog.d.ts +3 -0
  21. package/dist/composites/catalog.d.ts.map +1 -0
  22. package/dist/composites/index.d.ts +12 -0
  23. package/dist/composites/index.d.ts.map +1 -0
  24. package/dist/composites/red-dashboard.d.ts +58 -0
  25. package/dist/composites/red-dashboard.d.ts.map +1 -0
  26. package/dist/composites/shared.d.ts +68 -0
  27. package/dist/composites/shared.d.ts.map +1 -0
  28. package/dist/composites/slo-dashboard.d.ts +62 -0
  29. package/dist/composites/slo-dashboard.d.ts.map +1 -0
  30. package/dist/dashboard.d.ts +84 -0
  31. package/dist/dashboard.d.ts.map +1 -0
  32. package/dist/datasource.d.ts +67 -0
  33. package/dist/datasource.d.ts.map +1 -0
  34. package/dist/detect.d.ts +20 -0
  35. package/dist/detect.d.ts.map +1 -0
  36. package/dist/index.d.ts +17 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/integrity.json +22 -0
  39. package/dist/lint/audit-catalog.d.ts +13 -0
  40. package/dist/lint/audit-catalog.d.ts.map +1 -0
  41. package/dist/lint/post-synth/graf101.d.ts +8 -0
  42. package/dist/lint/post-synth/graf101.d.ts.map +1 -0
  43. package/dist/lint/post-synth/graf102.d.ts +8 -0
  44. package/dist/lint/post-synth/graf102.d.ts.map +1 -0
  45. package/dist/lint/post-synth/graf103.d.ts +8 -0
  46. package/dist/lint/post-synth/graf103.d.ts.map +1 -0
  47. package/dist/lint/post-synth/graf104.d.ts +8 -0
  48. package/dist/lint/post-synth/graf104.d.ts.map +1 -0
  49. package/dist/lint/post-synth/graf105.d.ts +8 -0
  50. package/dist/lint/post-synth/graf105.d.ts.map +1 -0
  51. package/dist/lint/post-synth/graf106.d.ts +8 -0
  52. package/dist/lint/post-synth/graf106.d.ts.map +1 -0
  53. package/dist/lint/post-synth/graf107.d.ts +8 -0
  54. package/dist/lint/post-synth/graf107.d.ts.map +1 -0
  55. package/dist/lint/post-synth/grafana-helpers.d.ts +16 -0
  56. package/dist/lint/post-synth/grafana-helpers.d.ts.map +1 -0
  57. package/dist/lint/post-synth/index.d.ts +3 -0
  58. package/dist/lint/post-synth/index.d.ts.map +1 -0
  59. package/dist/lint/rules/grafana-ast.d.ts +21 -0
  60. package/dist/lint/rules/grafana-ast.d.ts.map +1 -0
  61. package/dist/lint/rules/index.d.ts +6 -0
  62. package/dist/lint/rules/index.d.ts.map +1 -0
  63. package/dist/lint/rules/literal-secret.d.ts +12 -0
  64. package/dist/lint/rules/literal-secret.d.ts.map +1 -0
  65. package/dist/lint/rules/uid-syntax.d.ts +12 -0
  66. package/dist/lint/rules/uid-syntax.d.ts.map +1 -0
  67. package/dist/lsp/completions.d.ts +4 -0
  68. package/dist/lsp/completions.d.ts.map +1 -0
  69. package/dist/lsp/hover.d.ts +4 -0
  70. package/dist/lsp/hover.d.ts.map +1 -0
  71. package/dist/manifest.json +8 -0
  72. package/dist/meta.json +107 -0
  73. package/dist/okf/index.md +39 -0
  74. package/dist/okf/rules/GRAF001.md +16 -0
  75. package/dist/okf/rules/GRAF002.md +15 -0
  76. package/dist/okf/rules/GRAF101.md +15 -0
  77. package/dist/okf/rules/GRAF102.md +15 -0
  78. package/dist/okf/rules/GRAF103.md +11 -0
  79. package/dist/okf/rules/GRAF104.md +15 -0
  80. package/dist/okf/rules/GRAF105.md +11 -0
  81. package/dist/okf/rules/GRAF106.md +11 -0
  82. package/dist/okf/rules/GRAF107.md +11 -0
  83. package/dist/okf/types/ConstantVariable.md +9 -0
  84. package/dist/okf/types/CustomVariable.md +9 -0
  85. package/dist/okf/types/Dashboard.md +14 -0
  86. package/dist/okf/types/DashboardProvider.md +9 -0
  87. package/dist/okf/types/Datasource.md +16 -0
  88. package/dist/okf/types/DatasourceVariable.md +9 -0
  89. package/dist/okf/types/GaugePanel.md +9 -0
  90. package/dist/okf/types/HeatmapPanel.md +9 -0
  91. package/dist/okf/types/IntervalVariable.md +9 -0
  92. package/dist/okf/types/LogsPanel.md +9 -0
  93. package/dist/okf/types/LokiQuery.md +9 -0
  94. package/dist/okf/types/PromQuery.md +9 -0
  95. package/dist/okf/types/QueryVariable.md +9 -0
  96. package/dist/okf/types/Row.md +9 -0
  97. package/dist/okf/types/StatPanel.md +9 -0
  98. package/dist/okf/types/TablePanel.md +9 -0
  99. package/dist/okf/types/TempoQuery.md +9 -0
  100. package/dist/okf/types/TextPanel.md +9 -0
  101. package/dist/okf/types/TextboxVariable.md +9 -0
  102. package/dist/okf/types/TimeSeriesPanel.md +9 -0
  103. package/dist/okf/types/TracesPanel.md +9 -0
  104. package/dist/package-cli.d.ts +3 -0
  105. package/dist/package-cli.d.ts.map +1 -0
  106. package/dist/panels.d.ts +138 -0
  107. package/dist/panels.d.ts.map +1 -0
  108. package/dist/pin.d.ts +32 -0
  109. package/dist/pin.d.ts.map +1 -0
  110. package/dist/plugin.d.ts +12 -0
  111. package/dist/plugin.d.ts.map +1 -0
  112. package/dist/query.d.ts +81 -0
  113. package/dist/query.d.ts.map +1 -0
  114. package/dist/rules/graf101.ts +17 -0
  115. package/dist/rules/graf102.ts +17 -0
  116. package/dist/rules/graf103.ts +17 -0
  117. package/dist/rules/graf104.ts +17 -0
  118. package/dist/rules/graf105.ts +17 -0
  119. package/dist/rules/graf106.ts +17 -0
  120. package/dist/rules/graf107.ts +17 -0
  121. package/dist/rules/grafana-ast.ts +70 -0
  122. package/dist/rules/grafana-helpers.ts +68 -0
  123. package/dist/rules/literal-secret.ts +48 -0
  124. package/dist/rules/uid-syntax.ts +56 -0
  125. package/dist/schema/dashboard.gen.d.ts +1231 -0
  126. package/dist/schema/dashboard.gen.d.ts.map +1 -0
  127. package/dist/schema/gauge.gen.d.ts +57 -0
  128. package/dist/schema/gauge.gen.d.ts.map +1 -0
  129. package/dist/schema/heatmap.gen.d.ts +295 -0
  130. package/dist/schema/heatmap.gen.d.ts.map +1 -0
  131. package/dist/schema/index.d.ts +18 -0
  132. package/dist/schema/index.d.ts.map +1 -0
  133. package/dist/schema/logs.gen.d.ts +29 -0
  134. package/dist/schema/logs.gen.d.ts.map +1 -0
  135. package/dist/schema/loki.gen.d.ts +69 -0
  136. package/dist/schema/loki.gen.d.ts.map +1 -0
  137. package/dist/schema/prometheus.gen.d.ts +169 -0
  138. package/dist/schema/prometheus.gen.d.ts.map +1 -0
  139. package/dist/schema/stat.gen.d.ts +75 -0
  140. package/dist/schema/stat.gen.d.ts.map +1 -0
  141. package/dist/schema/table.gen.d.ts +295 -0
  142. package/dist/schema/table.gen.d.ts.map +1 -0
  143. package/dist/schema/tempo.gen.d.ts +136 -0
  144. package/dist/schema/tempo.gen.d.ts.map +1 -0
  145. package/dist/schema/text.gen.d.ts +16 -0
  146. package/dist/schema/text.gen.d.ts.map +1 -0
  147. package/dist/schema/timeseries.gen.d.ts +179 -0
  148. package/dist/schema/timeseries.gen.d.ts.map +1 -0
  149. package/dist/schema-validate.d.ts +20 -0
  150. package/dist/schema-validate.d.ts.map +1 -0
  151. package/dist/serializer.d.ts +22 -0
  152. package/dist/serializer.d.ts.map +1 -0
  153. package/dist/skill-defs.d.ts +3 -0
  154. package/dist/skill-defs.d.ts.map +1 -0
  155. package/dist/skills/chant-grafana-provisioning.md +42 -0
  156. package/dist/skills/chant-grafana.md +93 -0
  157. package/dist/spec/fetch-cli.d.ts +3 -0
  158. package/dist/spec/fetch-cli.d.ts.map +1 -0
  159. package/dist/spec/schemas.d.ts +25 -0
  160. package/dist/spec/schemas.d.ts.map +1 -0
  161. package/dist/types/index.d.ts +3 -0
  162. package/dist/util.d.ts +17 -0
  163. package/dist/util.d.ts.map +1 -0
  164. package/dist/validate-cli.d.ts +3 -0
  165. package/dist/validate-cli.d.ts.map +1 -0
  166. package/dist/validate-output.d.ts +42 -0
  167. package/dist/validate-output.d.ts.map +1 -0
  168. package/dist/validate.d.ts +12 -0
  169. package/dist/validate.d.ts.map +1 -0
  170. package/dist/variables.d.ts +100 -0
  171. package/dist/variables.d.ts.map +1 -0
  172. package/package.json +79 -0
  173. package/src/build.test.ts +210 -0
  174. package/src/build.ts +573 -0
  175. package/src/catalog.ts +116 -0
  176. package/src/codegen/docs-cli.ts +4 -0
  177. package/src/codegen/docs.ts +97 -0
  178. package/src/codegen/generate-cli.ts +8 -0
  179. package/src/codegen/generate.ts +83 -0
  180. package/src/codegen/package.ts +41 -0
  181. package/src/codegen/schema-types.ts +173 -0
  182. package/src/composites/agent-dashboard.ts +235 -0
  183. package/src/composites/catalog.test.ts +37 -0
  184. package/src/composites/catalog.ts +223 -0
  185. package/src/composites/composites.test.ts +314 -0
  186. package/src/composites/index.ts +12 -0
  187. package/src/composites/red-dashboard.ts +159 -0
  188. package/src/composites/shared.ts +94 -0
  189. package/src/composites/slo-dashboard.ts +177 -0
  190. package/src/dashboard.ts +123 -0
  191. package/src/datasource.ts +93 -0
  192. package/src/detect.ts +30 -0
  193. package/src/generated/lexicon-grafana.json +107 -0
  194. package/src/import.e2e.test.ts +147 -0
  195. package/src/import.test.ts +45 -0
  196. package/src/index.ts +178 -0
  197. package/src/lint/audit-catalog.ts +87 -0
  198. package/src/lint/post-synth/graf101.ts +17 -0
  199. package/src/lint/post-synth/graf102.ts +17 -0
  200. package/src/lint/post-synth/graf103.ts +17 -0
  201. package/src/lint/post-synth/graf104.ts +17 -0
  202. package/src/lint/post-synth/graf105.ts +17 -0
  203. package/src/lint/post-synth/graf106.ts +17 -0
  204. package/src/lint/post-synth/graf107.ts +17 -0
  205. package/src/lint/post-synth/grafana-helpers.ts +68 -0
  206. package/src/lint/post-synth/index.ts +19 -0
  207. package/src/lint/post-synth/post-synth.test.ts +231 -0
  208. package/src/lint/rules/grafana-ast.ts +70 -0
  209. package/src/lint/rules/index.ts +9 -0
  210. package/src/lint/rules/literal-secret.ts +48 -0
  211. package/src/lint/rules/rules.test.ts +70 -0
  212. package/src/lint/rules/uid-syntax.ts +56 -0
  213. package/src/lsp/completions.test.ts +31 -0
  214. package/src/lsp/completions.ts +15 -0
  215. package/src/lsp/hover.test.ts +25 -0
  216. package/src/lsp/hover.ts +28 -0
  217. package/src/package-cli.ts +17 -0
  218. package/src/panels.ts +275 -0
  219. package/src/pin.ts +68 -0
  220. package/src/plugin.test.ts +50 -0
  221. package/src/plugin.ts +116 -0
  222. package/src/query.ts +160 -0
  223. package/src/schema/dashboard.gen.ts +1289 -0
  224. package/src/schema/gauge.gen.ts +64 -0
  225. package/src/schema/heatmap.gen.ts +321 -0
  226. package/src/schema/index.ts +17 -0
  227. package/src/schema/logs.gen.ts +34 -0
  228. package/src/schema/loki.gen.ts +77 -0
  229. package/src/schema/prometheus.gen.ts +181 -0
  230. package/src/schema/stat.gen.ts +86 -0
  231. package/src/schema/table.gen.ts +334 -0
  232. package/src/schema/tempo.gen.ts +146 -0
  233. package/src/schema/text.gen.ts +22 -0
  234. package/src/schema/timeseries.gen.ts +208 -0
  235. package/src/schema-validate.ts +143 -0
  236. package/src/schema.test.ts +76 -0
  237. package/src/serializer.test.ts +170 -0
  238. package/src/serializer.ts +37 -0
  239. package/src/skill-defs.ts +31 -0
  240. package/src/skills/chant-grafana-provisioning.md +42 -0
  241. package/src/skills/chant-grafana.md +93 -0
  242. package/src/spec/fetch-cli.ts +27 -0
  243. package/src/spec/schemas/dashboard.jsonschema.json +1901 -0
  244. package/src/spec/schemas/gauge.jsonschema.json +114 -0
  245. package/src/spec/schemas/heatmap.jsonschema.json +480 -0
  246. package/src/spec/schemas/logs.jsonschema.json +94 -0
  247. package/src/spec/schemas/loki.jsonschema.json +118 -0
  248. package/src/spec/schemas/prometheus.jsonschema.json +276 -0
  249. package/src/spec/schemas/stat.jsonschema.json +163 -0
  250. package/src/spec/schemas/table.jsonschema.json +751 -0
  251. package/src/spec/schemas/tempo.jsonschema.json +225 -0
  252. package/src/spec/schemas/text.jsonschema.json +72 -0
  253. package/src/spec/schemas/timeseries.jsonschema.json +471 -0
  254. package/src/spec/schemas.ts +56 -0
  255. package/src/util.ts +43 -0
  256. package/src/validate-cli.ts +7 -0
  257. package/src/validate-output.ts +380 -0
  258. package/src/validate.ts +108 -0
  259. package/src/variables.ts +161 -0
@@ -0,0 +1,1289 @@
1
+ // Code generated by chant generate from the vendored Grafana schema
2
+ // src/spec/schemas/dashboard.jsonschema.json (see src/pin.ts). DO NOT EDIT.
3
+ /* eslint-disable */
4
+
5
+ export interface AnnotationActions {
6
+ canAdd?: boolean;
7
+ canDelete?: boolean;
8
+ canEdit?: boolean;
9
+ }
10
+
11
+ export interface AnnotationPermission {
12
+ dashboard?: AnnotationActions;
13
+ organization?: AnnotationActions;
14
+ }
15
+
16
+ export interface DashboardMeta {
17
+ annotationsPermissions?: AnnotationPermission;
18
+ apiVersion?: string;
19
+ canAdmin?: boolean;
20
+ canDelete?: boolean;
21
+ canEdit?: boolean;
22
+ canSave?: boolean;
23
+ canStar?: boolean;
24
+ created?: string;
25
+ createdBy?: string;
26
+ expires?: string;
27
+ /**
28
+ * Deprecated: use FolderUID instead
29
+ */
30
+ folderId?: number;
31
+ folderTitle?: string;
32
+ folderUid?: string;
33
+ folderUrl?: string;
34
+ hasAcl?: boolean;
35
+ isFolder?: boolean;
36
+ isSnapshot?: boolean;
37
+ isStarred?: boolean;
38
+ provisioned?: boolean;
39
+ provisionedExternalId?: string;
40
+ publicDashboardEnabled?: boolean;
41
+ slug?: string;
42
+ type?: string;
43
+ updated?: string;
44
+ updatedBy?: string;
45
+ url?: string;
46
+ version?: number;
47
+ }
48
+
49
+ /**
50
+ * @deprecated Prefer using dashboardv2.Dashboard instead.
51
+ */
52
+ export interface Dashboard {
53
+ /**
54
+ * Unique numeric identifier for the dashboard.
55
+ * `id` is internal to a specific Grafana instance. `uid` should be used to identify a dashboard across Grafana instances.
56
+ * TODO eliminate this null option
57
+ */
58
+ id?: number | null;
59
+ /**
60
+ * Unique dashboard identifier that can be generated by anyone. string (8-40)
61
+ */
62
+ uid?: string;
63
+ /**
64
+ * Title of dashboard.
65
+ */
66
+ title?: string;
67
+ /**
68
+ * Description of dashboard.
69
+ */
70
+ description?: string;
71
+ /**
72
+ * This property should only be used in dashboards defined by plugins. It is a quick check
73
+ * to see if the version has changed since the last time.
74
+ */
75
+ revision?: number;
76
+ /**
77
+ * ID of a dashboard imported from the https://grafana.com/grafana/dashboards/ portal
78
+ */
79
+ gnetId?: string;
80
+ /**
81
+ * Tags associated with dashboard.
82
+ */
83
+ tags?: string[];
84
+ /**
85
+ * Timezone of dashboard. Accepted values are IANA TZDB zone ID or "browser" or "utc".
86
+ */
87
+ timezone?: string;
88
+ /**
89
+ * Whether a dashboard is editable or not.
90
+ */
91
+ editable?: boolean;
92
+ /**
93
+ * Configuration of dashboard cursor sync behavior.
94
+ * Accepted values are 0 (sync turned off), 1 (shared crosshair), 2 (shared crosshair and tooltip).
95
+ */
96
+ graphTooltip?: DashboardCursorSync;
97
+ /**
98
+ * Time range for dashboard.
99
+ * Accepted values are relative time strings like {from: 'now-6h', to: 'now'} or absolute time strings like {from: '2020-07-10T08:00:00.000Z', to: '2020-07-10T14:00:00.000Z'}.
100
+ */
101
+ time?: {
102
+ from: string;
103
+ to: string;
104
+ };
105
+ /**
106
+ * Configuration of the time picker shown at the top of a dashboard.
107
+ */
108
+ timepicker?: TimePickerConfig;
109
+ /**
110
+ * The month that the fiscal year starts on. 0 = January, 11 = December
111
+ */
112
+ fiscalYearStartMonth?: number;
113
+ /**
114
+ * When set to true, the dashboard will redraw panels at an interval matching the pixel width.
115
+ * This will keep data "moving left" regardless of the query refresh rate. This setting helps
116
+ * avoid dashboards presenting stale live data
117
+ */
118
+ liveNow?: boolean;
119
+ /**
120
+ * Day when the week starts. Expressed by the name of the day in lowercase, e.g. "monday".
121
+ */
122
+ weekStart?: string;
123
+ /**
124
+ * Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d".
125
+ */
126
+ refresh?: string;
127
+ /**
128
+ * Version of the JSON schema, incremented each time a Grafana update brings
129
+ * changes to said schema.
130
+ */
131
+ schemaVersion: number;
132
+ /**
133
+ * Version of the dashboard, incremented each time the dashboard is updated.
134
+ */
135
+ version?: number;
136
+ /**
137
+ * List of dashboard panels
138
+ */
139
+ panels?: (Panel | RowPanel)[];
140
+ /**
141
+ * Configured template variables
142
+ */
143
+ templating: {
144
+ /**
145
+ * List of configured template variables with their saved values along with some other metadata
146
+ */
147
+ list?: VariableModel[];
148
+ };
149
+ /**
150
+ * Contains the list of annotations that are associated with the dashboard.
151
+ * Annotations are used to overlay event markers and overlay event tags on graphs.
152
+ * Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API.
153
+ * See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/
154
+ */
155
+ annotations: AnnotationContainer;
156
+ /**
157
+ * Links with references to other dashboards or external websites.
158
+ */
159
+ links?: DashboardLink[];
160
+ /**
161
+ * Snapshot options. They are present only if the dashboard is a snapshot.
162
+ */
163
+ snapshot?: Snapshot;
164
+ /**
165
+ * When set to true, the dashboard will load all panels in the dashboard when it's loaded.
166
+ */
167
+ preload?: boolean;
168
+ }
169
+
170
+ /**
171
+ * 0 for no shared crosshair or tooltip (default).
172
+ * 1 for shared crosshair.
173
+ * 2 for shared crosshair AND shared tooltip.
174
+ */
175
+ export type DashboardCursorSync = 0 | 1 | 2;
176
+
177
+ /**
178
+ * Time picker configuration
179
+ * It defines the default config for the time picker and the refresh picker for the specific dashboard.
180
+ */
181
+ export interface TimePickerConfig {
182
+ /**
183
+ * Whether timepicker is visible or not.
184
+ */
185
+ hidden?: boolean;
186
+ /**
187
+ * Interval options available in the refresh picker dropdown.
188
+ */
189
+ refresh_intervals?: string[];
190
+ /**
191
+ * Quick ranges for time picker.
192
+ */
193
+ quick_ranges?: TimeOption[];
194
+ /**
195
+ * Override the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.
196
+ */
197
+ nowDelay?: string;
198
+ }
199
+
200
+ /**
201
+ * Counterpart for TypeScript's TimeOption type.
202
+ */
203
+ export interface TimeOption {
204
+ display: string;
205
+ from: string;
206
+ to: string;
207
+ }
208
+
209
+ /**
210
+ * Dashboard panels are the basic visualization building blocks.
211
+ */
212
+ export interface Panel {
213
+ /**
214
+ * The panel plugin type id. This is used to find the plugin to display the panel.
215
+ */
216
+ type: string;
217
+ /**
218
+ * Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.
219
+ */
220
+ id?: number;
221
+ /**
222
+ * The version of the plugin that is used for this panel. This is used to find the plugin to display the panel and to migrate old panel configs.
223
+ */
224
+ pluginVersion?: string;
225
+ /**
226
+ * Depends on the panel plugin. See the plugin documentation for details.
227
+ */
228
+ targets?: Record<string, unknown>[];
229
+ /**
230
+ * Panel title.
231
+ */
232
+ title?: string;
233
+ /**
234
+ * Panel description.
235
+ */
236
+ description?: string;
237
+ /**
238
+ * Whether to display the panel without a background.
239
+ */
240
+ transparent?: boolean;
241
+ /**
242
+ * The datasource used in all targets.
243
+ */
244
+ datasource?: DataSourceRef;
245
+ /**
246
+ * Grid position.
247
+ */
248
+ gridPos?: GridPos;
249
+ /**
250
+ * Panel links.
251
+ */
252
+ links?: DashboardLink[];
253
+ /**
254
+ * Name of template variable to repeat for.
255
+ */
256
+ repeat?: string;
257
+ /**
258
+ * Direction to repeat in if 'repeat' is set.
259
+ * `h` for horizontal, `v` for vertical.
260
+ */
261
+ repeatDirection?: "h" | "v";
262
+ /**
263
+ * Option for repeated panels that controls max items per row
264
+ * Only relevant for horizontally repeated panels
265
+ */
266
+ maxPerRow?: number;
267
+ /**
268
+ * The maximum number of data points that the panel queries are retrieving.
269
+ */
270
+ maxDataPoints?: number;
271
+ /**
272
+ * List of transformations that are applied to the panel data before rendering.
273
+ * When there are multiple transformations, Grafana applies them in the order they are listed.
274
+ * Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.
275
+ */
276
+ transformations?: DataTransformerConfig[];
277
+ /**
278
+ * The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables.
279
+ * This value must be formatted as a number followed by a valid time
280
+ * identifier like: "40s", "3d", etc.
281
+ * See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
282
+ */
283
+ interval?: string;
284
+ /**
285
+ * Overrides the relative time range for individual panels,
286
+ * which causes them to be different than what is selected in
287
+ * the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different
288
+ * time periods or days on the same dashboard.
289
+ * The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far),
290
+ * `now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years).
291
+ * Note: Panel time overrides have no effect when the dashboard’s time range is absolute.
292
+ * See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
293
+ */
294
+ timeFrom?: string;
295
+ /**
296
+ * Overrides the time range for individual panels by shifting its start and end relative to the time picker.
297
+ * For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`.
298
+ * Note: Panel time overrides have no effect when the dashboard’s time range is absolute.
299
+ * See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options
300
+ */
301
+ timeShift?: string;
302
+ /**
303
+ * Controls if the timeFrom or timeShift overrides are shown in the panel header
304
+ */
305
+ hideTimeOverride?: boolean;
306
+ /**
307
+ * Compare the current time range with a previous period
308
+ * For example "1d" to compare current period but shifted back 1 day
309
+ */
310
+ timeCompare?: string;
311
+ /**
312
+ * Dynamically load the panel
313
+ */
314
+ libraryPanel?: LibraryPanelRef;
315
+ /**
316
+ * Sets panel queries cache timeout.
317
+ */
318
+ cacheTimeout?: string;
319
+ /**
320
+ * Overrides the data source configured time-to-live for a query cache item in milliseconds
321
+ */
322
+ queryCachingTTL?: number;
323
+ /**
324
+ * It depends on the panel plugin. They are specified by the Options field in panel plugin schemas.
325
+ */
326
+ options?: Record<string, unknown>;
327
+ /**
328
+ * Field options allow you to change how the data is displayed in your visualizations.
329
+ */
330
+ fieldConfig?: FieldConfigSource;
331
+ }
332
+
333
+ export interface DataSourceRef {
334
+ /**
335
+ * The plugin type-id
336
+ */
337
+ type?: string;
338
+ /**
339
+ * Specific datasource instance
340
+ */
341
+ uid?: string;
342
+ }
343
+
344
+ /**
345
+ * Position and dimensions of a panel in the grid
346
+ */
347
+ export interface GridPos {
348
+ /**
349
+ * Panel height. The height is the number of rows from the top edge of the panel.
350
+ */
351
+ h: number;
352
+ /**
353
+ * Panel width. The width is the number of columns from the left edge of the panel.
354
+ */
355
+ w: number;
356
+ /**
357
+ * Panel x. The x coordinate is the number of columns from the left edge of the grid
358
+ */
359
+ x: number;
360
+ /**
361
+ * Panel y. The y coordinate is the number of rows from the top edge of the grid
362
+ */
363
+ y: number;
364
+ /**
365
+ * Whether the panel is fixed within the grid. If true, the panel will not be affected by other panels' interactions
366
+ */
367
+ static?: boolean;
368
+ }
369
+
370
+ /**
371
+ * Links with references to other dashboards or external resources
372
+ */
373
+ export interface DashboardLink {
374
+ /**
375
+ * Title to display with the link
376
+ */
377
+ title: string;
378
+ /**
379
+ * Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)
380
+ */
381
+ type: DashboardLinkType;
382
+ /**
383
+ * Icon name to be displayed with the link
384
+ */
385
+ icon: string;
386
+ /**
387
+ * Tooltip to display when the user hovers their mouse over it
388
+ */
389
+ tooltip: string;
390
+ /**
391
+ * Link URL. Only required/valid if the type is link
392
+ */
393
+ url?: string;
394
+ /**
395
+ * List of tags to limit the linked dashboards. If empty, all dashboards will be displayed. Only valid if the type is dashboards
396
+ */
397
+ tags: string[];
398
+ /**
399
+ * If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards
400
+ */
401
+ asDropdown: boolean;
402
+ /**
403
+ * Placement can be used to display the link somewhere else on the dashboard other than above the visualisations.
404
+ */
405
+ placement?: DashboardLinkPlacement;
406
+ /**
407
+ * If true, the link will be opened in a new tab
408
+ */
409
+ targetBlank: boolean;
410
+ /**
411
+ * If true, includes current template variables values in the link as query params
412
+ */
413
+ includeVars: boolean;
414
+ /**
415
+ * If true, includes current time range in the link as query params
416
+ */
417
+ keepTime: boolean;
418
+ }
419
+
420
+ /**
421
+ * Dashboard Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource)
422
+ */
423
+ export type DashboardLinkType = "link" | "dashboards";
424
+
425
+ /**
426
+ * Dashboard Link placement. Defines where the link should be displayed.
427
+ * - "inControlsMenu" renders the link in bottom part of the dashboard controls dropdown menu
428
+ */
429
+ export type DashboardLinkPlacement = "inControlsMenu";
430
+
431
+ /**
432
+ * Transformations allow to manipulate data returned by a query before the system applies a visualization.
433
+ * Using transformations you can: rename fields, join time series data, perform mathematical operations across queries,
434
+ * use the output of one transformation as the input to another transformation, etc.
435
+ */
436
+ export interface DataTransformerConfig {
437
+ /**
438
+ * Unique identifier of transformer
439
+ */
440
+ id: string;
441
+ /**
442
+ * Disabled transformations are skipped
443
+ */
444
+ disabled?: boolean;
445
+ /**
446
+ * Optional frame matcher. When missing it will be applied to all results
447
+ */
448
+ filter?: MatcherConfig;
449
+ /**
450
+ * Where to pull DataFrames from as input to transformation
451
+ * replaced with common.DataTopic
452
+ */
453
+ topic?: "series" | "annotations" | "alertStates";
454
+ /**
455
+ * Options to be passed to the transformer
456
+ * Valid options depend on the transformer id
457
+ */
458
+ options: Record<string, unknown>;
459
+ }
460
+
461
+ /**
462
+ * Matcher is a predicate configuration. Based on the config a set of field(s) or values is filtered in order to apply override / transformation.
463
+ * It comes with in id ( to resolve implementation from registry) and a configuration that’s specific to a particular matcher type.
464
+ */
465
+ export interface MatcherConfig {
466
+ /**
467
+ * The matcher id. This is used to find the matcher implementation from registry.
468
+ */
469
+ id: string;
470
+ /**
471
+ * The matcher options. This is specific to the matcher implementation.
472
+ */
473
+ options?: Record<string, unknown>;
474
+ }
475
+
476
+ /**
477
+ * A library panel is a reusable panel that you can use in any dashboard.
478
+ * When you make a change to a library panel, that change propagates to all instances of where the panel is used.
479
+ * Library panels streamline reuse of panels across multiple dashboards.
480
+ */
481
+ export interface LibraryPanelRef {
482
+ /**
483
+ * Library panel name
484
+ */
485
+ name: string;
486
+ /**
487
+ * Library panel uid
488
+ */
489
+ uid: string;
490
+ }
491
+
492
+ /**
493
+ * The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.
494
+ * Each column within this structure is called a field. A field can represent a single time series or table column.
495
+ * Field options allow you to change how the data is displayed in your visualizations.
496
+ */
497
+ export interface FieldConfigSource {
498
+ /**
499
+ * Defaults are the options applied to all fields.
500
+ */
501
+ defaults: FieldConfig;
502
+ /**
503
+ * Overrides are the options applied to specific fields overriding the defaults.
504
+ */
505
+ overrides: {
506
+ __systemRef?: string;
507
+ matcher: MatcherConfig;
508
+ properties: DynamicConfigValue[];
509
+ }[];
510
+ }
511
+
512
+ /**
513
+ * The data model used in Grafana, namely the data frame, is a columnar-oriented table structure that unifies both time series and table query results.
514
+ * Each column within this structure is called a field. A field can represent a single time series or table column.
515
+ * Field options allow you to change how the data is displayed in your visualizations.
516
+ */
517
+ export interface FieldConfig {
518
+ /**
519
+ * The display value for this field. This supports template variables blank is auto
520
+ */
521
+ displayName?: string;
522
+ /**
523
+ * This can be used by data sources that return and explicit naming structure for values and labels
524
+ * When this property is configured, this value is used rather than the default naming strategy.
525
+ */
526
+ displayNameFromDS?: string;
527
+ /**
528
+ * Human readable field metadata
529
+ */
530
+ description?: string;
531
+ /**
532
+ * An explicit path to the field in the datasource. When the frame meta includes a path,
533
+ * This will default to `${frame.meta.path}/${field.name}
534
+ *
535
+ * When defined, this value can be used as an identifier within the datasource scope, and
536
+ * may be used to update the results
537
+ */
538
+ path?: string;
539
+ /**
540
+ * True if data source can write a value to the path. Auth/authz are supported separately
541
+ */
542
+ writeable?: boolean;
543
+ /**
544
+ * True if data source field supports ad-hoc filters
545
+ */
546
+ filterable?: boolean;
547
+ /**
548
+ * Unit a field should use. The unit you select is applied to all fields except time.
549
+ * You can use the units ID availables in Grafana or a custom unit.
550
+ * Available units in Grafana: https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/valueFormats/categories.ts
551
+ * As custom unit, you can use the following formats:
552
+ * `suffix:<suffix>` for custom unit that should go after value.
553
+ * `prefix:<prefix>` for custom unit that should go before value.
554
+ * `time:<format>` For custom date time formats type for example `time:YYYY-MM-DD`.
555
+ * `si:<base scale><unit characters>` for custom SI units. For example: `si: mF`. This one is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character.
556
+ * `count:<unit>` for a custom count unit.
557
+ * `currency:<unit>` for custom a currency unit.
558
+ */
559
+ unit?: string;
560
+ /**
561
+ * Specify the number of decimals Grafana includes in the rendered value.
562
+ * If you leave this field blank, Grafana automatically truncates the number of decimals based on the value.
563
+ * For example 1.1234 will display as 1.12 and 100.456 will display as 100.
564
+ * To display all decimals, set the unit to `String`.
565
+ */
566
+ decimals?: number;
567
+ /**
568
+ * The minimum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.
569
+ */
570
+ min?: number;
571
+ /**
572
+ * The maximum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.
573
+ */
574
+ max?: number;
575
+ /**
576
+ * Convert input values into a display string
577
+ */
578
+ mappings?: ValueMapping[];
579
+ /**
580
+ * Map numeric values to states
581
+ */
582
+ thresholds?: ThresholdsConfig;
583
+ /**
584
+ * Panel color configuration
585
+ */
586
+ color?: FieldColor;
587
+ /**
588
+ * The behavior when clicking on a result
589
+ */
590
+ links?: DashboardLink[];
591
+ /**
592
+ * Define interactive HTTP requests that can be triggered from data visualizations.
593
+ */
594
+ actions?: Action[];
595
+ /**
596
+ * Alternative to empty string
597
+ */
598
+ noValue?: string;
599
+ /**
600
+ * custom is specified by the FieldConfig field
601
+ * in panel plugin schemas.
602
+ */
603
+ custom?: Record<string, unknown>;
604
+ fieldMinMax?: boolean;
605
+ }
606
+
607
+ /**
608
+ * Allow to transform the visual representation of specific data values in a visualization, irrespective of their original units
609
+ */
610
+ export type ValueMapping = ValueMap | RangeMap | RegexMap | SpecialValueMap;
611
+
612
+ /**
613
+ * Maps text values to a color or different display text and color.
614
+ * For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
615
+ */
616
+ export interface ValueMap {
617
+ type: MappingType;
618
+ /**
619
+ * Map with <value_to_match>: ValueMappingResult. For example: { "10": { text: "Perfection!", color: "green" } }
620
+ */
621
+ options: Record<string, ValueMappingResult>;
622
+ }
623
+
624
+ /**
625
+ * Supported value mapping types
626
+ * `value`: Maps text values to a color or different display text and color. For example, you can configure a value mapping so that all instances of the value 10 appear as Perfection! rather than the number.
627
+ * `range`: Maps numerical ranges to a display text and color. For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
628
+ * `regex`: Maps regular expressions to replacement text and a color. For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
629
+ * `special`: Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color. See SpecialValueMatch to see the list of special values. For example, you can configure a special value mapping so that null values appear as N/A.
630
+ */
631
+ export type MappingType = "value" | "range" | "regex" | "special";
632
+
633
+ /**
634
+ * Result used as replacement with text and color when the value matches
635
+ */
636
+ export interface ValueMappingResult {
637
+ /**
638
+ * Text to display when the value matches
639
+ */
640
+ text?: string;
641
+ /**
642
+ * Text to use when the value matches
643
+ */
644
+ color?: string;
645
+ /**
646
+ * Icon to display when the value matches. Only specific visualizations.
647
+ */
648
+ icon?: string;
649
+ /**
650
+ * Position in the mapping array. Only used internally.
651
+ */
652
+ index?: number;
653
+ }
654
+
655
+ /**
656
+ * Maps numerical ranges to a display text and color.
657
+ * For example, if a value is within a certain range, you can configure a range value mapping to display Low or High rather than the number.
658
+ */
659
+ export interface RangeMap {
660
+ type: MappingType;
661
+ /**
662
+ * Range to match against and the result to apply when the value is within the range
663
+ */
664
+ options: {
665
+ /**
666
+ * Min value of the range. It can be null which means -Infinity
667
+ */
668
+ from: number | null;
669
+ /**
670
+ * Max value of the range. It can be null which means +Infinity
671
+ */
672
+ to: number | null;
673
+ /**
674
+ * Config to apply when the value is within the range
675
+ */
676
+ result: ValueMappingResult;
677
+ };
678
+ }
679
+
680
+ /**
681
+ * Maps regular expressions to replacement text and a color.
682
+ * For example, if a value is www.example.com, you can configure a regex value mapping so that Grafana displays www and truncates the domain.
683
+ */
684
+ export interface RegexMap {
685
+ type: MappingType;
686
+ /**
687
+ * Regular expression to match against and the result to apply when the value matches the regex
688
+ */
689
+ options: {
690
+ /**
691
+ * Regular expression to match against
692
+ */
693
+ pattern: string;
694
+ /**
695
+ * Config to apply when the value matches the regex
696
+ */
697
+ result: ValueMappingResult;
698
+ };
699
+ }
700
+
701
+ /**
702
+ * Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text and color.
703
+ * See SpecialValueMatch to see the list of special values.
704
+ * For example, you can configure a special value mapping so that null values appear as N/A.
705
+ */
706
+ export interface SpecialValueMap {
707
+ type: MappingType;
708
+ options: {
709
+ /**
710
+ * Special value to match against
711
+ */
712
+ match: SpecialValueMatch;
713
+ /**
714
+ * Config to apply when the value matches the special value
715
+ */
716
+ result: ValueMappingResult;
717
+ };
718
+ }
719
+
720
+ /**
721
+ * Special value types supported by the `SpecialValueMap`
722
+ */
723
+ export type SpecialValueMatch = "true" | "false" | "null" | "nan" | "null+nan" | "empty";
724
+
725
+ /**
726
+ * Thresholds configuration for the panel
727
+ */
728
+ export interface ThresholdsConfig {
729
+ /**
730
+ * Thresholds mode.
731
+ */
732
+ mode: ThresholdsMode;
733
+ /**
734
+ * Must be sorted by 'value', first value is always -Infinity
735
+ */
736
+ steps: Threshold[];
737
+ }
738
+
739
+ /**
740
+ * Thresholds can either be `absolute` (specific number) or `percentage` (relative to min or max, it will be values between 0 and 1).
741
+ */
742
+ export type ThresholdsMode = "absolute" | "percentage";
743
+
744
+ /**
745
+ * User-defined value for a metric that triggers visual changes in a panel when this value is met or exceeded
746
+ * They are used to conditionally style and color visualizations based on query results , and can be applied to most visualizations.
747
+ */
748
+ export interface Threshold {
749
+ /**
750
+ * Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded.
751
+ * Nulls currently appear here when serializing -Infinity to JSON.
752
+ */
753
+ value: number | null;
754
+ /**
755
+ * Color represents the color of the visual change that will occur in the dashboard when the threshold value is met or exceeded.
756
+ */
757
+ color: string;
758
+ }
759
+
760
+ /**
761
+ * Map a field to a color.
762
+ */
763
+ export interface FieldColor {
764
+ /**
765
+ * The main color scheme mode.
766
+ */
767
+ mode: FieldColorModeId;
768
+ /**
769
+ * The fixed color value for fixed or shades color modes.
770
+ */
771
+ fixedColor?: string;
772
+ /**
773
+ * Some visualizations need to know how to assign a series color from by value color schemes.
774
+ */
775
+ seriesBy?: FieldColorSeriesByMode;
776
+ }
777
+
778
+ /**
779
+ * Color mode for a field. You can specify a single color, or select a continuous (gradient) color schemes, based on a value.
780
+ * Continuous color interpolates a color using the percentage of a value relative to min and max.
781
+ * Accepted values are:
782
+ * `thresholds`: From thresholds. Informs Grafana to take the color from the matching threshold
783
+ * `palette-classic`: Classic palette. Grafana will assign color by looking up a color in a palette by series index. Useful for Graphs and pie charts and other categorical data visualizations
784
+ * `palette-classic-by-name`: Classic palette (by name). Grafana will assign color by looking up a color in a palette by series name. Useful for Graphs and pie charts and other categorical data visualizations
785
+ * `continuous-GrYlRd`: ontinuous Green-Yellow-Red palette mode
786
+ * `continuous-RdYlGr`: Continuous Red-Yellow-Green palette mode
787
+ * `continuous-BlYlRd`: Continuous Blue-Yellow-Red palette mode
788
+ * `continuous-YlRd`: Continuous Yellow-Red palette mode
789
+ * `continuous-BlPu`: Continuous Blue-Purple palette mode
790
+ * `continuous-YlBl`: Continuous Yellow-Blue palette mode
791
+ * `continuous-blues`: Continuous Blue palette mode
792
+ * `continuous-reds`: Continuous Red palette mode
793
+ * `continuous-greens`: Continuous Green palette mode
794
+ * `continuous-purples`: Continuous Purple palette mode
795
+ * `shades`: Shades of a single color. Specify a single color, useful in an override rule.
796
+ * `fixed`: Fixed color mode. Specify a single color, useful in an override rule.
797
+ */
798
+ export type FieldColorModeId = "thresholds" | "palette-classic" | "palette-classic-by-name" | "continuous-GrYlRd" | "continuous-RdYlGr" | "continuous-BlYlRd" | "continuous-YlRd" | "continuous-BlPu" | "continuous-YlBl" | "continuous-blues" | "continuous-reds" | "continuous-greens" | "continuous-purples" | "fixed" | "shades";
799
+
800
+ /**
801
+ * Defines how to assign a series color from "by value" color schemes. For example for an aggregated data points like a timeseries, the color can be assigned by the min, max or last value.
802
+ */
803
+ export type FieldColorSeriesByMode = "min" | "max" | "last";
804
+
805
+ /**
806
+ * Dashboard action
807
+ */
808
+ export interface Action {
809
+ type: ActionType;
810
+ title: string;
811
+ "fetch"?: FetchOptions;
812
+ infinity?: InfinityOptions;
813
+ confirmation?: string;
814
+ oneClick?: boolean;
815
+ variables?: ActionVariable[];
816
+ style?: {
817
+ backgroundColor?: string;
818
+ };
819
+ }
820
+
821
+ /**
822
+ * Dashboard action type
823
+ */
824
+ export type ActionType = "fetch" | "infinity";
825
+
826
+ /**
827
+ * Fetch options
828
+ */
829
+ export interface FetchOptions {
830
+ method: HttpRequestMethod;
831
+ url: string;
832
+ body?: string;
833
+ /**
834
+ * These are 2D arrays of strings, each representing a key-value pair
835
+ * We are defining this way because we can't generate a go struct that
836
+ * that would have exactly two strings in each sub-array
837
+ */
838
+ queryParams?: string[][];
839
+ headers?: string[][];
840
+ }
841
+
842
+ export type HttpRequestMethod = "GET" | "PUT" | "POST" | "DELETE" | "PATCH";
843
+
844
+ /**
845
+ * Infinity options
846
+ */
847
+ export interface InfinityOptions {
848
+ method: HttpRequestMethod;
849
+ url: string;
850
+ body?: string;
851
+ /**
852
+ * These are 2D arrays of strings, each representing a key-value pair
853
+ * We are defining them this way because we can't generate a go struct that
854
+ * that would have exactly two strings in each sub-array
855
+ */
856
+ queryParams?: string[][];
857
+ headers?: string[][];
858
+ datasourceUid: string;
859
+ }
860
+
861
+ export interface ActionVariable {
862
+ key: string;
863
+ name: string;
864
+ type: ActionVariableType;
865
+ }
866
+
867
+ /**
868
+ * Action variable type
869
+ */
870
+ export type ActionVariableType = "string";
871
+
872
+ export interface DynamicConfigValue {
873
+ id: string;
874
+ value?: Record<string, unknown>;
875
+ }
876
+
877
+ /**
878
+ * Row panel
879
+ */
880
+ export interface RowPanel {
881
+ /**
882
+ * The panel type
883
+ */
884
+ type: "row";
885
+ /**
886
+ * Whether this row should be collapsed or not.
887
+ */
888
+ collapsed: boolean;
889
+ /**
890
+ * Row title
891
+ */
892
+ title?: string;
893
+ /**
894
+ * Name of default datasource for the row
895
+ */
896
+ datasource?: DataSourceRef;
897
+ /**
898
+ * Row grid position
899
+ */
900
+ gridPos?: GridPos;
901
+ /**
902
+ * Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.
903
+ */
904
+ id: number;
905
+ /**
906
+ * List of panels in the row
907
+ */
908
+ panels: Panel[];
909
+ /**
910
+ * Name of template variable to repeat for.
911
+ */
912
+ repeat?: string;
913
+ }
914
+
915
+ /**
916
+ * A variable is a placeholder for a value. You can use variables in metric queries and in panel titles.
917
+ */
918
+ export interface VariableModel {
919
+ /**
920
+ * Type of variable
921
+ */
922
+ type: VariableType;
923
+ /**
924
+ * Name of variable
925
+ */
926
+ name: string;
927
+ /**
928
+ * Optional display name
929
+ */
930
+ label?: string;
931
+ /**
932
+ * Visibility configuration for the variable
933
+ */
934
+ hide?: VariableHide;
935
+ /**
936
+ * Whether the variable value should be managed by URL query params or not
937
+ */
938
+ skipUrlSync?: boolean;
939
+ /**
940
+ * Description of variable. It can be defined but `null`.
941
+ */
942
+ description?: string;
943
+ /**
944
+ * Query used to fetch values for a variable
945
+ */
946
+ query?: string | Record<string, Record<string, unknown>>;
947
+ /**
948
+ * Data source used to fetch values for a variable. It can be defined but `null`.
949
+ */
950
+ datasource?: DataSourceRef;
951
+ /**
952
+ * Shows current selected variable text/value on the dashboard
953
+ */
954
+ current?: VariableOption;
955
+ /**
956
+ * Whether multiple values can be selected or not from variable value list
957
+ */
958
+ multi?: boolean;
959
+ /**
960
+ * Allow custom values to be entered in the variable
961
+ */
962
+ allowCustomValue?: boolean;
963
+ /**
964
+ * Options that can be selected for a variable.
965
+ */
966
+ options?: VariableOption[];
967
+ /**
968
+ * Options to config when to refresh a variable
969
+ */
970
+ refresh?: VariableRefresh;
971
+ /**
972
+ * Options sort order
973
+ */
974
+ sort?: VariableSort;
975
+ /**
976
+ * Whether all value option is available or not
977
+ */
978
+ includeAll?: boolean;
979
+ /**
980
+ * Custom all value
981
+ */
982
+ allValue?: string;
983
+ /**
984
+ * Optional field, if you want to extract part of a series name or metric node segment.
985
+ * Named capture groups can be used to separate the display text and value.
986
+ */
987
+ regex?: string;
988
+ /**
989
+ * Additional static options for query variable
990
+ */
991
+ staticOptions?: VariableOption[];
992
+ /**
993
+ * Ordering of static options in relation to options returned from data source for query variable
994
+ */
995
+ staticOptionsOrder?: "before" | "after" | "sorted";
996
+ /**
997
+ * Dynamically calculates interval by dividing time range by the count specified.
998
+ */
999
+ auto?: boolean;
1000
+ /**
1001
+ * The minimum threshold below which the step count intervals will not divide the time.
1002
+ */
1003
+ auto_min?: string;
1004
+ /**
1005
+ * How many times the current time range should be divided to calculate the value, similar to the Max data points query option.
1006
+ * For example, if the current visible time range is 30 minutes, then the auto interval groups the data into 30 one-minute increments.
1007
+ */
1008
+ auto_count?: number;
1009
+ definition?: string;
1010
+ }
1011
+
1012
+ /**
1013
+ * Dashboard variable type
1014
+ * `query`: Query-generated list of values such as metric names, server names, sensor IDs, data centers, and so on.
1015
+ * `adhoc`: Key/value filters that are automatically added to all metric queries for a data source (Prometheus, Loki, InfluxDB, and Elasticsearch only).
1016
+ * `constant`: Define a hidden constant.
1017
+ * `datasource`: Quickly change the data source for an entire dashboard.
1018
+ * `interval`: Interval variables represent time spans.
1019
+ * `textbox`: Display a free text input field with an optional default value.
1020
+ * `custom`: Define the variable options manually using a comma-separated list.
1021
+ * `system`: Variables defined by Grafana. See: https://grafana.com/docs/grafana/latest/dashboards/variables/add-template-variables/#global-variables
1022
+ * `switch`: Boolean variables rendered as a switch
1023
+ */
1024
+ export type VariableType = "query" | "adhoc" | "groupby" | "constant" | "datasource" | "interval" | "textbox" | "custom" | "system" | "snapshot" | "switch";
1025
+
1026
+ /**
1027
+ * Determine if the variable shows on dashboard
1028
+ * Accepted values are 0 (show label and value), 1 (show value only), 2 (show nothing), 3 (show under the controls dropdown menu).
1029
+ */
1030
+ export type VariableHide = 0 | 1 | 2 | 3;
1031
+
1032
+ /**
1033
+ * Option to be selected in a variable.
1034
+ */
1035
+ export interface VariableOption {
1036
+ /**
1037
+ * Whether the option is selected or not
1038
+ */
1039
+ selected?: boolean;
1040
+ /**
1041
+ * Text to be displayed for the option
1042
+ */
1043
+ text: string | string[];
1044
+ /**
1045
+ * Value of the option
1046
+ */
1047
+ value: string | string[];
1048
+ }
1049
+
1050
+ /**
1051
+ * Options to config when to refresh a variable
1052
+ * `0`: Never refresh the variable
1053
+ * `1`: Queries the data source every time the dashboard loads.
1054
+ * `2`: Queries the data source when the dashboard time range changes.
1055
+ */
1056
+ export type VariableRefresh = 0 | 1 | 2;
1057
+
1058
+ /**
1059
+ * Sort variable options
1060
+ * Accepted values are:
1061
+ * `0`: No sorting
1062
+ * `1`: Alphabetical ASC
1063
+ * `2`: Alphabetical DESC
1064
+ * `3`: Numerical ASC
1065
+ * `4`: Numerical DESC
1066
+ * `5`: Alphabetical Case Insensitive ASC
1067
+ * `6`: Alphabetical Case Insensitive DESC
1068
+ * `7`: Natural ASC
1069
+ * `8`: Natural DESC
1070
+ */
1071
+ export type VariableSort = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
1072
+
1073
+ /**
1074
+ * Contains the list of annotations that are associated with the dashboard.
1075
+ * Annotations are used to overlay event markers and overlay event tags on graphs.
1076
+ * Grafana comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the HTTP API.
1077
+ * See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/
1078
+ */
1079
+ export interface AnnotationContainer {
1080
+ /**
1081
+ * List of annotations
1082
+ */
1083
+ list?: AnnotationQuery[];
1084
+ }
1085
+
1086
+ /**
1087
+ * TODO docs
1088
+ * FROM: AnnotationQuery in grafana-data/src/types/annotations.ts
1089
+ */
1090
+ export interface AnnotationQuery {
1091
+ /**
1092
+ * Name of annotation.
1093
+ */
1094
+ name: string;
1095
+ /**
1096
+ * Datasource where the annotations data is
1097
+ */
1098
+ datasource?: DataSourceRef;
1099
+ /**
1100
+ * When enabled the annotation query is issued with every dashboard refresh
1101
+ */
1102
+ enable: boolean;
1103
+ /**
1104
+ * Annotation queries can be toggled on or off at the top of the dashboard.
1105
+ * When hide is true, the toggle is not shown in the dashboard.
1106
+ */
1107
+ hide?: boolean;
1108
+ /**
1109
+ * Color to use for the annotation event markers
1110
+ */
1111
+ iconColor: string;
1112
+ /**
1113
+ * Filters to apply when fetching annotations
1114
+ */
1115
+ filter?: AnnotationPanelFilter;
1116
+ /**
1117
+ * TODO.. this should just be a normal query target
1118
+ */
1119
+ target?: Record<string, unknown>;
1120
+ /**
1121
+ * TODO -- this should not exist here, it is based on the --grafana-- datasource
1122
+ */
1123
+ type?: string;
1124
+ /**
1125
+ * Set to 1 for the standard annotation query all dashboards have by default.
1126
+ */
1127
+ builtIn?: number;
1128
+ /**
1129
+ * Placement can be used to display the annotation query somewhere else on the dashboard other than the default location.
1130
+ */
1131
+ placement?: AnnotationQueryPlacement;
1132
+ expr?: string;
1133
+ /**
1134
+ * Format for Prometheus annotation text. Label values can be interpolated with templates like {{instance}}.
1135
+ */
1136
+ textFormat?: string;
1137
+ /**
1138
+ * Format for Prometheus and Loki annotation titles. Label values can be interpolated with templates like {{instance}}.
1139
+ */
1140
+ titleFormat?: string;
1141
+ /**
1142
+ * Comma-separated label keys used as annotation tags.
1143
+ */
1144
+ tagKeys?: string;
1145
+ /**
1146
+ * Legacy Prometheus annotation query step interval.
1147
+ */
1148
+ step?: string;
1149
+ /**
1150
+ * Use the Prometheus series value as the annotation timestamp.
1151
+ */
1152
+ useValueForTime?: boolean;
1153
+ /**
1154
+ * Mappings define how to convert data frame fields to annotation event fields.
1155
+ */
1156
+ mappings?: Record<string, AnnotationEventFieldMapping>;
1157
+ }
1158
+
1159
+ export interface AnnotationPanelFilter {
1160
+ /**
1161
+ * Should the specified panels be included or excluded
1162
+ */
1163
+ exclude?: boolean;
1164
+ /**
1165
+ * Panel IDs that should be included or excluded
1166
+ */
1167
+ ids: number[];
1168
+ }
1169
+
1170
+ /**
1171
+ * TODO: this should be a regular DataQuery that depends on the selected dashboard
1172
+ * these match the properties of the "grafana" datasouce that is default in most dashboards
1173
+ */
1174
+ export interface AnnotationTarget {
1175
+ /**
1176
+ * Only required/valid for the grafana datasource...
1177
+ * but code+tests is already depending on it so hard to change
1178
+ */
1179
+ limit: number;
1180
+ /**
1181
+ * Only required/valid for the grafana datasource...
1182
+ * but code+tests is already depending on it so hard to change
1183
+ */
1184
+ matchAny: boolean;
1185
+ /**
1186
+ * Only required/valid for the grafana datasource...
1187
+ * but code+tests is already depending on it so hard to change
1188
+ */
1189
+ tags: string[];
1190
+ /**
1191
+ * Only required/valid for the grafana datasource...
1192
+ * but code+tests is already depending on it so hard to change
1193
+ */
1194
+ type: string;
1195
+ }
1196
+
1197
+ /**
1198
+ * Annotation Query placement. Defines where the annotation query should be displayed.
1199
+ * - "inControlsMenu" renders the annotation query in the dashboard controls dropdown menu
1200
+ */
1201
+ export type AnnotationQueryPlacement = "inControlsMenu";
1202
+
1203
+ /**
1204
+ * A dashboard snapshot shares an interactive dashboard publicly.
1205
+ * It is a read-only version of a dashboard, and is not editable.
1206
+ * It is possible to create a snapshot of a snapshot.
1207
+ * Grafana strips away all sensitive information from the dashboard.
1208
+ * Sensitive information stripped: queries (metric, template,annotation) and panel links.
1209
+ */
1210
+ export interface Snapshot {
1211
+ /**
1212
+ * Time when the snapshot was created
1213
+ */
1214
+ created: string;
1215
+ /**
1216
+ * Time when the snapshot expires, default is never to expire
1217
+ */
1218
+ expires: string;
1219
+ /**
1220
+ * Is the snapshot saved in an external grafana instance
1221
+ */
1222
+ external: boolean;
1223
+ /**
1224
+ * external url, if snapshot was shared in external grafana instance
1225
+ */
1226
+ externalUrl: string;
1227
+ /**
1228
+ * original url, url of the dashboard that was snapshotted
1229
+ */
1230
+ originalUrl: string;
1231
+ /**
1232
+ * Unique identifier of the snapshot
1233
+ */
1234
+ id: number;
1235
+ /**
1236
+ * Optional, defined the unique key of the snapshot, required if external is true
1237
+ */
1238
+ key: string;
1239
+ /**
1240
+ * Optional, name of the snapshot
1241
+ */
1242
+ name: string;
1243
+ /**
1244
+ * org id of the snapshot
1245
+ */
1246
+ orgId: number;
1247
+ /**
1248
+ * last time when the snapshot was updated
1249
+ */
1250
+ updated: string;
1251
+ /**
1252
+ * url of the snapshot, if snapshot was shared internally
1253
+ */
1254
+ url?: string;
1255
+ /**
1256
+ * user id of the snapshot creator
1257
+ */
1258
+ userId: number;
1259
+ dashboard?: Dashboard;
1260
+ }
1261
+
1262
+ /**
1263
+ * Annotation event field source. Defines how to obtain the value for an annotation event field.
1264
+ * - "field": Find the value with a matching key (default)
1265
+ * - "text": Write a constant string into the value
1266
+ * - "skip": Do not include the field
1267
+ */
1268
+ export type AnnotationEventFieldSource = "field" | "text" | "skip";
1269
+
1270
+ /**
1271
+ * Annotation event field mapping. Defines how to map a data frame field to an annotation event field.
1272
+ */
1273
+ export interface AnnotationEventFieldMapping {
1274
+ /**
1275
+ * Source type for the field value.
1276
+ */
1277
+ source?: AnnotationEventFieldSource;
1278
+ /**
1279
+ * Constant value to use when source is "text".
1280
+ */
1281
+ value?: string;
1282
+ /**
1283
+ * Regular expression to apply to the field value.
1284
+ */
1285
+ regex?: string;
1286
+ }
1287
+
1288
+ /** The dashboard `schemaVersion` the pinned schema defaults to, and the one chant emits. */
1289
+ export const DASHBOARD_SCHEMA_VERSION = 42;