Browse Source

API reference in Markdown

pull/340/head
Pēteris Caune 5 years ago
parent
commit
dab0c4200e
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
39 changed files with 1070 additions and 830 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +0
    -15
      hc/front/management/commands/pygmentize.py
  3. +1
    -1
      hc/front/management/commands/render_docs.py
  4. +0
    -1
      hc/front/urls.py
  5. +1
    -13
      hc/front/views.py
  6. +42
    -34
      static/css/docs.css
  7. +487
    -0
      templates/docs/api.html
  8. +533
    -0
      templates/docs/api.md
  9. +1
    -3
      templates/front/base_docs.html
  10. +0
    -500
      templates/front/docs_api.html
  11. +1
    -1
      templates/front/docs_single.html
  12. +0
    -4
      templates/front/snippets/create_check_request_a.html
  13. +0
    -3
      templates/front/snippets/create_check_request_a.txt
  14. +0
    -3
      templates/front/snippets/create_check_request_b.html
  15. +0
    -2
      templates/front/snippets/create_check_request_b.txt
  16. +0
    -16
      templates/front/snippets/create_check_response.html
  17. +0
    -15
      templates/front/snippets/create_check_response.txt
  18. +0
    -3
      templates/front/snippets/delete_check_request.html
  19. +0
    -2
      templates/front/snippets/delete_check_request.txt
  20. +0
    -2
      templates/front/snippets/list_channels_request.html
  21. +0
    -1
      templates/front/snippets/list_channels_request.txt
  22. +0
    -15
      templates/front/snippets/list_channels_response.html
  23. +0
    -14
      templates/front/snippets/list_channels_response.txt
  24. +0
    -2
      templates/front/snippets/list_checks_request.html
  25. +0
    -1
      templates/front/snippets/list_checks_request.txt
  26. +0
    -36
      templates/front/snippets/list_checks_response.html
  27. +0
    -35
      templates/front/snippets/list_checks_response.txt
  28. +0
    -29
      templates/front/snippets/list_checks_response_readonly.html
  29. +0
    -28
      templates/front/snippets/list_checks_response_readonly.txt
  30. +0
    -3
      templates/front/snippets/pause_check_request.html
  31. +0
    -2
      templates/front/snippets/pause_check_request.txt
  32. +0
    -16
      templates/front/snippets/pause_check_response.html
  33. +0
    -15
      templates/front/snippets/pause_check_response.txt
  34. +2
    -2
      templates/front/snippets/python_requests_fail.html
  35. +1
    -1
      templates/front/snippets/python_requests_start.html
  36. +0
    -4
      templates/front/snippets/update_check_request_a.html
  37. +0
    -3
      templates/front/snippets/update_check_request_a.txt
  38. +0
    -3
      templates/front/snippets/update_check_request_b.html
  39. +0
    -2
      templates/front/snippets/update_check_request_b.txt

+ 1
- 0
CHANGELOG.md View File

@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
- Improved UI to invite users from account's other projects (#258) - Improved UI to invite users from account's other projects (#258)
- Experimental Prometheus metrics endpoint (#300) - Experimental Prometheus metrics endpoint (#300)
- Don't store user's current project in DB, put it explicitly in page URLs (#336) - Don't store user's current project in DB, put it explicitly in page URLs (#336)
- API reference in Markdown
### Bug Fixes ### Bug Fixes
- The "render_docs" command checks if markdown and pygments is installed (#329) - The "render_docs" command checks if markdown and pygments is installed (#329)


+ 0
- 15
hc/front/management/commands/pygmentize.py View File

@ -44,18 +44,3 @@ class Command(BaseCommand):
_process("powershell", lexers.shell.PowerShellLexer()) _process("powershell", lexers.shell.PowerShellLexer())
_process("powershell_inline", lexers.shell.BashLexer()) _process("powershell_inline", lexers.shell.BashLexer())
_process("ruby", lexers.RubyLexer()) _process("ruby", lexers.RubyLexer())
# API examples
_process("list_checks_request", lexers.BashLexer())
_process("list_checks_response", lexers.JsonLexer())
_process("list_checks_response_readonly", lexers.JsonLexer())
_process("list_channels_request", lexers.BashLexer())
_process("list_channels_response", lexers.JsonLexer())
_process("create_check_request_a", lexers.BashLexer())
_process("create_check_request_b", lexers.BashLexer())
_process("update_check_request_a", lexers.BashLexer())
_process("update_check_request_b", lexers.BashLexer())
_process("create_check_response", lexers.JsonLexer())
_process("pause_check_request", lexers.BashLexer())
_process("pause_check_response", lexers.JsonLexer())
_process("delete_check_request", lexers.BashLexer())

+ 1
- 1
hc/front/management/commands/render_docs.py View File

@ -19,7 +19,7 @@ class Command(BaseCommand):
self.stdout.write(f" pip install {e.name}\n\n") self.stdout.write(f" pip install {e.name}\n\n")
return return
extensions = ["fenced_code", "codehilite", "tables"]
extensions = ["fenced_code", "codehilite", "tables", "def_list", "attr_list"]
ec = {"codehilite": {"css_class": "highlight"}} ec = {"codehilite": {"css_class": "highlight"}}
docs_path = os.path.join(settings.BASE_DIR, "templates/docs") docs_path = os.path.join(settings.BASE_DIR, "templates/docs")


+ 0
- 1
hc/front/urls.py View File

@ -91,7 +91,6 @@ urlpatterns = [
path("integrations/", include(channel_urls)), path("integrations/", include(channel_urls)),
path("projects/<uuid:code>/", include(project_urls)), path("projects/<uuid:code>/", include(project_urls)),
path("docs/", views.serve_doc, name="hc-docs"), path("docs/", views.serve_doc, name="hc-docs"),
path("docs/api/", views.docs_api, name="hc-docs-api"),
path("docs/cron/", views.docs_cron, name="hc-docs-cron"), path("docs/cron/", views.docs_cron, name="hc-docs-cron"),
path("docs/<slug:doc>/", views.serve_doc, name="hc-serve-doc"), path("docs/<slug:doc>/", views.serve_doc, name="hc-serve-doc"),
] ]

+ 1
- 13
hc/front/views.py View File

@ -278,6 +278,7 @@ def serve_doc(request, doc="introduction"):
content = open(path, "r", encoding="utf-8").read() content = open(path, "r", encoding="utf-8").read()
content = content.replace("SITE_NAME", settings.SITE_NAME) content = content.replace("SITE_NAME", settings.SITE_NAME)
content = content.replace("SITE_ROOT", settings.SITE_ROOT)
content = content.replace("PING_URL", settings.PING_ENDPOINT + "your-uuid-here") content = content.replace("PING_URL", settings.PING_ENDPOINT + "your-uuid-here")
content = content.replace("PING_ENDPOINT", settings.PING_ENDPOINT) content = content.replace("PING_ENDPOINT", settings.PING_ENDPOINT)
content = content.replace("IMG_URL", os.path.join(settings.STATIC_URL, "img/docs")) content = content.replace("IMG_URL", os.path.join(settings.STATIC_URL, "img/docs"))
@ -296,19 +297,6 @@ def serve_doc(request, doc="introduction"):
return render(request, "front/docs_single.html", ctx) return render(request, "front/docs_single.html", ctx)
def docs_api(request):
ctx = {
"page": "docs",
"section": "api",
"SITE_ROOT": settings.SITE_ROOT,
"PING_ENDPOINT": settings.PING_ENDPOINT,
"default_timeout": int(DEFAULT_TIMEOUT.total_seconds()),
"default_grace": int(DEFAULT_GRACE.total_seconds()),
}
return render(request, "front/docs_api.html", ctx)
def docs_cron(request): def docs_cron(request):
return render(request, "front/docs_cron.html", {}) return render(request, "front/docs_cron.html", {})


+ 42
- 34
static/css/docs.css View File

@ -35,46 +35,12 @@ li + li.nav-header {
font-family: monospace; font-family: monospace;
} }
.docs-heading {
margin-top: 40px;
}
h2.rule { h2.rule {
border-top: 3px solid #eee; border-top: 3px solid #eee;
margin-top: 30px; margin-top: 30px;
padding-top: 30px; padding-top: 30px;
} }
h3.api-section {
font-size: 14px;
font-weight: bold;
margin: 20px 0;
}
h3.docs-example {
margin-top: 40px;
}
.api-path {
font-family: monospace;
font-weight: bold;
margin-bottom: 1em;
background: #f5f5f5;
color: #333;
display: inline-block;
padding: 2px 4px;
border-radius: 2px;
}
a.section {
color: #000;
text-decoration: none;
}
a.section:hover {
text-decoration: none;
}
.page-docs code { .page-docs code {
padding: 2px 4px; padding: 2px 4px;
font-size: 90%; font-size: 90%;
@ -105,6 +71,12 @@ a.section:hover {
font-weight: bold; font-weight: bold;
} }
.docs-content h3 {
font-size: 14px;
font-weight: bold;
margin: 20px 0;
}
.docs-content ul { .docs-content ul {
padding-left: 15px; padding-left: 15px;
} }
@ -124,3 +96,39 @@ a.section:hover {
max-width: 100%; max-width: 100%;
} }
} }
.docs-api table {
width: 100%;
margin: 8px 0;
}
.docs-api th {
display: none;
}
.docs-api td {
padding: 8px;
border: 1px solid #ddd;
}
.docs-api dl {
display: grid;
grid-template-columns: 120px auto;
}
.docs-api dt {
font-weight: normal;
font-family: "Lucida Console", Monaco, monospace;
}
.docs-api dt, .docs-api dd {
border-top: 1px solid #DDD;
padding: 8px 0;
}
.rule + p code {
font-size: 14px;
font-weight: bold;
padding: 2px 4px;
}

