Module Expr Str ImportFrom alias Import alias ImportFrom alias FunctionDef arguments args defaults body Expr Str Return CompareEq Call SubscriptLoad NameLoad Index Str Str Num Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Str Str NameLoad Str Str NameLoad NameLoad Str body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad SubscriptLoad NameLoad Index Str NameLoad keyword Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr Str Num Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad NameLoad If BoolOpOr SubscriptLoad SubscriptLoad NameLoad Index Str Index Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str NameLoad keyword Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr Str Num Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad SubscriptLoad NameLoad Index Str keyword Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr Str Num Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str keyword Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr Str Num Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body If CompareEq SubscriptLoad NameLoad Index Str NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Dict Str Str Str Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Str Str NameLoad Str Str NameLoad NameLoad body Return Dict Str Str Str Str Str Str Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body If BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str body Delete SubscriptDel NameLoad Index NameLoad orelse If CompareEq SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Delete SubscriptDel NameLoad Index NameLoad Delete SubscriptDel NameLoad Index NameLoad Return Dict Str Str NameLoad NameLoad decorator_list
N/A N/A 
Manage Grafana v2.0 data sources

.. versionadded:: 2016.3.0

.. code-block:: yaml

    grafana:
      grafana_timeout: 3
      grafana_token: qwertyuiop
      grafana_url: 'https://url.com'

.. code-block:: yaml

    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
 __future__ absolute_import N/A requests salt.ext.six string_types __virtual__ N/A N/A N/A N/A N/A Only load if grafana v2.0 is configured. N/A N/A N/A N/A __salt__ N/A config.get grafana_version 1 2 N/A present N/A N/A name type url access user password database basic_auth basic_auth_user basic_auth_password is_default json_data profile N/A proxy False False None grafana N/A N/A 
    Ensure that a data source is present.

    name
        Name of the data source.

    type
        Which type of data source it is ('graphite', 'influxdb' etc.).

    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

    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.

    is_default
        Default: False
     N/A N/A isinstance profile string_types N/A N/A profile N/A N/A __salt__ N/A config.option profile N/A ret N/A result comment changes None None None N/A datasource N/A _get_datasource profile name N/A data N/A _get_json_data name type url access user password database basic_auth basic_auth_user basic_auth_password is_default json_data N/A datasource N/A N/A N/A N/A requests put N/A _get_url profile N/A datasource N/A id data headers N/A _get_headers profile timeout N/A N/A profile get grafana_timeout 3 N/A N/A ret N/A result True N/A N/A ret N/A changes N/A _diff datasource data N/A N/A N/A N/A ret N/A changes N/A new N/A N/A ret N/A changes N/A old N/A N/A N/A ret N/A comment N/A N/A Data source {0} updated format name N/A N/A N/A ret N/A changes None N/A N/A ret N/A comment N/A N/A Data source {0} already up-to-date format name N/A N/A N/A N/A requests post N/A N/A {0}/api/datasources format N/A profile N/A grafana_url data headers N/A _get_headers profile timeout N/A N/A profile get grafana_timeout 3 N/A N/A ret N/A result True N/A N/A ret N/A comment N/A N/A New data source {0} added format name N/A N/A ret N/A changes data N/A ret N/A absent N/A N/A name profile N/A grafana N/A N/A 
    Ensure that a data source is present.

    name
        Name of the data source to remove.
     N/A N/A isinstance profile string_types N/A N/A profile N/A N/A __salt__ N/A config.option profile N/A ret N/A result comment changes None None None N/A datasource N/A _get_datasource profile name N/A N/A datasource N/A N/A N/A ret N/A result True N/A N/A ret N/A comment N/A N/A Data source {0} already absent format name N/A ret N/A N/A N/A requests delete N/A _get_url profile N/A datasource N/A id headers N/A _get_headers profile timeout N/A N/A profile get grafana_timeout 3 N/A N/A ret N/A result True N/A N/A ret N/A comment N/A N/A Data source {0} was deleted format name N/A ret N/A _get_url N/A N/A profile datasource_id N/A N/A N/A N/A N/A {0}/api/datasources/{1} format N/A profile N/A grafana_url datasource_id N/A _get_datasource N/A N/A profile name N/A N/A N/A response N/A N/A requests get N/A N/A {0}/api/datasources format N/A profile N/A grafana_url headers N/A _get_headers profile timeout N/A N/A profile get grafana_timeout 3 N/A data N/A N/A response json N/A datasource data N/A N/A N/A N/A datasource N/A name name N/A N/A datasource N/A None N/A _get_headers N/A N/A profile N/A N/A N/A N/A Accept Authorization application/json N/A N/A Bearer {0} format N/A profile N/A grafana_token N/A _get_json_data N/A N/A name type url access user password database basic_auth basic_auth_user basic_auth_password is_default json_data N/A proxy False False None N/A N/A N/A name type url access user password database basicAuth basicAuthUser basicAuthPassword isDefault jsonData name type url access user password database basic_auth basic_auth_user basic_auth_password is_default json_data N/A _diff N/A N/A old new N/A N/A N/A old_keys N/A N/A old keys N/A old N/A N/A old copy N/A new N/A N/A new copy N/A key old_keys N/A N/A N/A N/A key id N/A key orgId N/A N/A N/A old N/A key N/A N/A N/A N/A old N/A key N/A new N/A key N/A N/A N/A old N/A key N/A N/A new N/A key N/A N/A old new old new N/A