You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.2 KiB

  1. # HTTP API
  2. The SITE_NAME pinging API is used for submitting success, failure and job start
  3. signals from the monitored systems.
  4. ## General Notes
  5. All ping endpoints support:
  6. * HTTP and HTTPS
  7. * HTTP 1.0, HTTP 1.1 and HTTP 2
  8. * IPv4 and IPv6
  9. * HEAD, GET and POST requests methods. The HTTP POST requests
  10. can optionally include diagnostic information in the request body.
  11. If the request body looks like a UTF-8 string, SITE_NAME stores the request body
  12. (limited to first 10KB for each received ping).
  13. Successful responses will have the "200 OK" HTTP response status code and a short
  14. and simple string "OK" in the response body.
  15. ## Signal Success ("ping")
  16. ```text
  17. HEAD|GET|POST PING_ENDPOINT{uuid}
  18. ```
  19. Signals to SITE_NAME that the job has completed successfully (or, for
  20. continuously running processes, is still running and healthy). The `uuid` parameter
  21. is unique for each check.
  22. **Example**
  23. ```http
  24. GET /5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278 HTTP/1.0
  25. Host: hc-ping.com
  26. ```
  27. ```http
  28. HTTP/1.1 200 OK
  29. Server: nginx
  30. Date: Wed, 29 Jan 2020 09:58:23 GMT
  31. Content-Type: text/plain; charset=utf-8
  32. Content-Length: 2
  33. Connection: close
  34. Access-Control-Allow-Origin: *
  35. OK
  36. ```
  37. ## Signal Failure
  38. ```text
  39. HEAD|GET|POST PING_ENDPOINT{uuid}/fail
  40. ```
  41. Signals to SITE_NAME that the job has failed. Actively signalling a failure
  42. minimizes the delay from your monitored service failing to you receiving an alert.
  43. **Example**
  44. ```http
  45. GET /5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278/fail HTTP/1.0
  46. Host: hc-ping.com
  47. ```
  48. ```http
  49. HTTP/1.1 200 OK
  50. Server: nginx
  51. Date: Wed, 29 Jan 2020 09:58:23 GMT
  52. Content-Type: text/plain; charset=utf-8
  53. Content-Length: 2
  54. Connection: close
  55. Access-Control-Allow-Origin: *
  56. OK
  57. ```
  58. ## Signal a Start
  59. ```text
  60. HEAD|GET|POST PING_ENDPOINT{uuid}/start
  61. ```
  62. Sends a "job has started!" message to SITE_NAME. This is
  63. optional but enables a few extra features:
  64. * SITE_NAME will measure and display job execution times
  65. * SITE_NAME will detect if the job runs longer than its configured grace time
  66. **Example**
  67. ```http
  68. GET /5bf66975-d4c7-4bf5-bcc8-b8d8a82ea278/start HTTP/1.0
  69. Host: hc-ping.com
  70. ```
  71. ```http
  72. HTTP/1.1 200 OK
  73. Server: nginx
  74. Date: Wed, 29 Jan 2020 09:58:23 GMT
  75. Content-Type: text/plain; charset=utf-8
  76. Content-Length: 2
  77. Connection: close
  78. Access-Control-Allow-Origin: *
  79. OK
  80. ```