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

Commit 131f2dc

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 a26e669 commit 131f2dc

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
@@ -82,6 +82,7 @@ func (client UptimeRobotApiClient) GetMonitorIDs(friendlyName string) (ids []int
8282
data := url.Values{}
8383
data.Add("custom_http_headers", fmt.Sprintf("%d", 1))
8484
data.Add("alert_contacts", fmt.Sprintf("%d", 1))
85+
data.Add("search", friendlyName)
8586

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

0 commit comments

Comments
 (0)