Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit c4fc6ef

Browse files
committed
Use search parameter to filter monitors with the given friendly name
Leverage the search parameter in getMonitors API so as to get filtered results instead of getting all monitors
1 parent 0a1d497 commit c4fc6ef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

uptimerobot/api/monitor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func (client UptimeRobotApiClient) GetMonitorIDs(friendlyName string) (ids []int
8080
data := url.Values{}
8181
data.Add("custom_http_headers", fmt.Sprintf("%d", 1))
8282
data.Add("alert_contacts", fmt.Sprintf("%d", 1))
83+
data.Add("search", friendlyName)
8384

8485
maxMonitorRecords := 50
8586
data.Add("limit", fmt.Sprintf("%d", maxMonitorRecords))

0 commit comments

Comments
 (0)