|
12 | 12 | grafanaDatasources+:: {}, |
13 | 13 |
|
14 | 14 | // Generates yaml string containing datasource config |
15 | | - grafana_datasource(name, url, default=false, method='GET'):: |
16 | | - { |
17 | | - apiVersion: 1, |
18 | | - datasources: [{ |
19 | | - name: name, |
20 | | - type: 'prometheus', |
21 | | - access: 'proxy', |
22 | | - url: url, |
23 | | - isDefault: default, |
24 | | - version: 1, |
25 | | - editable: false, |
26 | | - jsonData: { |
27 | | - httpMethod: method, |
28 | | - }, |
29 | | - }], |
| 15 | + grafana_datasource(name, url, default=false, method='GET', type='prometheus'):: { |
| 16 | + name: name, |
| 17 | + type: type, |
| 18 | + access: 'proxy', |
| 19 | + url: url, |
| 20 | + isDefault: default, |
| 21 | + version: 1, |
| 22 | + editable: false, |
| 23 | + jsonData: { |
| 24 | + httpMethod: method, |
30 | 25 | }, |
| 26 | + }, |
31 | 27 |
|
32 | 28 | /* |
33 | 29 | helper to allow adding datasources directly to the datasource_config_map |
|
42 | 38 | }), |
43 | 39 |
|
44 | 40 | // Generates yaml string containing datasource config |
45 | | - grafana_datasource_with_basicauth(name, url, username, password, default=false, method='GET'):: |
46 | | - { |
47 | | - apiVersion: 1, |
48 | | - datasources: [{ |
49 | | - name: name, |
50 | | - type: 'prometheus', |
51 | | - access: 'proxy', |
52 | | - url: url, |
53 | | - isDefault: default, |
54 | | - version: 1, |
55 | | - editable: false, |
56 | | - basicAuth: true, |
57 | | - basicAuthUser: username, |
58 | | - basicAuthPassword: password, |
59 | | - jsonData: { |
60 | | - httpMethod: method, |
61 | | - }, |
62 | | - }], |
| 41 | + grafana_datasource_with_basicauth(name, url, username, password, default=false, method='GET', type='prometheus'):: { |
| 42 | + name: name, |
| 43 | + type: type, |
| 44 | + access: 'proxy', |
| 45 | + url: url, |
| 46 | + isDefault: default, |
| 47 | + version: 1, |
| 48 | + editable: false, |
| 49 | + basicAuth: true, |
| 50 | + basicAuthUser: username, |
| 51 | + basicAuthPassword: password, |
| 52 | + jsonData: { |
| 53 | + httpMethod: method, |
63 | 54 | }, |
| 55 | + }, |
64 | 56 |
|
65 | 57 | /* |
66 | 58 | helper to allow adding datasources directly to the datasource_config_map |
|
81 | 73 | if std.isString($.grafanaDatasources[name]) then |
82 | 74 | $.grafanaDatasources[name] |
83 | 75 | else |
84 | | - $.util.manifestYaml($.grafanaDatasources[name]) |
| 76 | + $.util.manifestYaml({ |
| 77 | + apiVersion: 1, |
| 78 | + datasources: [$.grafanaDatasources[name]], |
| 79 | + }) |
85 | 80 | ) |
86 | 81 | for name in std.objectFields($.grafanaDatasources) |
87 | 82 | }) + |
|
0 commit comments