mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 06:55:53 +03:00
[GH-ISSUE #337] API return single check #257
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#257
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 @jameskirsop on GitHub (Feb 24, 2020).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/337
Similar to, but not quite the same as, #256, it would be great if the
hc-api-updateURL (akaapi/v1/checks/<uuid:code>) could be adjusted to support returning the data for a single check.The current situation of providing a list of all checks and their status is great. However, I'm writing a datasource integration with Grafana, which will be significantly easier to do if the datasource can poll for a single check via a
GETby uuid (after a user selects the check they wish to display in the panel).@cuu508 commented on GitHub (Feb 24, 2020):
Thanks for the suggestion. Makes sense and should be relatively easy to support.
It will take me some time to get this done and deployed. In the meantime, you can use the
POST /api/v1/checks/<uuid:code>call and send an empty JSON dictionary ("update the check but don't change any fields"). It's going to be less efficient, but should allow you to continue without waiting on me.And – great to see you working on a Grafana datasource – looking forward to try it out!
@jameskirsop commented on GitHub (Feb 24, 2020):
@cuu508, I'm happy to fork and create a branch for these changes and do a PR for review.
I'll update this comment with a link to the fork/branch once I've made some meaningful changes.Here's a diff showing the changes that I believe fully implement this feature request, and pass the pre-built tests.
The branch is over at https://github.com/jameskirsop/healthchecks/tree/api-single-check
Happy to create a PR if this looks OK. I wasn't quite sure how/where to update the documentation, so if that needs to be done - I'll need some pointers to look in the right place.
@cuu508 commented on GitHub (Mar 2, 2020):
Sorry for the silence – I missed the edit!
Unless I'm missing something, it looks like
hc.api.views.updatewould now be unused and can be removed.It would be good to have a test case that exercises the
GET /api/v1/checks/<uuid:code>route.The API documentation is in the
templates/front/docs_api.htmlfile, and example requests/responses are intemplates/front/snippets/directory. Each snippet has a .txt file and a generated .html file. The html versions are generated withmanage.py pygmentize.Please hold off updating documentation for a bit – I'll see if I can reformat the API documentation to Markdown. This should make updating it much easier.
@cuu508 commented on GitHub (Mar 2, 2020):
I've now converted the API reference to Markdown format. To update documentation:
templates/docs/api.mdmanage.py render_docsto generate the HTML version@cuu508 commented on GitHub (Mar 19, 2020):
@jameskirsop what are your plans on this? I can take over if you've moved on to something else.
@jameskirsop commented on GitHub (Mar 22, 2020):
Sorry @cuu508, got distracted on something else. I'm still keen to make this change (and have some other suggestions too). I'll try and do a PR today.
@cuu508 commented on GitHub (Mar 23, 2020):
Thanks for updating the PR, @jameskirsop !
I cleaned up a few bits and merged it. It's now been deployed to https://healthchecks.io