+ 487
- 0
templates/docs/api.html View File

@ -0,0 +1,487 @@
<h1>API Reference</h1>
<p>SITE_NAME REST API supports listing, creating, updating, pausing and deleting
checks in user's account.</p>
<h2>API Endpoints</h2>
<table>
<thead>
<tr>
<th>Endpoint Name</th>
<th>Endpoint Address</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#list-checks">Get a list of existing checks</a></td>
<td><code>GET SITE_ROOT/api/v1/checks/</code></td>
</tr>
<tr>
<td><a href="#create-check">Create a new check</a></td>
<td><code>POST SITE_ROOT/api/v1/checks/</code></td>
</tr>
<tr>
<td><a href="#update-check">Update an existing check</a></td>
<td><code>POST SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></td>
</tr>
<tr>
<td><a href="#pause-check">Pause monitoring of a check</a></td>
<td><code>POST SITE_ROOT/api/v1/checks/&lt;uuid&gt;/pause</code></td>
</tr>
<tr>
<td><a href="#delete-check">Delete check</a></td>
<td><code>DELETE SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></td>
</tr>
<tr>
<td><a href="#list-channels">Get a list of existing integrations</a></td>
<td><code>GET SITE_ROOT/api/v1/channels/</code></td>
</tr>
</tbody>
</table>
<h2>Authentication</h2>
<p>Your requests to SITE_NAME REST API must authenticate using an
API key. Each project in your SITE_NAME account has separate API keys.
There are no account-wide API keys. By default, a project on SITE_NAME doesn't have
an API key. You can create read-write and read-only API keys in the
<strong>Project Settings</strong> page.</p>
<table>
<thead>
<tr>
<th>Key Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Regular API key</td>
<td>Have full access to all documented API endpoints.</td>
</tr>
<tr>
<td>Read-only API key</td>
<td>Only work with the <a href="#list-checks">Get a list of existing checks</a> endpoint. Some fields are omitted from the API responses.</td>
</tr>
</tbody>
</table>
<p>The client can authenticate itself by sending an appropriate HTTP
request header. The header's name should be <code>X-Api-Key</code> and
its value should be your API key.</p>
<p>Alternatively, for POST requests with a JSON request body,
the client can include an <code>api_key</code> field in the JSON document.
See below the "Create a check" section for an example.</p>
<h2>API Requests</h2>
<p>For POST requests, the SITE_NAME API expects request body to be
a JSON document (<em>not</em> a <code>multipart/form-data</code> encoded form data).</p>
<h2>API Responses</h2>
<p>SITE_NAME uses HTTP status codes wherever possible.
In general, 2xx class indicates success, 4xx indicates an client error,
and 5xx indicates a server error.</p>
<p>The response may contain a JSON document with additional data.</p>
<h2 class="rule" id="list-checks">Get a List of Existing Checks</h2>
<p><code>GET SITE_ROOT/api/v1/checks/</code></p>
<p>Returns a list of checks belonging to the user, optionally filtered by
one or more tags.</p>
<h3>Query String Parameters</h3>
<dl>
<dt>tag=&lt;value&gt;</dt>
<dd>
<p>Filters the checks, and returns only the checks that are tagged with the
specified value.</p>
<p>This parameter can be repeated multiple times.</p>
<p>Example:</p>
<p><code>SITE_ROOT/api/v1/checks/?tag=foo&amp;amp;tag=bar</code></p>
</dd>
</dl>
<h3>Example Request</h3>
<div class="highlight"><pre><span></span><code>curl --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> SITE_ROOT/api/v1/checks/
</code></pre></div>
<h3>Example Response</h3>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;checks&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Longer free-form description goes here&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">900</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-01-04T13:24:39.903464+00:00&quot;</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Api test 1&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-01-04T14:24:39.903464+00:00&quot;</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/662ebe36-ecab-48db-afe3-e20029cb71e6/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINT662ebe36-ecab-48db-afe3-e20029cb71e6&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;up&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;foo&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/662ebe36-ecab-48db-afe3-e20029cb71e6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Api test 2&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINT9d17c61f-5c4f-4cab-b517-11e6b2679ced&quot;</span><span class="p">,</span>
<span class="nt">&quot;schedule&quot;</span><span class="p">:</span> <span class="s2">&quot;0/10 * * * *&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;bar baz&quot;</span><span class="p">,</span>
<span class="nt">&quot;tz&quot;</span><span class="p">:</span> <span class="s2">&quot;UTC&quot;</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</code></pre></div>
<p>When using the read-only API key, the following fields are omitted:
<code>ping_url</code>, <code>update_url</code>, <code>pause_url</code>, <code>channels</code>. An extra <code>unique_key</code> field
is added. This identifier is stable across API calls. Example:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;checks&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Longer free-form description goes here&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">900</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-01-04T13:24:39.903464+00:00&quot;</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Api test 1&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;up&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;foo&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;unique_key&quot;</span><span class="p">:</span> <span class="s2">&quot;2872190d95224bad120f41d3c06aab94b8175bb6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Api test 2&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;schedule&quot;</span><span class="p">:</span> <span class="s2">&quot;0/10 * * * *&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;bar baz&quot;</span><span class="p">,</span>
<span class="nt">&quot;tz&quot;</span><span class="p">:</span> <span class="s2">&quot;UTC&quot;</span><span class="p">,</span>
<span class="nt">&quot;unique_key&quot;</span><span class="p">:</span> <span class="s2">&quot;9b5fc29129560ff2c5c1803803a7415e4f80cf7e&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</code></pre></div>
<h2 class="rule" id="create-check">Create a Check</h2>
<p><code>POST SITE_ROOT/api/v1/checks/</code></p>
<p>Creates a new check and returns its ping URL.
All request parameters are optional and will use their default
values if omitted.</p>
<p>This API call can be used to create both "simple" and "cron" checks.
To create a "simple" check, specify the "timeout" parameter.
To create a "cron" check, specify the "schedule" and "tz" parameters.</p>
<h3>Request Parameters</h3>
<dl>
<dt>name</dt>
<dd>
<p>string, optional, default value: ""</p>
<p>Name for the new check.</p>
</dd>
<dt>tags</dt>
<dd>
<p>string, optional, default value: ""</p>
<p>A space-delimited list of tags for the new check.
Example:</p>
<p><pre>{"tags": "reports staging"}</pre></p>
</dd>
<dt>desc</dt>
<dd>
<p>string, optional.</p>
<p>Description for the check.</p>
</dd>
<dt>timeout</dt>
<dd>
<p>number, optional, default value: {{ default_timeout }}.</p>
<p>A number of seconds, the expected period of this check.</p>
<p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
<p>Example for 5 minute timeout:</p>
<p><pre>{"kind": "simple", "timeout": 300}</pre></p>
</dd>
<dt>grace</dt>
<dd>
<p>number, optional, default value: {{ default_grace }}.</p>
<p>A number of seconds, the grace period for this check.</p>
<p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
</dd>
<dt>schedule</dt>
<dd>
<p>string, optional, default value: "<em> * </em> * *".</p>
<p>A cron expression defining this check's schedule.</p>
<p>If you specify both "timeout" and "schedule" parameters, "timeout" will be
ignored and "schedule" will be used.</p>
<p>Example for a check running every half-hour:</p>
<p><pre>{"schedule": "0,30 * <em> * </em>"}</pre></p>
</dd>
<dt>tz</dt>
<dd>
<p>string, optional, default value: "UTC".</p>
<p>Server's timezone. This setting only has effect in combination with the
"schedule" paremeter.</p>
<p>Example:</p>
<p><pre>{"tz": "Europe/Riga"}</pre></p>
</dd>
<dt>channels</dt>
<dd>
<p>string, optional</p>
<p>By default, if a check is created through API, no notification channels
(integrations) are assigned to it. So, when the check goes up or down, no
notifications will get sent.</p>
<p>Set this field to a special value "*" to automatically assign all existing
integrations.</p>
<p>To assign specific integrations, use a comma-separated list of integration
identifiers. Use the <a href="#list-channels">Get a List of Existing Integrations</a> call to
look up integration identifiers.</p>
</dd>
<dt>unique</dt>
<dd>
<p>array of string values, optional, default value: [].</p>
<p>Before creating a check, look for existing checks, filtered by fields listed
in <code>unique</code>. If a matching check is found, return it with HTTP status code 200.
If no matching check is found, proceed as normal: create a check and return it
with HTTP status code 201.</p>
<p>The accepted values are: <code>name</code>, <code>tags</code>, <code>timeout</code> and <code>grace</code>.</p>
<p>Example:</p>
<p><pre>{"name": "Backups", unique: ["name"]}</pre></p>
<p>In this example, if a check named "Backups" exists, it will be returned.
Otherwise, a new check will be created and returned.</p>
</dd>
</dl>
<h3>Response Codes</h3>
<dl>
<dt>201 Created</dt>
<dd>Returned if the check was successfully created.</dd>
<dt>200 OK</dt>
<dd>Returned if the <code>unique</code> parameter was used and an existing check was matched.</dd>
<dt>403 Forbidden</dt>
<dd>Returned if the account's check limit has been reached. For free accounts,
the limit is 20 checks per account.</dd>
</dl>
<h3>Example Request</h3>
<div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/ <span class="se">\</span>
--header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> <span class="se">\</span>
--data <span class="s1">&#39;{&quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
</code></pre></div>
<p>Or, alternatively:</p>
<div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/ <span class="se">\</span>
--data <span class="s1">&#39;{&quot;api_key&quot;: &quot;your-api-key&quot;, &quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
</code></pre></div>
<h3>Example Response</h3>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="p">}</span>
</code></pre></div>
<h2 class="rule" id="update-check">Update an Existing Check</h2>
<p><code>POST SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></p>
<p>Updates an existing check. All request parameters are optional. The check is
updated only with the supplied request parameters. If any parameter is omitted,
its value is left unchanged.</p>
<h3>Request Parameters</h3>
<dl>
<dt>name</dt>
<dd>
<p>string, optional.</p>
<p>Name for the check.</p>
</dd>
<dt>tags</dt>
<dd>
<p>string, optional.</p>
<p>A space-delimited list of tags for the check.</p>
<p>Example:</p>
<p><pre>{"tags": "reports staging"}</pre></p>
</dd>
<dt>desc</dt>
<dd>
<p>string, optional.</p>
<p>Description for the check.</p>
</dd>
<dt>timeout</dt>
<dd>
<p>number, optional.</p>
<p>A number of seconds, the expected period of this check.</p>
<p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
<p>Example for 5 minute timeout:</p>
<p><pre>{"kind": "simple", "timeout": 300}</pre></p>
</dd>
<dt>grace</dt>
<dd>
<p>number, optional.</p>
<p>A number of seconds, the grace period for this check.</p>
<p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
</dd>
<dt>schedule</dt>
<dd>
<p>string, optional.</p>
<p>A cron expression defining this check's schedule.</p>
<p>If you specify both "timeout" and "schedule" parameters, "timeout" will be
ignored and "schedule" will be used.</p>
<p>Example for a check running every half-hour:</p>
<p><pre>{"schedule": "0,30 * <em> * </em>"}</pre></p>
</dd>
<dt>tz</dt>
<dd>
<p>string, optional.</p>
<p>Server's timezone. This setting only has effect in combination with the
"schedule" paremeter.</p>
<p>Example:</p>
<p><pre>{"tz": "Europe/Riga"}</pre></p>
</dd>
<dt>channels</dt>
<dd>
<p>string, optional.</p>
<p>Set this field to a special value "*" to automatically assign all existing
notification channels.</p>
<p>Set this field to a special value "" (empty string) to automatically <em>unassign</em>
all notification channels.</p>
<p>Set this field to a comma-separated list of channel identifiers to assign
specific notification channels.</p>
<p>Example:</p>
<p><pre>{"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"}</pre></p>
</dd>
</dl>
<h3>Response Codes</h3>
<dl>
<dt>200 OK</dt>
<dd>Returned if the check was successfully updated.</dd>
</dl>
<h3>Example Request</h3>
<div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
--header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> <span class="se">\</span>
--data <span class="s1">&#39;{&quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
</code></pre></div>
<p>Or, alternatively:</p>
<div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
--data <span class="s1">&#39;{&quot;api_key&quot;: &quot;your-api-key&quot;, &quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
</code></pre></div>
<h3>Example Response</h3>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="p">}</span>
</code></pre></div>
<h2 class="rule" id="pause-check">Pause Monitoring of a Check</h2>
<p><code>POST SITE_ROOT/api/v1/checks/&lt;uuid&gt;/pause</code></p>
<p>Disables monitoring for a check, without removing it. The check goes into a "paused"
state. You can resume monitoring of the check by pinging it.</p>
<p>This API call has no request parameters.</p>
<h3>Example Request</h3>
<div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/0c8983c9-9d73-446f-adb5-0641fdacc9d4/pause <span class="se">\</span>
--request POST --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> --data <span class="s2">&quot;&quot;</span>
</code></pre></div>
<p>Note: the <code>--data ""</code> argument forces curl to send a <code>Content-Length</code> request header
even though the request body is empty. For HTTP POST requests, the <code>Content-Length</code>
header is sometimes required by some network proxies and web servers.</p>
<h3>Example Response</h3>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;paused&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span>
<span class="p">}</span>
</code></pre></div>
<h2 class="rule" id="delete-check">Delete Check</h2>
<p><code>DELETE SITE_ROOT/api/v1/checks/&lt;uuid&gt;</code></p>
<p>Permanently deletes the check from user's account. Returns JSON representation of the
check that was just deleted.</p>
<p>This API call has no request parameters.</p>
<h3>Example Request</h3>
<div class="highlight"><pre><span></span><code>curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
--request DELETE --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span>
</code></pre></div>
<h3>Example Response</h3>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="p">}</span>
</code></pre></div>
<h2 class="rule" id="list-channels">Get a List of Existing Integrations</h2>
<p><code>GET SITE_ROOT/api/v1/channels/</code></p>
<p>Returns a list of integrations belonging to the user.</p>
<h3>Example Request</h3>
<div class="highlight"><pre><span></span><code>curl --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> SITE_ROOT/api/v1/channels/
</code></pre></div>
<h3>Example Response</h3>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;4ec5a071-2d08-4baa-898a-eb4eb3cd6941&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Work Email&quot;</span><span class="p">,</span>
<span class="nt">&quot;kind&quot;</span><span class="p">:</span> <span class="s2">&quot;email&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;746a083e-f542-4554-be1a-707ce16d3acc&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Phone&quot;</span><span class="p">,</span>
<span class="nt">&quot;kind&quot;</span><span class="p">:</span> <span class="s2">&quot;sms&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</code></pre></div>

