-
Notifications
You must be signed in to change notification settings - Fork 9
feat(contact-point): support retrieval by name #135
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
base: main
Are you sure you want to change the base?
Conversation
Saurus119
commented
Aug 11, 2025
- Adds support for retrieving a contact point by its exact name.
- If multiple contact points share the same name, the method will return all matching contact points in a list.
- This can occur, for example, when an alert rule uses contact points that implement multiple actions. In Grafana’s UI, such contact points are grouped by name, but they are stored as separate contact points in the backend.
@@ -226,6 +226,30 @@ def get_all_contact_points(self) -> list: | |||
else: | |||
return api_call | |||
|
|||
def get_contact_point(self, name: str) -> list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please contribute unit tests for the functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, I also modified little bit existing test to get all:contact_points so it is crystal clear that it can return multiple, not only one.
- Modified get_contact_point because the response list() is valid response from the grafana API if you don´t have a match. So when you do call for the contact point that doesn´t exists you shouldn´t raise exception on empty list response.
|