forked from GithubBackups/healthchecks
Merge pull request #313 from brammeleman/set-description
set/update the checks description through the API
This commit is contained in:
commit
9697fc1b45
@ -20,6 +20,7 @@ class UpdateCheckTestCase(BaseTestCase):
|
|||||||
"api_key": "X" * 32,
|
"api_key": "X" * 32,
|
||||||
"name": "Foo",
|
"name": "Foo",
|
||||||
"tags": "bar,baz",
|
"tags": "bar,baz",
|
||||||
|
"desc": "My description",
|
||||||
"timeout": 3600,
|
"timeout": 3600,
|
||||||
"grace": 60,
|
"grace": 60,
|
||||||
},
|
},
|
||||||
@ -32,6 +33,7 @@ class UpdateCheckTestCase(BaseTestCase):
|
|||||||
assert "ping_url" in doc
|
assert "ping_url" in doc
|
||||||
self.assertEqual(doc["name"], "Foo")
|
self.assertEqual(doc["name"], "Foo")
|
||||||
self.assertEqual(doc["tags"], "bar,baz")
|
self.assertEqual(doc["tags"], "bar,baz")
|
||||||
|
self.assertEqual(doc["desc"], "My description")
|
||||||
self.assertEqual(doc["last_ping"], None)
|
self.assertEqual(doc["last_ping"], None)
|
||||||
self.assertEqual(doc["n_pings"], 0)
|
self.assertEqual(doc["n_pings"], 0)
|
||||||
|
|
||||||
|
@ -70,6 +70,9 @@ def _update(check, spec):
|
|||||||
if "tags" in spec:
|
if "tags" in spec:
|
||||||
check.tags = spec["tags"]
|
check.tags = spec["tags"]
|
||||||
|
|
||||||
|
if "desc" in spec:
|
||||||
|
check.desc = spec["desc"]
|
||||||
|
|
||||||
if "timeout" in spec and "schedule" not in spec:
|
if "timeout" in spec and "schedule" not in spec:
|
||||||
check.kind = "simple"
|
check.kind = "simple"
|
||||||
check.timeout = td(seconds=spec["timeout"])
|
check.timeout = td(seconds=spec["timeout"])
|
||||||
|
@ -186,6 +186,13 @@ To create a "cron" check, specify the "schedule" and "tz" parameters.
|
|||||||
<pre>{"tags": "reports staging"}</pre>
|
<pre>{"tags": "reports staging"}</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>desc</th>
|
||||||
|
<td>
|
||||||
|
<p>string, optional.</p>
|
||||||
|
<p>Description for the check.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>timeout</th>
|
<th>timeout</th>
|
||||||
<td>
|
<td>
|
||||||
@ -328,6 +335,13 @@ To create a "cron" check, specify the "schedule" and "tz" parameters.
|
|||||||
<pre>{"tags": "reports staging"}</pre>
|
<pre>{"tags": "reports staging"}</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>desc</th>
|
||||||
|
<td>
|
||||||
|
<p>string, optional.</p>
|
||||||
|
<p>Description for the check.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>timeout</th>
|
<th>timeout</th>
|
||||||
<td>
|
<td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user