File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,30 @@ def get_all_contact_points(self) -> list:
226
226
else :
227
227
return api_call
228
228
229
+ def get_contact_point (self , name : str ) -> list :
230
+ """Return contact points that exactly match the given name.
231
+
232
+ This method does not support partial matching — the `name` value must
233
+ match exactly.
234
+
235
+ Raises:
236
+ Exception: If an unspecified error occurs during the API call.
237
+
238
+ Returns:
239
+ list: A list of contact points whose `name` property exactly matches
240
+ the provided `name`.
241
+ """
242
+
243
+ api_call : list = Api (self .grafana_api_model ).call_the_api (
244
+ f"{ APIEndpoints .ALERTING_PROVISIONING .value } /contact-points?name={ name } "
245
+ )
246
+
247
+ if api_call == list ():
248
+ logging .error (f"Check the error: { api_call } ." )
249
+ raise Exception
250
+ else :
251
+ return api_call
252
+
229
253
def add_contact_point (
230
254
self ,
231
255
embedded_contact_point : EmbeddedContactPoint ,
You can’t perform that action at this time.
0 commit comments