From 9299ee451607f4d4ea1f93205c72c003205533f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Wed, 15 Sep 2021 13:30:19 +0300 Subject: [PATCH] Improve response code descriptions in Ping API docs --- static/css/docs.css | 4 ++++ templates/docs/http_api.html | 36 ++++++++++++++++++------------------ templates/docs/http_api.md | 36 ++++++++++++++++++------------------ 3 files changed, 40 insertions(+), 36 deletions(-) diff --git a/static/css/docs.css b/static/css/docs.css index 552a3a97..fd2b7f71 100644 --- a/static/css/docs.css +++ b/static/css/docs.css @@ -104,6 +104,10 @@ h2.rule { grid-template-columns: 150px auto; } +.page-docs .docs-http_api dl { + grid-template-columns: 220px auto; +} + .page-docs dt { font-weight: normal; font-family: "Lucida Console", Monaco, monospace; diff --git a/templates/docs/http_api.html b/templates/docs/http_api.html index 0a11fe4e..cbc1a2d7 100644 --- a/templates/docs/http_api.html +++ b/templates/docs/http_api.html @@ -59,7 +59,7 @@ code and ignore the request.

Report script's exit status (UUID) -PING_ENDPOINT<uuid>/<exitcode> +PING_ENDPOINT<uuid>/<exit-status> Success (slug) @@ -75,7 +75,7 @@ code and ignore the request.

Report script's exit status (slug) -PING_ENDPOINT<ping-key>/<slug>/<exitcode> +PING_ENDPOINT<ping-key>/<slug>/<exit-status> @@ -90,7 +90,7 @@ a continuously running process is still running and healthy).

200 OK
The request succeeded.
-
404 Not Found
+
404 not found
Could not find a check with the specified UUID.

Example

@@ -124,7 +124,7 @@ but it enables a few extra features:

200 OK
The request succeeded.
-
404 Not Found
+
404 not found
Could not find a check with the specified UUID.

Example

@@ -154,7 +154,7 @@ minimizes the delay from your monitored service failing to you receiving an aler
200 OK
The request succeeded.
-
404 Not Found
+
404 not found
Could not find a check with the specified UUID.

Example

@@ -185,9 +185,9 @@ interprets 0 as success and all other values as failure.

200 OK
The request succeeded.
-
400 Bad Request
-
Invalid URL format.
-
404 Not Found
+
400 invalid url format
+
The URL does not match the expected format.
+
404 not found
Could not find a check with the specified UUID.

Example

@@ -218,9 +218,9 @@ included in the URL.

200 OK
The request succeeded.
-
404 Not Found
+
404 not found
Could not find a check with the specified ping key and slug combination.
-
409 Conflict
+
409 ambiguous slug
Ambiguous, the slug matched multiple checks.

Example

@@ -255,9 +255,9 @@ included in the URL.

200 OK
The request succeeded.
-
404 Not Found
+
404 not found
Could not find a check with the specified ping key and slug combination.
-
409 Conflict
+
409 ambiguous slug
Ambiguous, the slug matched multiple checks.

Example

@@ -288,9 +288,9 @@ included in the URL.

200 OK
The request succeeded.
-
404 Not Found
+
404 not found
Could not find a check with the specified ping key and slug combination.
-
409 Conflict
+
409 ambiguous slug
Ambiguous, the slug matched multiple checks.

Example

@@ -322,11 +322,11 @@ included in the URL.

200 OK
The request succeeded.
-
400 Bad Request
-
Invalid URL format.
-
404 Not Found
+
400 invalid url format
+
The URL does not match the expected format.
+
404 not found
Could not find a check with the specified ping key and slug combination.
-
409 Conflict
+
409 ambiguous slug
Ambiguous, the slug matched multiple checks.

Example

diff --git a/templates/docs/http_api.md b/templates/docs/http_api.md index 78066ec6..e8c7e75a 100644 --- a/templates/docs/http_api.md +++ b/templates/docs/http_api.md @@ -54,11 +54,11 @@ Endpoint Name | Endpoint Address [Success (UUID)](#success-uuid) | `PING_ENDPOINT` [Start (UUID)](#start-uuid) | `PING_ENDPOINT/start` [Failure (UUID)](#fail-uuid) | `PING_ENDPOINT/fail` -[Report script's exit status (UUID)](#exitcode-uuid) | `PING_ENDPOINT/` +[Report script's exit status (UUID)](#exitcode-uuid) | `PING_ENDPOINT/` [Success (slug)](#success-slug) | `PING_ENDPOINT/` [Start (slug)](#start-slug) | `PING_ENDPOINT//start` [Failure (slug)](#fail-slug) | `PING_ENDPOINT//fail` -[Report script's exit status (slug)](#exitcode-slug) | `PING_ENDPOINT//` +[Report script's exit status (slug)](#exitcode-slug) | `PING_ENDPOINT//` ## Send a "success" Signal Using UUID {: #success-uuid .rule } @@ -76,7 +76,7 @@ SITE_NAME identifies the check by the UUID value included in the URL. 200 OK : The request succeeded. -404 Not Found +404 not found : Could not find a check with the specified UUID. **Example** @@ -117,7 +117,7 @@ SITE_NAME identifies the check by the UUID value included in the URL. 200 OK : The request succeeded. -404 Not Found +404 not found : Could not find a check with the specified UUID. **Example** @@ -155,7 +155,7 @@ SITE_NAME identifies the check by the UUID value included in the URL. 200 OK : The request succeeded. -404 Not Found +404 not found : Could not find a check with the specified UUID. **Example** @@ -194,10 +194,10 @@ SITE_NAME identifies the check by the UUID value included in the URL. 200 OK : The request succeeded. -400 Bad Request -: Invalid URL format. +400 invalid url format +: The URL does not match the expected format. -404 Not Found +404 not found : Could not find a check with the specified UUID. **Example** @@ -236,10 +236,10 @@ included in the URL. 200 OK : The request succeeded. -404 Not Found +404 not found : Could not find a check with the specified ping key and slug combination. -409 Conflict +409 ambiguous slug : Ambiguous, the slug matched multiple checks. **Example** @@ -281,10 +281,10 @@ included in the URL. 200 OK : The request succeeded. -404 Not Found +404 not found : Could not find a check with the specified ping key and slug combination. -409 Conflict +409 ambiguous slug : Ambiguous, the slug matched multiple checks. **Example** @@ -323,10 +323,10 @@ included in the URL. 200 OK : The request succeeded. -404 Not Found +404 not found : Could not find a check with the specified ping key and slug combination. -409 Conflict +409 ambiguous slug : Ambiguous, the slug matched multiple checks. **Example** @@ -366,13 +366,13 @@ included in the URL. 200 OK : The request succeeded. -400 Bad Request -: Invalid URL format. +400 invalid url format +: The URL does not match the expected format. -404 Not Found +404 not found : Could not find a check with the specified ping key and slug combination. -409 Conflict +409 ambiguous slug : Ambiguous, the slug matched multiple checks. **Example**