Implement servers.group_mappings, dashboard and team relationship

Hello,

I’m looking to automate dashboard creation and access based on LDAP.

The idea behind that is to use the following workflow :

  • Yaml file generation in grafana provisionning folder to create the grafana folder
  • JSON file generation in specific folder to create the dashboard in the previously created grafana folder
  • TOML file update to define a 1,1 relationship for a LDAP group and a grafana team
  • use grafana API to grant access to a folder for a team

Is it possible to do that ? Or is there any other way to generate automatically dashboards and grant access to them based on ldap group ?

Thanks a lot,

YAML

/etc/grafana/provisioning/dashboards/app1.yaml
apiVersion: 1
providers:

folder: App1
name: applicative server
options:
  path: /var/lib/grafana/dashboards/App1
orgId: 1
type: file

JSON :

/var/lib/grafana/dashboards/App1/server1.json (that contain with “title”: “App1”)

TOML:

/etc/grafana/ldap.toml
[[servers.group_mappings]]
group_dn = “CN=app1,OU=X,OU=X,OU=X,OU=X,DC=X,DC=X,DC=X,DC=x”
org_role = “Viewer”
org_id = 2
team=app1