Manage Grafana v4.0 data sources
New in version 2017.7.0.
This state requires a configuration profile to be configured in the minion config, minion pillar, or master config. The module will use the 'grafana' key by default, if defined.
Example configuration using basic authentication:
grafana:
grafana_url: http://grafana.localhost
grafana_user: admin
grafana_password: admin
grafana_timeout: 3
Example configuration using token based authentication:
grafana:
grafana_url: http://grafana.localhost
grafana_token: token
grafana_timeout: 3
The behavior of this module is to create data sources if the do not exists, and to update data sources if the already exists.
Ensure influxdb data source is present:
grafana4_datasource.present:
- name: influxdb
- type: influxdb
- url: http://localhost:8086
- access: proxy
- basic_auth: true
- basic_auth_user: myuser
- basic_auth_password: mypass
- is_default: true
salt.states.grafana4_datasource.
absent
(name, orgname=None, profile='grafana')¶Ensure that a data source is present.
Name of the data source to remove.
Name of the organization from which the data source should be absent.
Configuration profile used to connect to the Grafana instance. Default is 'grafana'.
salt.states.grafana4_datasource.
present
(name, type, url, access=None, user=None, password=None, database=None, basic_auth=None, basic_auth_user=None, basic_auth_password=None, tls_auth=None, json_data=None, is_default=None, with_credentials=None, type_logo_url=None, orgname=None, profile='grafana')¶Ensure that a data source is present.
Name of the data source.
Type of the datasource ('graphite', 'influxdb' etc.).
Use proxy or direct. Default: proxy
The URL to the data source API.
Optional - user to authenticate with the data source.
Optional - password to authenticate with the data source.
Optional - database to use with the data source.
Optional - set to True to use HTTP basic auth to authenticate with the data source.
Optional - HTTP basic auth username.
Optional - HTTP basic auth password.
Optional - additional json data to post (eg. "timeInterval").
Optional - set data source as default.
Optional - Whether credentials such as cookies or auth headers should be sent with cross-site requests.
Optional - Logo to use for this datasource.
Name of the organization in which the data source should be present.
Configuration profile used to connect to the Grafana instance. Default is 'grafana'.