summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-07-10 17:04:21 +0000
committerGerrit Code Review <review@openstack.org>2018-07-10 17:04:21 +0000
commit2ff186cae74650d660afccdc9f0762e033c6c373 (patch)
treefde9144a2ff0b175df6bbe2b071920643c87867e
parente36f4ef99e38e2e62dd3e2994a89b19c5d0d5f60 (diff)
parentabbef4e6b50b66bcbf95b1d941a75b300edfdb1c (diff)
Merge "Add 'database' to the datasource schema"
-rw-r--r--grafana_dashboards/schema/datasource.py1
-rw-r--r--tests/schema/fixtures/datasource-0002.json12
-rw-r--r--tests/schema/fixtures/datasource-0002.yaml5
3 files changed, 18 insertions, 0 deletions
diff --git a/grafana_dashboards/schema/datasource.py b/grafana_dashboards/schema/datasource.py
index 9e24ea2..0368d68 100644
--- a/grafana_dashboards/schema/datasource.py
+++ b/grafana_dashboards/schema/datasource.py
@@ -26,5 +26,6 @@ class Datasource(object):
26 'influxdb'), 26 'influxdb'),
27 v.Required('url'): v.All(str, v.Length(min=1)), 27 v.Required('url'): v.All(str, v.Length(min=1)),
28 v.Optional('orgId'): int, 28 v.Optional('orgId'): int,
29 v.Optional('database'): v.All(str, v.Length(min=1)),
29 } 30 }
30 return datasource 31 return datasource
diff --git a/tests/schema/fixtures/datasource-0002.json b/tests/schema/fixtures/datasource-0002.json
new file mode 100644
index 0000000..52392e0
--- /dev/null
+++ b/tests/schema/fixtures/datasource-0002.json
@@ -0,0 +1,12 @@
1{
2 "datasource": {
3 "new-datasource": {
4 "access": "direct",
5 "database": "foodb",
6 "isDefault": false,
7 "name": "New datasource",
8 "type": "influxdb",
9 "url": "http://example.org"
10 }
11 }
12}
diff --git a/tests/schema/fixtures/datasource-0002.yaml b/tests/schema/fixtures/datasource-0002.yaml
new file mode 100644
index 0000000..5c3ee30
--- /dev/null
+++ b/tests/schema/fixtures/datasource-0002.yaml
@@ -0,0 +1,5 @@
1datasource:
2 name: New datasource
3 url: http://example.org
4 type: influxdb
5 database: foodb