Feature request: `-create` flag
When pinging by slug, Healthchecks can optionally auto-create a new check if a check with the specified slug does not exist. To enable this feature, the ping URL needs a ?create=1 query parameter added at the end:
$ curl https://hc-ping.com/fixme-ping-key/does-not-exist
# returns HTTP 404 because a check with slug "does-not-exist" does indeed not exist
$ curl https://hc-ping.com/fixme-ping-key/does-not-exist?create=1
# creates a new check and returns HTTP 201
$ curl https://hc-ping.com/fixme-ping-key/does-not-exist?create=1
# the check now exists, so the server returns HTTP 200
It would be great if there was a way to tell runitor to add the create=1 parameter in ping URLs. Perhaps something like:
runitor -ping-key fixme-ping-key -slug does-not-exist -create -- somecommand
@bdd what do you think? If something like the above looks OK, I can try my hand at implementing it.
@cuu508 can you please try the release at https://github.com/bdd/runitor/releases/tag/v1.3.0-beta.2?
See the commit above for code review.
Awesome!
I tested v1.3.0-beta.2 and it worked exactly as I was expecting.
The help text for the -create flag is:
Create a new check if slug is not found in the project
Perhaps it could mention what happens if you use -create with -uuid:
Create a new check if slug is not found in the project. Has no effect if pinging by UUID