mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 15:05:49 +03:00
[GH-ISSUE #45] Create HTTP API endpoint aimed to create a new check #22
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ViachKakovskyi on GitHub (Feb 11, 2016).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/45
It would be very handy to have HTTP API for spawning new checks.
Many thanks for your service.
@pataquets commented on GitHub (Feb 16, 2016):
Even an "autocreate checks on first ping" kind of setting would be great for short-lived services, such as autoscaled instances.
@cuu508 commented on GitHub (Feb 16, 2016):
By now there are 3 issues asking for API access – #4, #42 and this one, so clearly this is something that's missing and worth adding.
Here's what we could start with:
Each account gets an API key, accessible from settings page
There's an API call for creating a new check. It takes a JSON payload with parameters (all optional):
curl -H "Content-Type: application/json" -X POST -d '{"name":"ip-10-0-0-1", "tags":"web,aws", "period":86400, "grace":300}' http://healthchecks.io/api/checkthe response would be a JSON dictionary with ping URL:
{"url": "https://hchk.io/..."}With this in place, one could write a CLI client in Python/Ruby/Go/whatever which creates the check if needed and then pings it. It could store the created URL in e.g. a dotfile in $HOME.
Would this help? What would be the use cases where this would not be sufficient?
@ViachKakovskyi commented on GitHub (Feb 16, 2016):
The way which you described here sounds good for me.
I have one concern about enabling HipChat/Slack/etc integrations for a new check. Should all the integrations be disabled for a new check? If so, it still requires manual operations in Healthchecks dashboard.
The ability to enable existing integration in POST request could be added in the next step (if you like the option).
And, probably, ability to delete a check via API would be a handy one.
Thanks, @cuu508.
@cuu508 commented on GitHub (Feb 18, 2016):
I've added an API call for creating a new check. It's very limited for time being, but we have to start somewhere!
Documentation: https://healthchecks.io/docs/api/
Very-alpha command line client: https://github.com/healthchecks/hchk
@ViachKakovskyi commented on GitHub (Feb 18, 2016):
Nice, many thanks.