salt.states.grafana4_datasource module

Manage Grafana v4.0 data sources

New in version 2017.7.0.

Token auth setup

grafana_version: 4
grafana:
  grafana_timeout: 5
  grafana_token: qwertyuiop
  grafana_url: 'https://url.com'

Basic auth setup

grafana_version: 4
grafana:
  grafana_timeout: 5
  grafana_user: grafana
  grafana_password: qwertyuiop
  grafana_url: 'https://url.com'
Ensure influxdb data source is present:
  grafana_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
Name of the data source to remove.
orgname
Name of the organization from which the data source should be absent.
profile
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
Name of the data source.
type
Type of the datasource ('graphite', 'influxdb' etc.).
access
Use proxy or direct. Default: proxy
url
The URL to the data source API.
user
Optional - user to authenticate with the data source.
password
Optional - password to authenticate with the data source.
database
Optional - database to use with the data source.
basic_auth
Optional - set to True to use HTTP basic auth to authenticate with the data source.
basic_auth_user
Optional - HTTP basic auth username.
basic_auth_password
Optional - HTTP basic auth password.
json_data
Optional - additional json data to post (eg. "timeInterval").
is_default
Optional - set data source as default.
with_credentials
Optional - Whether credentials such as cookies or auth headers should be sent with cross-site requests.
type_logo_url
Optional - Logo to use for this datasource.
orgname
Name of the organization in which the data source should be present.
profile
Configuration profile used to connect to the Grafana instance. Default is 'grafana'.