+ 533
- 0
templates/docs/api.md View File

@ -0,0 +1,533 @@
# API Reference
SITE_NAME REST API supports listing, creating, updating, pausing and deleting
checks in user's account.
## API Endpoints
Endpoint Name | Endpoint Address
------------------------------------------------------|-------
[Get a list of existing checks](#list-checks) | `GET SITE_ROOT/api/v1/checks/`
[Create a new check](#create-check) | `POST SITE_ROOT/api/v1/checks/`
[Update an existing check](#update-check) | `POST SITE_ROOT/api/v1/checks/<uuid>`
[Pause monitoring of a check](#pause-check) | `POST SITE_ROOT/api/v1/checks/<uuid>/pause`
[Delete check](#delete-check) | `DELETE SITE_ROOT/api/v1/checks/<uuid>`
[Get a list of existing integrations](#list-channels) | `GET SITE_ROOT/api/v1/channels/`
## Authentication
Your requests to SITE_NAME REST API must authenticate using an
API key. Each project in your SITE_NAME account has separate API keys.
There are no account-wide API keys. By default, a project on SITE_NAME doesn't have
an API key. You can create read-write and read-only API keys in the
**Project Settings** page.
Key Type | Description
-------------------|------------
Regular API key | Have full access to all documented API endpoints.
Read-only API key | Only work with the [Get a list of existing checks](#list-checks) endpoint. Some fields are omitted from the API responses.
The client can authenticate itself by sending an appropriate HTTP
request header. The header's name should be `X-Api-Key` and
its value should be your API key.
Alternatively, for POST requests with a JSON request body,
the client can include an `api_key` field in the JSON document.
See below the "Create a check" section for an example.
## API Requests
For POST requests, the SITE_NAME API expects request body to be
a JSON document (*not* a `multipart/form-data` encoded form data).
## API Responses
SITE_NAME uses HTTP status codes wherever possible.
In general, 2xx class indicates success, 4xx indicates an client error,
and 5xx indicates a server error.
The response may contain a JSON document with additional data.
## Get a List of Existing Checks {: #list-checks .rule }
`GET SITE_ROOT/api/v1/checks/`
Returns a list of checks belonging to the user, optionally filtered by
one or more tags.
### Query String Parameters
tag=&lt;value&gt;
: Filters the checks, and returns only the checks that are tagged with the
specified value.
This parameter can be repeated multiple times.
Example:
`SITE_ROOT/api/v1/checks/?tag=foo&amp;tag=bar`
### Example Request
```bash
curl --header "X-Api-Key: your-api-key" SITE_ROOT/api/v1/checks/
```
### Example Response
```json
{
"checks": [
{
"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc",
"desc": "Longer free-form description goes here",
"grace": 900,
"last_ping": "2017-01-04T13:24:39.903464+00:00",
"n_pings": 1,
"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",
"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"
},
{
"channels": "",
"desc": "",
"grace": 3600,
"last_ping": null,
"n_pings": 0,
"name": "Api test 2",
"next_ping": null,
"pause_url": "SITE_ROOT/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced/pause",
"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"
}
]
}
```
When using the read-only API key, the following fields are omitted:
`ping_url`, `update_url`, `pause_url`, `channels`. An extra `unique_key` field
is added. This identifier is stable across API calls. Example:
```json
{
"checks": [
{
"desc": "Longer free-form description goes here",
"grace": 900,
"last_ping": "2017-01-04T13:24:39.903464+00:00",
"n_pings": 1,
"name": "Api test 1",
"status": "up",
"tags": "foo",
"timeout": 3600,
"unique_key": "2872190d95224bad120f41d3c06aab94b8175bb6"
},
{
"desc": "",
"grace": 3600,
"last_ping": null,
"n_pings": 0,
"name": "Api test 2",
"next_ping": null,
"schedule": "0/10 * * * *",
"status": "new",
"tags": "bar baz",
"tz": "UTC",
"unique_key": "9b5fc29129560ff2c5c1803803a7415e4f80cf7e"
}
]
}
```
## Create a Check {: #create-check .rule }
`POST SITE_ROOT/api/v1/checks/`
Creates a new check and returns its ping URL.
All request parameters are optional and will use their default
values if omitted.
This API call can be used to create both "simple" and "cron" checks.
To create a "simple" check, specify the "timeout" parameter.
To create a "cron" check, specify the "schedule" and "tz" parameters.
### Request Parameters
name
: string, optional, default value: ""
Name for the new check.
tags
: string, optional, default value: ""
A space-delimited list of tags for the new check.
Example:
<pre>{"tags": "reports staging"}</pre>
desc
: string, optional.
Description for the check.
timeout
: number, optional, default value: {{ default_timeout }}.
A number of seconds, the expected period of this check.
Minimum: 60 (one minute), maximum: 2592000 (30 days).
Example for 5 minute timeout:
<pre>{"kind": "simple", "timeout": 300}</pre>
grace
: number, optional, default value: {{ default_grace }}.
A number of seconds, the grace period for this check.
Minimum: 60 (one minute), maximum: 2592000 (30 days).
schedule
: string, optional, default value: "* * * * *".
A cron expression defining this check's schedule.
If you specify both "timeout" and "schedule" parameters, "timeout" will be
ignored and "schedule" will be used.
Example for a check running every half-hour:
<pre>{"schedule": "0,30 * * * *"}</pre>
tz
: string, optional, default value: "UTC".
Server's timezone. This setting only has effect in combination with the
"schedule" paremeter.
Example:
<pre>{"tz": "Europe/Riga"}</pre>
channels
: string, optional
By default, if a check is created through API, no notification channels
(integrations) are assigned to it. So, when the check goes up or down, no
notifications will get sent.
Set this field to a special value "*" to automatically assign all existing
integrations.
To assign specific integrations, use a comma-separated list of integration
identifiers. Use the [Get a List of Existing Integrations](#list-channels) call to
look up integration identifiers.
unique
: array of string values, optional, default value: [].
Before creating a check, look for existing checks, filtered by fields listed
in `unique`. If a matching check is found, return it with HTTP status code 200.
If no matching check is found, proceed as normal: create a check and return it
with HTTP status code 201.
The accepted values are: `name`, `tags`, `timeout` and `grace`.
Example:
<pre>{"name": "Backups", unique: ["name"]}</pre>
In this example, if a check named "Backups" exists, it will be returned.
Otherwise, a new check will be created and returned.
### Response Codes
201 Created
: Returned if the check was successfully created.
200 OK
: Returned if the `unique` parameter was used and an existing check was matched.
403 Forbidden
: Returned if the account's check limit has been reached. For free accounts,
the limit is 20 checks per account.
### Example Request
```bash
curl SITE_ROOT/api/v1/checks/ \
--header "X-Api-Key: your-api-key" \
--data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
```
Or, alternatively:
```bash
curl SITE_ROOT/api/v1/checks/ \
--data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
```
### Example Response
```json
{
"channels": "",
"desc": "",
"grace": 60,
"last_ping": null,
"n_pings": 0,
"name": "Backups",
"next_ping": null,
"pause_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause",
"ping_url": "PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc",
"status": "new",
"tags": "prod www",
"timeout": 3600,
"update_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc",
}
```
## Update an Existing Check {: #update-check .rule }
`POST SITE_ROOT/api/v1/checks/<uuid>`
Updates an existing check. All request parameters are optional. The check is
updated only with the supplied request parameters. If any parameter is omitted,
its value is left unchanged.
### Request Parameters
name
: string, optional.
Name for the check.
tags
: string, optional.
A space-delimited list of tags for the check.
Example:
<pre>{"tags": "reports staging"}</pre>
desc
: string, optional.
Description for the check.
timeout
: number, optional.
A number of seconds, the expected period of this check.
Minimum: 60 (one minute), maximum: 2592000 (30 days).
Example for 5 minute timeout:
<pre>{"kind": "simple", "timeout": 300}</pre>
grace
: number, optional.
A number of seconds, the grace period for this check.
Minimum: 60 (one minute), maximum: 2592000 (30 days).
schedule
: string, optional.
A cron expression defining this check's schedule.
If you specify both "timeout" and "schedule" parameters, "timeout" will be
ignored and "schedule" will be used.
Example for a check running every half-hour:
<pre>{"schedule": "0,30 * * * *"}</pre>
tz
: string, optional.
Server's timezone. This setting only has effect in combination with the
"schedule" paremeter.
Example:
<pre>{"tz": "Europe/Riga"}</pre>
channels
: string, optional.
Set this field to a special value "*" to automatically assign all existing
notification channels.
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:
<pre>{"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"}</pre>
### Response Codes
200 OK
: Returned if the check was successfully updated.
### Example Request
```bash
curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \
--header "X-Api-Key: your-api-key" \
--data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
```
Or, alternatively:
```bash
curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \
--data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
```
### Example Response
```json
{
"channels": "",
"desc": "",
"grace": 60,
"last_ping": null,
"n_pings": 0,
"name": "Backups",
"next_ping": null,
"pause_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause",
"ping_url": "PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc",
"status": "new",
"tags": "prod www",
"timeout": 3600,
"update_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc",
}
```
## Pause Monitoring of a Check {: #pause-check .rule }
`POST SITE_ROOT/api/v1/checks/<uuid>/pause`
Disables monitoring for a check, without removing it. The check goes into a "paused"
state. You can resume monitoring of the check by pinging it.
This API call has no request parameters.
### Example Request
```bash
curl SITE_ROOT/api/v1/checks/0c8983c9-9d73-446f-adb5-0641fdacc9d4/pause \
--request POST --header "X-Api-Key: your-api-key" --data ""
```
Note: the `--data ""` argument forces curl to send a `Content-Length` request header
even though the request body is empty. For HTTP POST requests, the `Content-Length`
header is sometimes required by some network proxies and web servers.
### Example Response
```json
{
"channels": "",
"desc": "",
"grace": 60,
"last_ping": null,
"n_pings": 0,
"name": "Backups",
"next_ping": null,
"pause_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause",
"ping_url": "PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc",
"status": "paused",
"tags": "prod www",
"timeout": 3600,
"update_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc"
}
```
## Delete Check {: #delete-check .rule }
`DELETE SITE_ROOT/api/v1/checks/<uuid>`
Permanently deletes the check from user's account. Returns JSON representation of the
check that was just deleted.
This API call has no request parameters.
### Example Request
```bash
curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \
--request DELETE --header "X-Api-Key: your-api-key"
```
### Example Response
```json
{
"channels": "",
"desc": "",
"grace": 60,
"last_ping": null,
"n_pings": 0,
"name": "Backups",
"next_ping": null,
"pause_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause",
"ping_url": "PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc",
"status": "new",
"tags": "prod www",
"timeout": 3600,
"update_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc",
}
```
## Get a List of Existing Integrations {: #list-channels .rule }
`GET SITE_ROOT/api/v1/channels/`
Returns a list of integrations belonging to the user.
### Example Request
```bash
curl --header "X-Api-Key: your-api-key" SITE_ROOT/api/v1/channels/
```
### Example Response
```json
{
"channels": [
{
"id": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941",
"name": "My Work Email",
"kind": "email"
},
{
"id": "746a083e-f542-4554-be1a-707ce16d3acc",
"name": "My Phone",
"kind": "sms"
}
]
}
```

+ 1
- 3
templates/front/base_docs.html View File

@ -33,9 +33,7 @@
{% include "front/docs_nav_item.html" with slug="attaching_logs" title="Attaching logs" %} {% include "front/docs_nav_item.html" with slug="attaching_logs" title="Attaching logs" %}
<li class="nav-header">Developer Tools</li> <li class="nav-header">Developer Tools</li>
<li{% if section == "api" %} class="active"{% endif %}>
<a href="{% url 'hc-docs-api' %}">Management API</a>
</li>
{% include "front/docs_nav_item.html" with slug="api" title="Management API" %}
{% include "front/docs_nav_item.html" with slug="resources" title="Third-party resources" %} {% include "front/docs_nav_item.html" with slug="resources" title="Third-party resources" %}
<li class="nav-header">Cron</li> <li class="nav-header">Cron</li>


+ 0
- 500
templates/front/docs_api.html View File

@ -1,500 +0,0 @@
{% extends "front/base_docs.html" %}
{% load compress static hc_extras %}
{% block title %}API Reference - {% site_name %}{% endblock %}
{% block description %}
<meta name="description" content="Build advanced integrations and custom dashboards using {% site_name %} REST API calls.">
{% endblock %}
{% block docs_content %}
<h2>API Reference</h2>
<p>{% site_name %} REST API supports listing, creating,
updating, pausing and deleting checks in user's account.
</p>
<h2>API Endpoints</h2>
<table class="table table-bordered">
<tr>
<td><a href="#list-checks">Get a list of existing checks</a></td>
<td>
<code>GET {{ SITE_ROOT }}/api/v1/checks/</code>
</td>
</tr>
<tr>
<td><a href="#create-check">Create a new check</a></td>
<td>
<code>POST {{ SITE_ROOT }}/api/v1/checks/</code>
</td>
</tr>
<tr>
<td><a href="#update-check">Update an existing check</a></td>
<td>
<code>POST {{ SITE_ROOT }}/api/v1/checks/&lt;code&gt;</code>
</td>
</tr>
<tr>
<td><a href="#pause-check">Pause monitoring of a check</a></td>
<td>
<code>POST {{ SITE_ROOT }}/api/v1/checks/&lt;code&gt;/pause</code>
</td>
</tr>
<tr>
<td><a href="#delete-check">Delete check</a></td>
<td>
<code>DELETE {{ SITE_ROOT }}/api/v1/checks/&lt;code&gt;</code>
</td>
</tr>
<tr>
<td><a href="#list-channels">Get a list of existing integrations</a></td>
<td>
<code>GET {{ SITE_ROOT }}/api/v1/channels/</code>
</td>
</tr>
</table>
<h2>Authentication</h2>
<p>Your requests to {% site_name %} REST API must authenticate using an
API key. Each project in your {% site_name %} account has separate API keys.
There are no account-wide API keys. By default, a project on {% site_name %} doesn't have
an API key. You can create read-write and read-only API keys in the
<b>Project Settings</b> page.
</p>
<table class="table table-bordered">
<tr>
<td>Regular API keys</td>
<td>Have full access to all documented API endpoints.</td>
</tr>
<tr>
<td>Read-only API keys</td>
<td>Only work with the
<a href="#list-checks">Get a list of existing checks</a>
endpoint. Some fields are omitted from the API responses.</td>
</tr>
</table>
<p>The client can authenticate itself by sending an appropriate HTTP
request header. The header's name should be <code>X-Api-Key</code> and
its value should be your API key.
</p>
<p> Alternatively, for POST requests with a JSON request body,
the client can include an <code>api_key</code> field in the JSON document.
See below the "Create a check" section for an example.
</p>
<h2>API Requests</h2>
<p>
For POST requests, the {% site_name %} API expects request body to be
a JSON document (<em>not</em> a <code>multipart/form-data</code> encoded
form data).
</p>
<h2>API Responses</h2>
<p>
{% site_name %} uses HTTP status codes wherever possible.
In general, 2xx class indicates success, 4xx indicates an client error,
and 5xx indicates a server error.
</p>
<p>
The response may contain a JSON document with additional data.
</p>
<!-- ********************************************************************** /-->
<a class="section" name="list-checks">
<h2 class="rule">Get a List of Existing Checks</h2>
</a>
<div class="api-path">GET {{ SITE_ROOT }}/api/v1/checks/</div>
<p>Returns a list of checks belonging to the user, optionally filtered by
one or more tags.</p>
<h3 class="api-section">Query String Parameters</h3>
<table class="table">
<tr>
<th>tag=&lt;value&gt;</th>
<td>
<p>
Filters the checks, and returns only the checks that
are tagged with the specified value.
</p>
<p>
This parameter can be repeated multiple times.
</p>
<p>Example:</p>
<pre>{{ SITE_ROOT }}/api/v1/checks/?tag=foo&amp;tag=bar</pre>
</td>
</tr>
</table>
<h3 class="api-section">Example Request</h3>
{% include "front/snippets/list_checks_request.html" %}
<h3 class="api-section">Example Response</h3>
{% include "front/snippets/list_checks_response.html" %}
<p>When using the read-only API key, the following fields are omitted:
<code>ping_url</code>, <code>update_url</code>, <code>pause_url</code>,
<code>channels</code>. An extra <code>unique_key</code> field is added.
This identifier is stable across API calls. Example:
</p>
{% include "front/snippets/list_checks_response_readonly.html" %}
<!-- ********************************************************************** /-->
<a class="section" name="create-check">
<h2 class="rule">Create a Check</h2>
</a>
<div class="api-path">POST {{ SITE_ROOT }}/api/v1/checks/</div>
<strong></strong>
<p>
Creates a new check and returns its ping URL.
All request parameters are optional and will use their default
values if omitted.
</p>
<p>This API call can be used to create both "simple" and "cron" checks.
To create a "simple" check, specify the "timeout" parameter.
To create a "cron" check, specify the "schedule" and "tz" parameters.
</p>
<h3 class="api-section">Request Parameters</h3>
<table class="table">
<tr>
<th>name</th>
<td>
<p>string, optional, default value: ""</p>
<p>Name for the new check.</p>
</td>
</tr>
<tr>
<th>tags</th>
<td>
<p>string, optional, default value: ""</p>
<p>A space-delimited list of tags for the new check.</p>
<p>Example:</p>
<pre>{"tags": "reports staging"}</pre>
</td>
</tr>
<tr>
<th>desc</th>
<td>
<p>string, optional.</p>
<p>Description for the check.</p>
</td>
</tr>
<tr>
<th>timeout</th>
<td>
<p>number, optional, default value: {{ default_timeout }}.</p>
<p>A number of seconds, the expected period of this check.</p>
<p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
<p>Example for 5 minute timeout:</p>
<pre>{"kind": "simple", "timeout": 300}</pre>
</td>
</tr>
<tr>
<th>grace</th>
<td>
<p>number, optional, default value: {{ default_grace }}.</p>
<p>A number of seconds, the grace period for this check.</p>
<p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
</td>
</tr>
<tr>
<th>schedule</th>
<td>
<p>string, optional, default value: "* * * * *".</p>
<p>A cron expression defining this check's schedule.</p>
<p>If you specify both "timeout" and "schedule" parameters,
"timeout" will be ignored and "schedule" will be used.</p>
<p>Example for a check running every half-hour:</p>
<pre>{"schedule": "0,30 * * * *"}</pre>
</td>
</tr>
<tr>
<th>tz</th>
<td>
<p>string, optional, default value: "UTC".</p>
<p>Server's timezone. This setting only has effect in combination
with the "schedule" paremeter.</p>
<p>Example:</p>
<pre>{"tz": "Europe/Riga"}</pre>
</td>
</tr>
<tr>
<th>channels</th>
<td>
<p>string, optional</p>
<p>By default, if a check is created through API, no notification
channels (integrations) are assigned to it.
So, when the check goes up or down, no notifications will get
sent.</p>
<p>Set this field to a special value "*"
to automatically assign all existing integrations.</p>
<p>To assign specific integrations, use a comma-separated
list of integration identifiers. Use the
<a href="#list-channels">Get a List of Existing Integrations</a>
call to look up integration identifiers.
</p>
</td>
</tr>
<tr>
<th>unique</th>
<td>
<p>array of string values, optional, default value: [].</p>
<p>Before creating a check, look for existing checks, filtered
by fields listed in <code>unique</code>. If a matching check is
found, return it with HTTP status code 200. If no matching check is
found, proceed as normal: create a check and return it
with HTTP status code 201.</p>
<p>The accepted values are: <code>name</code>,
<code>tags</code>, <code>timeout</code> and <code>grace</code>.</p>
<p>Example:</p>
<pre>{"name": "Backups", unique: ["name"]}</pre>
<p>In this example, if a check named "Backups" exists, it will
be returned. Otherwise, a new check will be created and
returned.</p>
</td>
</tr>
</table>
<h3 class="api-section">Response Codes</h3>
<table class="table">
<tr>
<th>201 Created</th>
<td>Returned if the check was successfully created.</td>
</tr>
<tr>
<th>200 OK</th>
<td>Returned if the <code>unique</code> parameter was used and an
existing check was matched.</td>
</tr>
<tr>
<th>403 Forbidden</th>
<td>Returned if the account's check limit has been reached.
For free accounts, the limit is 20 checks per account.</td>
</tr>
</table>
<h3 class="api-section">Example Request</h3>
{% include "front/snippets/create_check_request_a.html" %}
<br>
<p>Or, alternatively:</p>
{% include "front/snippets/create_check_request_b.html" %}
<h3 class="api-section">Example Response</h3>
{% include "front/snippets/create_check_response.html" %}
<!-- ********************************************************************** /-->
<a class="section" name="update-check">
<h2 class="rule">Update an Existing Check</h2>
</a>
<div class="api-path">POST {{ SITE_ROOT }}/api/v1/checks/&lt;code&gt;</div>
<strong></strong>
<p>
Updates an existing check. All request parameters are optional. The
check is updated only with the supplied request parameters.
If any parameter is omitted, its value is left unchanged.
</p>
<h3 class="api-section">Request Parameters</h3>
<table class="table">
<tr>
<th>name</th>
<td>
<p>string, optional.</p>
<p>Name for the check.</p>
</td>
</tr>
<tr>
<th>tags</th>
<td>
<p>string, optional.</p>
<p>A space-delimited list of tags for the check.</p>
<p>Example:</p>
<pre>{"tags": "reports staging"}</pre>
</td>
</tr>
<tr>
<th>desc</th>
<td>
<p>string, optional.</p>
<p>Description for the check.</p>
</td>
</tr>
<tr>
<th>timeout</th>
<td>
<p>number, optional.</p>
<p>A number of seconds, the expected period of this check.</p>
<p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
<p>Example for 5 minute timeout:</p>
<pre>{"kind": "simple", "timeout": 300}</pre>
</td>
</tr>
<tr>
<th>grace</th>
<td>
<p>number, optional.</p>
<p>A number of seconds, the grace period for this check.</p>
<p>Minimum: 60 (one minute), maximum: 2592000 (30 days).</p>
</td>
</tr>
<tr>
<th>schedule</th>
<td>
<p>string, optional.</p>
<p>A cron expression defining this check's schedule.</p>
<p>If you specify both "timeout" and "schedule" parameters,
"timeout" will be ignored and "schedule" will be used.</p>
<p>Example for a check running every half-hour:</p>
<pre>{"schedule": "0,30 * * * *"}</pre>
</td>
</tr>
<tr>
<th>tz</th>
<td>
<p>string, optional.</p>
<p>Server's timezone. This setting only has effect in combination
with the "schedule" paremeter.</p>
<p>Example:</p>
<pre>{"tz": "Europe/Riga"}</pre>
</td>
</tr>
<tr>
<th>channels</th>
<td>
<p>string, optional.</p>
<p>Set this field to a special value "*"
to automatically assign all existing notification channels.
</p>
<p>Set this field to a special value "" (empty string)
to automatically <em>unassign</em> all notification channels.
</p>
<p>Set this field to a comma-separated list of channel identifiers
to assign specific notification channels.
</p>
<p>Example:</p>
<pre>{"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc"}</pre>
</td>
</tr>
</table>
<h3 class="api-section">Response Codes</h3>
<table class="table">
<tr>
<th>200 OK</th>
<td>Returned if the check was successfully updated.</td>
</tr>
</table>
<h3 class="api-section">Example Request</h3>
{% include "front/snippets/update_check_request_a.html" %}
<br>
<p>Or, alternatively:</p>
{% include "front/snippets/update_check_request_b.html" %}
<h3 class="api-section">Example Response</h3>
{% include "front/snippets/create_check_response.html" %}
<!-- ********************************************************************** /-->
<a class="section" name="pause-check">
<h2 class="rule">Pause Monitoring of a Check</h2>
</a>
<div class="api-path">POST {{ SITE_ROOT }}/api/v1/checks/&lt;uuid&gt;/pause</div>
<p>
Disables monitoring for a check, without removing it. The check goes
into a "paused" state. You can resume monitoring of the check by pinging
it.
</p>
<p>
This API call has no request parameters.
</p>
<h3 class="api-section">Example Request</h3>
{% include "front/snippets/pause_check_request.html" %}
<p>Note: the <code>--data ""</code> argument forces curl to send a
<code>Content-Length</code> request header even though the request body
is empty. For HTTP POST requests, the <code>Content-Length</code> header
is sometimes required by some network proxies and web servers.
</p>
<h3 class="api-section">Example Response</h3>
{% include "front/snippets/pause_check_response.html" %}
<!-- ********************************************************************** /-->
<a class="section" name="delete-check">
<h2 class="rule">Delete Check</h2>
</a>
<div class="api-path">DELETE {{ SITE_ROOT }}/api/v1/checks/&lt;uuid&gt;</div>
<p>
Permanently deletes the check from user's account. Returns JSON
representation of the check that was just deleted.
</p>
<p>
This API call has no request parameters.
</p>
<h3 class="api-section">Example Request</h3>
{% include "front/snippets/delete_check_request.html" %}
<h3 class="api-section">Example Response</h3>
{% include "front/snippets/create_check_response.html" %}
<!-- ********************************************************************** /-->
<a class="section" name="list-channels">
<h2 class="rule">Get a List of Existing Integrations</h2>
</a>
<div class="api-path">GET {{ SITE_ROOT }}/api/v1/channels/</div>
<p>Returns a list of integrations belonging to the user.</p>
<h3 class="api-section">Example Request</h3>
{% include "front/snippets/list_channels_request.html" %}
<h3 class="api-section">Example Response</h3>
{% include "front/snippets/list_channels_response.html" %}
{% endblock %}
{% block scripts %}
{% compress js %}
<script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/clipboard.min.js' %}"></script>
<script src="{% static 'js/snippet-copy.js' %}"></script>
{% endcompress %}
{% endblock %}

+ 1
- 1
templates/front/docs_single.html View File

@ -6,7 +6,7 @@
{% block keywords %}{% endblock %} {% block keywords %}{% endblock %}
{% block docs_content %} {% block docs_content %}
<div class="docs-content">{{ content|safe }}</div>
<div class="docs-content docs-{{ section }}">{{ content|safe }}</div>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}


+ 0
- 4
templates/front/snippets/create_check_request_a.html View File

@ -1,4 +0,0 @@
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/ <span class="se">\</span>
--header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> <span class="se">\</span>
--data <span class="s1">&#39;{&quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
</pre></div>

+ 0
- 3
templates/front/snippets/create_check_request_a.txt View File

@ -1,3 +0,0 @@
curl SITE_ROOT/api/v1/checks/ \
--header "X-Api-Key: your-api-key" \
--data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'

+ 0
- 3
templates/front/snippets/create_check_request_b.html View File

@ -1,3 +0,0 @@
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/ <span class="se">\</span>
--data <span class="s1">&#39;{&quot;api_key&quot;: &quot;your-api-key&quot;, &quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
</pre></div>

+ 0
- 2
templates/front/snippets/create_check_request_b.txt View File

@ -1,2 +0,0 @@
curl SITE_ROOT/api/v1/checks/ \
--data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'

+ 0
- 16
templates/front/snippets/create_check_response.html View File

@ -1,16 +0,0 @@
<div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ SITE_ROOT }}/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ PING_ENDPOINT }}f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ SITE_ROOT }}/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="p">}</span>
</pre></div>

+ 0
- 15
templates/front/snippets/create_check_response.txt View File

@ -1,15 +0,0 @@
{
"channels": "",
"desc": "",
"grace": 60,
"last_ping": null,
"n_pings": 0,
"name": "Backups",
"next_ping": null,
"pause_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause",
"ping_url": "PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc",
"status": "new",
"tags": "prod www",
"timeout": 3600,
"update_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc",
}

+ 0
- 3
templates/front/snippets/delete_check_request.html View File

@ -1,3 +0,0 @@
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
--request DELETE --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span>
</pre></div>

+ 0
- 2
templates/front/snippets/delete_check_request.txt View File

@ -1,2 +0,0 @@
curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \
--request DELETE --header "X-Api-Key: your-api-key"

+ 0
- 2
templates/front/snippets/list_channels_request.html View File

@ -1,2 +0,0 @@
<div class="highlight"><pre><span></span>curl --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> {{ SITE_ROOT }}/api/v1/channels/
</pre></div>

+ 0
- 1
templates/front/snippets/list_channels_request.txt View File

@ -1 +0,0 @@
curl --header "X-Api-Key: your-api-key" SITE_ROOT/api/v1/channels/

+ 0
- 15
templates/front/snippets/list_channels_response.html View File

@ -1,15 +0,0 @@
<div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;4ec5a071-2d08-4baa-898a-eb4eb3cd6941&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Work Email&quot;</span><span class="p">,</span>
<span class="nt">&quot;kind&quot;</span><span class="p">:</span> <span class="s2">&quot;email&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;746a083e-f542-4554-be1a-707ce16d3acc&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Phone&quot;</span><span class="p">,</span>
<span class="nt">&quot;kind&quot;</span><span class="p">:</span> <span class="s2">&quot;sms&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>

+ 0
- 14
templates/front/snippets/list_channels_response.txt View File

@ -1,14 +0,0 @@
{
"channels": [
{
"id": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941",
"name": "My Work Email",
"kind": "email"
},
{
"id": "746a083e-f542-4554-be1a-707ce16d3acc",
"name": "My Phone",
"kind": "sms"
}
]
}

+ 0
- 2
templates/front/snippets/list_checks_request.html View File

@ -1,2 +0,0 @@
<div class="highlight"><pre><span></span>curl --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> {{ SITE_ROOT }}/api/v1/checks/
</pre></div>

+ 0
- 1
templates/front/snippets/list_checks_request.txt View File

@ -1 +0,0 @@
curl --header "X-Api-Key: your-api-key" SITE_ROOT/api/v1/checks/

+ 0
- 36
templates/front/snippets/list_checks_response.html View File

@ -1,36 +0,0 @@
<div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;checks&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Longer free-form description goes here&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">900</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-01-04T13:24:39.903464+00:00&quot;</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Api test 1&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-01-04T14:24:39.903464+00:00&quot;</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ SITE_ROOT }}/api/v1/checks/662ebe36-ecab-48db-afe3-e20029cb71e6/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ PING_ENDPOINT }}662ebe36-ecab-48db-afe3-e20029cb71e6&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;up&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;foo&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ SITE_ROOT }}/api/v1/checks/662ebe36-ecab-48db-afe3-e20029cb71e6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Api test 2&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ SITE_ROOT }}/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ PING_ENDPOINT }}9d17c61f-5c4f-4cab-b517-11e6b2679ced&quot;</span><span class="p">,</span>
<span class="nt">&quot;schedule&quot;</span><span class="p">:</span> <span class="s2">&quot;0/10 * * * *&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;bar baz&quot;</span><span class="p">,</span>
<span class="nt">&quot;tz&quot;</span><span class="p">:</span> <span class="s2">&quot;UTC&quot;</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ SITE_ROOT }}/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>

