Skip to content

Instantly share code, notes, and snippets.

@kaywoz
Last active April 3, 2024 14:31
Show Gist options
  • Save kaywoz/1231432095c34cdb3f5c5a401567a45e to your computer and use it in GitHub Desktop.
Save kaywoz/1231432095c34cdb3f5c5a401567a45e to your computer and use it in GitHub Desktop.
import healthchecks.io to another via api
import requests
SOURCE_API_URL = "https://healthchecks.io/api/v1/checks/"
TARGET_API_URL = "http://0.0.0.0:8000/api/v1/checks/"
SOURCE_PROJECT_READONLY_KEY = "SOURCE_API_KEY_READONLY"
TARGET_PROJECT_KEY = "TARGET_API_KEY"
r = requests.get(SOURCE_API_URL, headers={"X-Api-Key": SOURCE_PROJECT_READONLY_KEY})
for check in r.json()["checks"]:
print("Cloning %s" % check["name"])
requests.post(TARGET_API_URL, json=check, headers={"X-Api-Key": TARGET_PROJECT_KEY})
@kaywoz
Copy link
Author

kaywoz commented Apr 3, 2024

totally untested, lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment