diff --git a/grafana_dashboards/schema/datasource.py b/grafana_dashboards/schema/datasource.py index 0368d68..c7f6a91 100644 --- a/grafana_dashboards/schema/datasource.py +++ b/grafana_dashboards/schema/datasource.py @@ -23,7 +23,8 @@ class Datasource(object): v.Required('isDefault', default=False): v.All(bool), v.Required('name'): v.All(str, v.Length(min=1)), v.Required('type', default='graphite'): v.Any('graphite', - 'influxdb'), + 'influxdb', + 'prometheus'), v.Required('url'): v.All(str, v.Length(min=1)), v.Optional('orgId'): int, v.Optional('database'): v.All(str, v.Length(min=1)), diff --git a/tests/schema/fixtures/datasource-0003.json b/tests/schema/fixtures/datasource-0003.json new file mode 100644 index 0000000..67024d5 --- /dev/null +++ b/tests/schema/fixtures/datasource-0003.json @@ -0,0 +1,11 @@ +{ + "datasource": { + "new-prometheus-datasource": { + "access": "proxy", + "isDefault": false, + "name": "New prometheus datasource", + "type": "prometheus", + "url": "http://example.org:9090" + } + } +} diff --git a/tests/schema/fixtures/datasource-0003.yaml b/tests/schema/fixtures/datasource-0003.yaml new file mode 100644 index 0000000..0ac783c --- /dev/null +++ b/tests/schema/fixtures/datasource-0003.yaml @@ -0,0 +1,5 @@ +datasource: + name: New prometheus datasource + url: http://example.org:9090 + access: proxy + type: prometheus