forked from GithubBackups/healthchecks
Add filtering checks by tag to api documentation
This commit is contained in:
parent
afe4ec6df8
commit
8f88fbf24f
@ -61,8 +61,8 @@ The response may contain a JSON document with additional data.
|
|||||||
<div class="api-path">GET {{ SITE_ROOT }}/api/v1/checks/</div>
|
<div class="api-path">GET {{ SITE_ROOT }}/api/v1/checks/</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Returns a list of checks. This API call takes no parameters and returns
|
Returns a list of checks. This API call takes only optional tag querystring parameter to filter checks by their tags.
|
||||||
a JSON document with all checks in user's account.
|
If no parameter provided it returns a JSON document with all checks in user's account.
|
||||||
</p>
|
</p>
|
||||||
<h3 class="api-section">Example Request</h3>
|
<h3 class="api-section">Example Request</h3>
|
||||||
{% include "front/snippets/list_checks_request.html" %}
|
{% include "front/snippets/list_checks_request.html" %}
|
||||||
@ -70,6 +70,12 @@ The response may contain a JSON document with additional data.
|
|||||||
<h3 class="api-section">Example Response</h3>
|
<h3 class="api-section">Example Response</h3>
|
||||||
{% include "front/snippets/list_checks_response.html" %}
|
{% include "front/snippets/list_checks_response.html" %}
|
||||||
|
|
||||||
|
<h3 class="api-section">Example Request To Filter Checks By Their Tags</h3>
|
||||||
|
{% include "front/snippets/list_checks_request_filtered.html" %}
|
||||||
|
|
||||||
|
<h3 class="api-section">Example Response Of Filtered Checks</h3>
|
||||||
|
{% include "front/snippets/list_checks_response_filtered.html" %}
|
||||||
|
|
||||||
<!-- ********************************************************************** /-->
|
<!-- ********************************************************************** /-->
|
||||||
|
|
||||||
<a class="section" name="create-check">
|
<a class="section" name="create-check">
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
<div class="highlight"><pre><span></span>curl --header <span class="s2">"X-Api-Key: your-api-key"</span> {{ SITE_ROOT }}/api/v1/checks/?tag=bar&tag=baz
|
||||||
|
</pre></div>
|
@ -0,0 +1 @@
|
|||||||
|
curl --header "X-Api-Key: your-api-key" SITE_ROOT/api/v1/checks/?tag=bar&tag=baz
|
19
templates/front/snippets/list_checks_response_filtered.html
Normal file
19
templates/front/snippets/list_checks_response_filtered.html
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<div class="highlight"><pre><span></span><span class="p">{</span>
|
||||||
|
<span class="nt">"checks"</span><span class="p">:</span> <span class="p">[</span>
|
||||||
|
<span class="p">{</span>
|
||||||
|
<span class="nt">"last_ping"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
|
||||||
|
<span class="nt">"ping_url"</span><span class="p">:</span> <span class="s2">"{{ PING_ENDPOINT }}9d17c61f-5c4f-4cab-b517-11e6b2679ced"</span><span class="p">,</span>
|
||||||
|
<span class="nt">"next_ping"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
|
||||||
|
<span class="nt">"grace"</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
|
||||||
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Api test 2"</span><span class="p">,</span>
|
||||||
|
<span class="nt">"n_pings"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
||||||
|
<span class="nt">"tags"</span><span class="p">:</span> <span class="s2">"bar baz"</span><span class="p">,</span>
|
||||||
|
<span class="nt">"pause_url"</span><span class="p">:</span> <span class="s2">"{{ SITE_ROOT }}/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced/pause"</span><span class="p">,</span>
|
||||||
|
<span class="nt">"tz"</span><span class="p">:</span> <span class="s2">"UTC"</span><span class="p">,</span>
|
||||||
|
<span class="nt">"schedule"</span><span class="p">:</span> <span class="s2">"0/10 * * * *"</span><span class="p">,</span>
|
||||||
|
<span class="nt">"status"</span><span class="p">:</span> <span class="s2">"new"</span><span class="p">,</span>
|
||||||
|
<span class="nt">"update_url"</span><span class="p">:</span> <span class="s2">"{{ SITE_ROOT }}/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced"</span>
|
||||||
|
<span class="p">}</span>
|
||||||
|
<span class="p">]</span>
|
||||||
|
<span class="p">}</span>
|
||||||
|
</pre></div>
|
18
templates/front/snippets/list_checks_response_filtered.txt
Normal file
18
templates/front/snippets/list_checks_response_filtered.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"checks": [
|
||||||
|
{
|
||||||
|
"last_ping": null,
|
||||||
|
"ping_url": "PING_ENDPOINT9d17c61f-5c4f-4cab-b517-11e6b2679ced",
|
||||||
|
"next_ping": null,
|
||||||
|
"grace": 3600,
|
||||||
|
"name": "Api test 2",
|
||||||
|
"n_pings": 0,
|
||||||
|
"tags": "bar baz",
|
||||||
|
"pause_url": "SITE_ROOT/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced/pause",
|
||||||
|
"tz": "UTC",
|
||||||
|
"schedule": "0/10 * * * *",
|
||||||
|
"status": "new",
|
||||||
|
"update_url": "SITE_ROOT/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user