+ 0
- 35
templates/front/snippets/list_checks_response.txt View File

@ -1,35 +0,0 @@
{
"checks": [
{
"channels": "4ec5a071-2d08-4baa-898a-eb4eb3cd6941,746a083e-f542-4554-be1a-707ce16d3acc",
"desc": "Longer free-form description goes here",
"grace": 900,
"last_ping": "2017-01-04T13:24:39.903464+00:00",
"n_pings": 1,
"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",
"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"
},
{
"channels": "",
"desc": "",
"grace": 3600,
"last_ping": null,
"n_pings": 0,
"name": "Api test 2",
"next_ping": null,
"pause_url": "SITE_ROOT/api/v1/checks/9d17c61f-5c4f-4cab-b517-11e6b2679ced/pause",
"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"
}
]
}

+ 0
- 29
templates/front/snippets/list_checks_response_readonly.html View File

@ -1,29 +0,0 @@
<div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;checks&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;Longer free-form description goes here&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">900</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-01-04T13:24:39.903464+00:00&quot;</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Api test 1&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;up&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;foo&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;unique_key&quot;</span><span class="p">:</span> <span class="s2">&quot;2872190d95224bad120f41d3c06aab94b8175bb6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Api test 2&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;schedule&quot;</span><span class="p">:</span> <span class="s2">&quot;0/10 * * * *&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;new&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;bar baz&quot;</span><span class="p">,</span>
<span class="nt">&quot;tz&quot;</span><span class="p">:</span> <span class="s2">&quot;UTC&quot;</span><span class="p">,</span>
<span class="nt">&quot;unique_key&quot;</span><span class="p">:</span> <span class="s2">&quot;9b5fc29129560ff2c5c1803803a7415e4f80cf7e&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>

+ 0
- 28
templates/front/snippets/list_checks_response_readonly.txt View File

@ -1,28 +0,0 @@
{
"checks": [
{
"desc": "Longer free-form description goes here",
"grace": 900,
"last_ping": "2017-01-04T13:24:39.903464+00:00",
"n_pings": 1,
"name": "Api test 1",
"status": "up",
"tags": "foo",
"timeout": 3600,
"unique_key": "2872190d95224bad120f41d3c06aab94b8175bb6"
},
{
"desc": "",
"grace": 3600,
"last_ping": null,
"n_pings": 0,
"name": "Api test 2",
"next_ping": null,
"schedule": "0/10 * * * *",
"status": "new",
"tags": "bar baz",
"tz": "UTC",
"unique_key": "9b5fc29129560ff2c5c1803803a7415e4f80cf7e"
}
]
}

+ 0
- 3
templates/front/snippets/pause_check_request.html View File

@ -1,3 +0,0 @@
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/0c8983c9-9d73-446f-adb5-0641fdacc9d4/pause <span class="se">\</span>
--request POST --header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> --data <span class="s2">&quot;&quot;</span>
</pre></div>

+ 0
- 2
templates/front/snippets/pause_check_request.txt View File

@ -1,2 +0,0 @@
curl SITE_ROOT/api/v1/checks/0c8983c9-9d73-446f-adb5-0641fdacc9d4/pause \
--request POST --header "X-Api-Key: your-api-key" --data ""

