amon icon indicating copy to clipboard operation
amon copied to clipboard

Healthcheck api

Open beardedeagle opened this issue 8 years ago • 3 comments

According to the docs: https://docs.amon.cx/api/#health-checks there are healthcheck api endpoints. When I try to do a curl to the list endpoint for healthchecks as per the documentation I get the following:

curl https://redacted.com/api/v1/healthchecks/list/?api_key=redactedapikey
<h1>Not Found</h1><p>The requested URL /api/v1/healthchecks/list/ was not found on this server.</p>

Digging through the code, I am not seeing the endpoints listed in the docs in the api urls. Was this just prematurely added to the docs?

beardedeagle avatar Feb 06 '17 15:02 beardedeagle

@beardedeagle In this case the opposite - there was a health check API in Amon 5.X and I did a big refactoring for 6.0 and most of the functionality got moved to alerts. Will restore list though, because it still makes sense.

healthchecks_urls = patterns('',
	url(r'^v1/healthchecks/list/$', HealthChecksListView.as_view(), name='api_healthchecks_list'),
	url(r'^v1/healthchecks/pause/all/$', HealthChecksPauseAllView.as_view(), name='api_healthchecks_pause_all'),
	url(r'^v1/healthchecks/resume/all/$', HealthChecksResumeAllView.as_view(), name='api_healthchecks_resume_all'),
	url(r'^v1/healthchecks/pause/(?P<check_id>\w+)/$', HealthChecksPauseView.as_view(), name='api_healthchecks_pause'),
	url(r'^v1/healthchecks/resume/(?P<check_id>\w+)/$', HealthChecksResumeView.as_view(), name='api_healthchecks_resume'),
	url(r'^v1/healthchecks/delete/(?P<check_id>\w+)/$', HealthChecksDeleteView.as_view(), name='api_healthchecks_delete'),
)

martinrusev avatar Feb 06 '17 18:02 martinrusev

@martinrusev I would think it would make sense to restore list AND delete. For instance, I have some healthchecks that I no longer run still sitting in my dashboard because I am unable to remove them either via api call or via a button click. So I basically have to wait for the retention policy to kick in and remove the stale data as far as I am understanding it (I could be wrong, I just started using this monitoring solution). And you should be able to cascade the delete to alerts as well so you don't end up with orphaned alerts.

beardedeagle avatar Feb 07 '17 15:02 beardedeagle

@beardedeagle list and delete will be restored. Not sure about alerts, because they are quite complicated with the groups and tagging

martinrusev avatar Feb 07 '17 15:02 martinrusev