From 491999db00e4c8190a32bfa6c18a433aee2342be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Thu, 8 Nov 2018 12:25:23 +0200 Subject: [PATCH] Update docs. --- templates/front/docs_api.html | 12 +++++++-- .../front/snippets/create_check_response.html | 1 + .../front/snippets/create_check_response.txt | 1 + .../front/snippets/list_checks_response.html | 26 ++++++++++--------- .../front/snippets/list_checks_response.txt | 26 ++++++++++--------- 5 files changed, 40 insertions(+), 26 deletions(-) diff --git a/templates/front/docs_api.html b/templates/front/docs_api.html index 36a61799..35dd6636 100644 --- a/templates/front/docs_api.html +++ b/templates/front/docs_api.html @@ -203,11 +203,14 @@ To create a "cron" check, specify the "schedule" and "tz" parameters. channels -

string, optional, default value: ""

+

string, optional

By default, if a check is created through API, no notification channels are assigned to it. So, when the check goes up or down, - no notifications would be sent. Set this field to a special value "*" + no notifications will get sent.

+

Set this field to a special value "*" to automatically assign all existing notification channels.

+

To assign specific notification channels, use a comma-separated + list of channel identifiers.

@@ -343,6 +346,11 @@ To create a "cron" check, specify the "schedule" and "tz" parameters.

Set this field to a special value "" (empty string) to automatically unassign all notification channels.

+

Set this field to a comma-separated list of channel identifiers + to assign specific notification channels. +

+

Example:

+
{"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"}
diff --git a/templates/front/snippets/create_check_response.html b/templates/front/snippets/create_check_response.html index 4dbc6900..9704dcea 100644 --- a/templates/front/snippets/create_check_response.html +++ b/templates/front/snippets/create_check_response.html @@ -1,4 +1,5 @@
{
+  "channels": "",
   "grace": 60,
   "last_ping": null,
   "n_pings": 0,
diff --git a/templates/front/snippets/create_check_response.txt b/templates/front/snippets/create_check_response.txt
index 4e9bafa4..26caca1f 100644
--- a/templates/front/snippets/create_check_response.txt
+++ b/templates/front/snippets/create_check_response.txt
@@ -1,4 +1,5 @@
 {
+  "channels": "",
   "grace": 60,
   "last_ping": null,
   "n_pings": 0,
diff --git a/templates/front/snippets/list_checks_response.html b/templates/front/snippets/list_checks_response.html
index 22093448..0ae95302 100644
--- a/templates/front/snippets/list_checks_response.html
+++ b/templates/front/snippets/list_checks_response.html
@@ -1,30 +1,32 @@
 
{
   "checks": [
     {
+      "channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"
+      "grace": 900,
       "last_ping": "2017-01-04T13:24:39.903464+00:00",
-      "ping_url": "{{ PING_ENDPOINT }}662ebe36-ecab-48db-afe3-e20029cb71e6",
-      "next_ping": "2017-01-04T14:24:39.903464+00:00",
-      "grace": 900,
-      "name": "Api test 1",
       "n_pings": 1,
-      "tags": "foo",
+      "name": "Api test 1",
+      "next_ping": "2017-01-04T14:24:39.903464+00:00",
       "pause_url": "{{ SITE_ROOT }}/api/v1/checks/662ebe36-ecab-48db-afe3-e20029cb71e6/pause",
-      "timeout": 3600,
+      "ping_url": "{{ PING_ENDPOINT }}662ebe36-ecab-48db-afe3-e20029cb71e6",
       "status": "up",
+      "tags": "foo",
+      "timeout": 3600,
       "update_url": "{{ SITE_ROOT }}/api/v1/checks/662ebe36-ecab-48db-afe3-e20029cb71e6"
     },
     {
-      "last_ping": null,
-      "ping_url": "{{ PING_ENDPOINT }}9d17c61f-5c4f-4cab-b517-11e6b2679ced",
-      "next_ping": null,
+      "channels": "",
       "grace": 3600,
-      "name": "Api test 2",
+      "last_ping": null,
       "n_pings": 0,
-      "tags": "bar baz",
+      "name": "Api test 2",
+      "next_ping": null,
       "pause_url": "{{ SITE_ROOT }}/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced/pause",
-      "tz": "UTC",
+      "ping_url": "{{ PING_ENDPOINT }}9d17c61f-5c4f-4cab-b517-11e6b2679ced",
       "schedule": "0/10 * * * *",
       "status": "new",
+      "tags": "bar baz",
+      "tz": "UTC",
       "update_url": "{{ SITE_ROOT }}/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced"
     }
   ]
diff --git a/templates/front/snippets/list_checks_response.txt b/templates/front/snippets/list_checks_response.txt
index 320cf213..b4f33a9f 100644
--- a/templates/front/snippets/list_checks_response.txt
+++ b/templates/front/snippets/list_checks_response.txt
@@ -1,30 +1,32 @@
 {
   "checks": [
     {
-      "last_ping": "2017-01-04T13:24:39.903464+00:00",
-      "ping_url": "PING_ENDPOINT662ebe36-ecab-48db-afe3-e20029cb71e6",
-      "next_ping": "2017-01-04T14:24:39.903464+00:00",
+      "channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"
       "grace": 900,
-      "name": "Api test 1",
+      "last_ping": "2017-01-04T13:24:39.903464+00:00",
       "n_pings": 1,
-      "tags": "foo",
+      "name": "Api test 1",
+      "next_ping": "2017-01-04T14:24:39.903464+00:00",
       "pause_url": "SITE_ROOT/api/v1/checks/662ebe36-ecab-48db-afe3-e20029cb71e6/pause",
-      "timeout": 3600,
+      "ping_url": "PING_ENDPOINT662ebe36-ecab-48db-afe3-e20029cb71e6",
       "status": "up",
+      "tags": "foo",
+      "timeout": 3600,
       "update_url": "SITE_ROOT/api/v1/checks/662ebe36-ecab-48db-afe3-e20029cb71e6"
     },
     {
-      "last_ping": null,
-      "ping_url": "PING_ENDPOINT9d17c61f-5c4f-4cab-b517-11e6b2679ced",
-      "next_ping": null,
+      "channels": "",
       "grace": 3600,
-      "name": "Api test 2",
+      "last_ping": null,
       "n_pings": 0,
-      "tags": "bar baz",
+      "name": "Api test 2",
+      "next_ping": null,
       "pause_url": "SITE_ROOT/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced/pause",
-      "tz": "UTC",
+      "ping_url": "PING_ENDPOINT9d17c61f-5c4f-4cab-b517-11e6b2679ced",
       "schedule": "0/10 * * * *",
       "status": "new",
+      "tags": "bar baz",
+      "tz": "UTC",
       "update_url": "SITE_ROOT/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced"
     }
   ]