Open meyerder opened 9 months ago
Dear @meyerder,
this is an excellent suggestion and proposal, I love it. Would you be comfortable with making this solution part of the grafana-wtf
code base?
Let me know if you would need support for coding it in the Python language, I will be be happy to do it, and then we can work together on it, in order to refine it for more advanced situations which you may not have thought into. I am sure others will use it as well, and report back correspondingly.
With kind regards, Andreas.
@amotl
Yes.. Feel free to use/modify and put into the framework that you have with the tab and csv and other format output aspects that you have in this project.. (I was kinda hopeful you would do it as I also stink in python.. Give me Bash or sql HAHAAH)
Hi again,
https://github.com/panodata/grafana-client/pull/124 and https://github.com/panodata/grafana-wtf/pull/104 are trying to provide you relevant infrastructure for your inquirements to the Grafana API.
Below are two basic usage examples for them. Formatting the output like your program is doing it, will probably need another iteration.
Saying this, grafana-wtf currently yields a flat list of items (both folder and dashboard items), and does not do any efforts to display a folder/dashboard hierarchy, like your program is doing it. Maybe it is still useful. Let us know which details would need to be improved so it could be a reasonable replacement for your variant.
With kind regards, Andreas.
This command will enumerate all folders and dashboards, and accompany them with data from corresponding permissions inquiries.
grafana-wtf explore permissions
An example to compress the output a bit.
grafana-wtf explore permissions | jq '.[] | select(.type == "folder") | .item.title,(.permissions | .[] | .team,.permissionName)'
Because both grafana-client
and grafana-wtf
are not released yet, in order to try the above, you will need to install them like this.
pip install --upgrade 'git+https://github.com/panodata/grafana-client'
pip install --upgrade 'git+https://github.com/panodata/grafana-wtf@collab/permission-checks'
Dear @meyerder,
can I ask you to verify the new grafana-wtf explore permissions
command by installing grafana-client
and grafana-wtf
like outlined above, and report back if that is something which could fulfill your needs?
If you see chances to improve, we will be happy to adjust the implementation accordingly.
With kind regards, Andreas.
This is a work in progress but you seem to be a major WIZ at json (I stink at it) This is something I am working on as well.. The output needs to be worked on and the for each loop for each dashboard is not quite right yet either. You might be able to modify this.
Ideally, I would like to know if any users or teams have access to the folder and or the dashboards. I have NOT thought about doing this down at the data source levels (In my case that may be overkill but others MIGHT like it).