+ 0
- 16
templates/front/snippets/pause_check_response.html View File

@ -1,16 +0,0 @@
<div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;channels&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;desc&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="nt">&quot;grace&quot;</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span>
<span class="nt">&quot;last_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;n_pings&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Backups&quot;</span><span class="p">,</span>
<span class="nt">&quot;next_ping&quot;</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
<span class="nt">&quot;pause_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ SITE_ROOT }}/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause&quot;</span><span class="p">,</span>
<span class="nt">&quot;ping_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ PING_ENDPOINT }}f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span><span class="p">,</span>
<span class="nt">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;paused&quot;</span><span class="p">,</span>
<span class="nt">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;prod www&quot;</span><span class="p">,</span>
<span class="nt">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span>
<span class="nt">&quot;update_url&quot;</span><span class="p">:</span> <span class="s2">&quot;{{ SITE_ROOT }}/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc&quot;</span>
<span class="p">}</span>
</pre></div>

+ 0
- 15
templates/front/snippets/pause_check_response.txt View File

@ -1,15 +0,0 @@
{
"channels": "",
"desc": "",
"grace": 60,
"last_ping": null,
"n_pings": 0,
"name": "Backups",
"next_ping": null,
"pause_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc/pause",
"ping_url": "PING_ENDPOINTf618072a-7bde-4eee-af63-71a77c5723bc",
"status": "paused",
"tags": "prod www",
"timeout": 3600,
"update_url": "SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc"
}

+ 2
- 2
templates/front/snippets/python_requests_fail.html View File

@ -5,9 +5,9 @@
<span class="c1"># Do your number crunching, backup dumping, newsletter sending work here.</span> <span class="c1"># Do your number crunching, backup dumping, newsletter sending work here.</span>
<span class="c1"># Return a truthy value on success.</span> <span class="c1"># Return a truthy value on success.</span>
<span class="c1"># Return a falsy value or throw an exception on failure.</span> <span class="c1"># Return a falsy value or throw an exception on failure.</span>
<span class="k">return</span> <span class="bp">True</span>
<span class="k">return</span> <span class="kc">True</span>
<span class="n">success</span> <span class="o">=</span> <span class="bp">False</span>
<span class="n">success</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">try</span><span class="p">:</span> <span class="k">try</span><span class="p">:</span>
<span class="n">success</span> <span class="o">=</span> <span class="n">do_work</span><span class="p">()</span> <span class="n">success</span> <span class="o">=</span> <span class="n">do_work</span><span class="p">()</span>
<span class="k">finally</span><span class="p">:</span> <span class="k">finally</span><span class="p">:</span>


+ 1
- 1
templates/front/snippets/python_requests_start.html View File

@ -14,7 +14,7 @@
<span class="c1"># TODO: run the job here</span> <span class="c1"># TODO: run the job here</span>
<span class="n">fib</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="k">if</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">2</span> <span class="k">else</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span> <span class="n">fib</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="k">if</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">2</span> <span class="k">else</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;F(42) = </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">fib</span><span class="p">(</span><span class="mi">42</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;F(42) = </span><span class="si">%d</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">fib</span><span class="p">(</span><span class="mi">42</span><span class="p">))</span>
<span class="c1"># Signal success:</span> <span class="c1"># Signal success:</span>
<span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">)</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">URL</span><span class="p">)</span>


+ 0
- 4
templates/front/snippets/update_check_request_a.html View File

@ -1,4 +0,0 @@
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
--header <span class="s2">&quot;X-Api-Key: your-api-key&quot;</span> <span class="se">\</span>
--data <span class="s1">&#39;{&quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
</pre></div>

+ 0
- 3
templates/front/snippets/update_check_request_a.txt View File

@ -1,3 +0,0 @@
curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \
--header "X-Api-Key: your-api-key" \
--data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'

+ 0
- 3
templates/front/snippets/update_check_request_b.html View File

@ -1,3 +0,0 @@
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc <span class="se">\</span>
--data <span class="s1">&#39;{&quot;api_key&quot;: &quot;your-api-key&quot;, &quot;name&quot;: &quot;Backups&quot;, &quot;tags&quot;: &quot;prod www&quot;, &quot;timeout&quot;: 3600, &quot;grace&quot;: 60}&#39;</span>
</pre></div>

+ 0
- 2
templates/front/snippets/update_check_request_b.txt View File

@ -1,2 +0,0 @@
curl SITE_ROOT/api/v1/checks/f618072a-7bde-4eee-af63-71a77c5723bc \
--data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'

Loading…
Cancel
Save