Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all folders endpoint is incorrect #173

Closed
chintal opened this issue Apr 12, 2024 · 1 comment · Fixed by #172
Closed

Get all folders endpoint is incorrect #173

chintal opened this issue Apr 12, 2024 · 1 comment · Fixed by #172

Comments

@chintal
Copy link
Collaborator

chintal commented Apr 12, 2024

Describe the bug
The folders.get_all_folders endpoint provides the parent_uid, if set, in data. This puts it in the body of the resulting API request. This needs to be a query parameter, however.

https://grafana.com/docs/grafana/latest/developers/http_api/folder/#get-all-folders

To Reproduce
Steps to reproduce the behavior:

  1. Create a Folder in grafana. Create a subfolder folder within it. Note that nested folders needs to be enabled on the Grafana instance
  2. Run client.folders.get_all_folders(parent_uid=<uid of created parent>)
  3. You'll get the contents of the root folder

Expected behavior
Folders contained within the provided parent_uid should be returned.

Versions

  • Grafana: v10.4.1 (d3ce857c0e)
  • grafana-client: git main head
  • Authentication: Token

Additional context
I've quickly tested that the problem is resolved if I change data=data to params=data in the __request_runner call to s.request() in client.py. Obviously, this is not a viable solution.

The infrastructure needs to be modified to allow params to be passed through to the final request call, the same way data presently is.

chintal added a commit to chintal/grafana-client that referenced this issue Apr 12, 2024
@amotl
Copy link
Contributor

amotl commented Apr 13, 2024

Dear Chintalagiri,

thank you so much for discovering and fixing that flaw already. It clearly demonstrates yet another time that grafana-client needs an integration test suite.

With kind regards,
Andreas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants