feat(uptimerobot): migrate provider to UptimeRobot API v3 - #677
Open
davidgrldo wants to merge 1 commit into
Open
davidgrldo wants to merge 1 commit into
davidgrldo wants to merge 1 commit into
Conversation
Switch the UptimeRobot provider from the legacy v2 RPC-style API to the v3 REST API: - Auth via Authorization: Bearer header (api_key no longer sent in body) - REST verbs: GET/POST/PATCH/DELETE /monitors and /psps with JSON bodies - Cursor-based pagination via nextLink - Bounded 429 retry honoring Retry-After (caps previously unbounded recursive retries in Add/Update) - Remove now detaches the monitor from its status pages before deleting - Alert contacts / maintenance windows keep their CRD string format, mapped to v3 structured fields - httptest-based offline unit tests for the v3 client - Docs and example configs updated to the v3 apiURL Fixes stakater#637 Signed-off-by: davidgrldo <davidgrldo123@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #637
What
Migrates the UptimeRobot provider from the legacy v2 API to the v3 REST API.
Changes
Authorization: Bearer <apiKey>header on every request (api_keyno longer sent in form bodies)GET/POST/PATCH/DELETE /v3/monitorsand/v3/pspswith JSON bodies (replaces v2 verb-style POST endpoints)nextLink(replaces offset/limit)stat/errorenvelope is gone)Retry-After, capped at 3 retries (also fixes the previously unbounded recursive retries in Add/Update)PATCH /psps/{id}with the fullmonitorIdsarray;Removenow detaches a monitor from its status pages before deleting ituptimeRobotConfigfields keep their user-facing format (alertContactsid_threshold_recurrence-, maintenanceWindows, customHTTPStatuses) and are mapped to v3 structured fields internallydocs/uptimerobot-configuration.md,CONTRIBUTING.md, and example configs updated to the v3 apiURLVerification
go build ./...✅go vet ./pkg/http/... ./pkg/monitors/uptimerobot/...✅go test ./pkg/...(all packages, offline) ✅gofmtclean ✅Notes for reviewers
timeouton monitor creation; aDefaultTimeout = 30constant is used.custom_http_statusesformat (200:0_401:1) does not map 1:1 to v3successHttpResponseCodes— codes flagged:1become success codes; noted in a code comment.