Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

add Annotation method to get an annotation #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mdb
Copy link
Contributor

@mdb mdb commented Jun 5, 2020

This adds a convenience method for fetching an individual
annotation. Note that the Grafana API
documentation documents no method for paging through results.

This addresses issue #47 .

This adds a convenience method for fetching an individual
annotation. Note that the [Grafana API](https://grafana.com/docs/grafana/latest/http_api/annotations/)
documentation documents no method for paging through results.
@mdb mdb requested a review from tonglil as a code owner June 5, 2020 11:42
Copy link
Contributor

@mlclmj mlclmj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I'm wary of adding convenience functions to our public API, and a little hesitant about this since it doesn't map to an actual HTTP method from grafana. I think really the best option is to add this to Grafana and use the method here, but in the meantime is there a way to implement this where a user wouldn't need to specify the search filter to get an annotation?

@mlclmj mlclmj added the waiting response Waiting for a response from the author label Jun 7, 2020
@mdb
Copy link
Contributor Author

mdb commented Jun 8, 2020

@mlclmj Thanks for your feedback! I just want to make sure I understand...

In general I'm wary of adding convenience functions to our public API, and a little hesitant about this since it doesn't map to an actual HTTP method from grafana.

☝️ Am I correct in interpreting this to mean that you're wary of creating go-grafana-api functions (what I call methods above) that don't map directly to existing Grafana API endpoints/capabilities?

I think really the best option is to add this to Grafana and use the method here

☝️ Am I correct in thinking you're suggesting that a GET /api/annotations/:id endpoint be added to the Grafana API itself?

but in the meantime is there a way to implement this where a user wouldn't need to specify the search filter to get an annotation?

☝️ Could you elaborate a bit on what you mean here?

@mdb mdb requested a review from mlclmj June 8, 2020 17:12
@mdb
Copy link
Contributor Author

mdb commented Jul 19, 2020

@mlclmj @tonglil Can you offer any update on my above-posted questions? I completely understand if you're hesitant to merge this PR, though I'm curious to learn more about your views. Having a better understanding of your design vision could help me better design beneficial, merge-able contributions in the future. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting response Waiting for a response from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants