Module for working with the Grafana v4 API
New in version 2017.7.0.
| depends: | requests |
|---|---|
| configuration: | This module 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. For example: grafana:
grafana_url: http://grafana.localhost
grafana_user: admin
grafana_password: admin
grafana_timeout: 3
|
salt.modules.grafana4.create_datasource(orgname=None, profile='grafana', **kwargs)¶Create a new datasource in an organisation.
CLI Example:
salt '*' grafana4.create_datasource
salt.modules.grafana4.create_org(profile='grafana', **kwargs)¶Create a new organization.
CLI Example:
salt '*' grafana4.create_org <name>
salt.modules.grafana4.create_org_user(orgname=None, profile='grafana', **kwargs)¶Add user to the organization.
CLI Example:
salt '*' grafana4.create_org_user <orgname> loginOrEmail=<loginOrEmail> role=<role>
salt.modules.grafana4.create_update_dashboard(orgname=None, profile='grafana', **kwargs)¶Create or update a dashboard.
CLI Example:
salt '*' grafana4.create_update_dashboard dashboard=<dashboard> overwrite=True orgname=<orgname>
salt.modules.grafana4.create_user(profile='grafana', **kwargs)¶Create a new user.
CLI Example:
salt '*' grafana4.create_user login=<login> password=<password> email=<email>
salt.modules.grafana4.delete_dashboard(slug, orgname=None, profile='grafana')¶Delete a dashboard.
CLI Example:
salt '*' grafana4.delete_dashboard <slug>
salt.modules.grafana4.delete_datasource(datasourceid, orgname=None, profile='grafana')¶Delete a datasource.
CLI Example:
salt '*' grafana4.delete_datasource <datasource_id>
salt.modules.grafana4.delete_org(orgid, profile='grafana')¶Delete an organization.
CLI Example:
salt '*' grafana4.delete_org <org_id>
salt.modules.grafana4.delete_org_user(userid, orgname=None, profile='grafana')¶Remove user from the organization.
CLI Example:
salt '*' grafana4.delete_org_user <user_id> <orgname>
salt.modules.grafana4.delete_user(userid, profile='grafana')¶Delete a user.
CLI Example:
salt '*' grafana4.delete_user <user_id>
salt.modules.grafana4.delete_user_org(userid, orgid, profile='grafana')¶Remove a user from an organization.
CLI Example:
salt '*' grafana4.delete_user_org <user_id> <org_id>
salt.modules.grafana4.get_dashboard(slug, orgname=None, profile='grafana')¶Get a dashboard.
CLI Example:
salt '*' grafana4.get_dashboard <slug>
salt.modules.grafana4.get_datasource(name, orgname=None, profile='grafana')¶Show a single datasource in an organisation.
CLI Example:
salt '*' grafana4.get_datasource <name> <orgname>
salt.modules.grafana4.get_datasources(orgname=None, profile='grafana')¶List all datasources in an organisation.
CLI Example:
salt '*' grafana4.get_datasources <orgname>
salt.modules.grafana4.get_org(name, profile='grafana')¶Show a single organization.
CLI Example:
salt '*' grafana4.get_org <name>
salt.modules.grafana4.get_org_address(orgname=None, profile='grafana')¶Get the organization address.
CLI Example:
salt '*' grafana4.get_org_address <orgname>
salt.modules.grafana4.get_org_prefs(orgname=None, profile='grafana')¶Get the organization preferences.
CLI Example:
salt '*' grafana4.get_org_prefs <orgname>
salt.modules.grafana4.get_org_users(orgname=None, profile='grafana')¶Get the list of users that belong to the organization.
CLI Example:
salt '*' grafana4.get_org_users <orgname>
salt.modules.grafana4.get_orgs(profile='grafana')¶List all organizations.
CLI Example:
salt '*' grafana4.get_orgs
salt.modules.grafana4.get_user(login, profile='grafana')¶Show a single user.
CLI Example:
salt '*' grafana4.get_user <login>
salt.modules.grafana4.get_user_data(userid, profile='grafana')¶Get user data.
CLI Example:
salt '*' grafana4.get_user_data <user_id>
salt.modules.grafana4.get_user_orgs(userid, profile='grafana')¶Get the list of organisations a user belong to.
CLI Example:
salt '*' grafana4.get_user_orgs <user_id>
salt.modules.grafana4.get_users(profile='grafana')¶List all users.
CLI Example:
salt '*' grafana4.get_users
salt.modules.grafana4.switch_org(orgname, profile='grafana')¶Switch the current organization.
CLI Example:
salt '*' grafana4.switch_org <name>
salt.modules.grafana4.update_datasource(datasourceid, orgname=None, profile='grafana', **kwargs)¶Update a datasource.
CLI Example:
salt '*' grafana4.update_datasource <datasourceid>
salt.modules.grafana4.update_org(orgid, profile='grafana', **kwargs)¶Update an existing organization.
CLI Example:
salt '*' grafana4.update_org <org_id> name=<name>
salt.modules.grafana4.update_org_address(orgname=None, profile='grafana', **kwargs)¶Update the organization address.
CLI Example:
salt '*' grafana4.update_org_address <orgname> country=<country>
salt.modules.grafana4.update_org_prefs(orgname=None, profile='grafana', **kwargs)¶Update the organization preferences.
CLI Example:
salt '*' grafana4.update_org_prefs <orgname> theme=<theme> timezone=<timezone>
salt.modules.grafana4.update_org_user(userid, orgname=None, profile='grafana', **kwargs)¶Update user role in the organization.
CLI Example:
salt '*' grafana4.update_org_user <user_id> <orgname> loginOrEmail=<loginOrEmail> role=<role>
salt.modules.grafana4.update_user(userid, profile='grafana', **kwargs)¶Update an existing user.
CLI Example:
salt '*' grafana4.update_user <user_id> login=<login> email=<email>
salt.modules.grafana4.update_user_password(userid, profile='grafana', **kwargs)¶Update a user password.
CLI Example:
salt '*' grafana4.update_user_password <user_id> password=<password>
salt.modules.grafana4.update_user_permissions(userid, profile='grafana', **kwargs)¶Update a user password.
CLI Example:
salt '*' grafana4.update_user_permissions <user_id> isGrafanaAdmin=<true|false>
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2018.3.3