forked from GithubBackups/healthchecks
Merge branch 'cdax-snippet-copy'
This commit is contained in:
commit
b2f951c8a6
@ -27,10 +27,12 @@ class Command(BaseCommand):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Invocation examples
|
# Invocation examples
|
||||||
_process("bash", lexers.BashLexer())
|
_process("bash_curl", lexers.BashLexer())
|
||||||
|
_process("bash_wget", lexers.BashLexer())
|
||||||
_process("browser", lexers.JavascriptLexer())
|
_process("browser", lexers.JavascriptLexer())
|
||||||
_process("crontab", lexers.BashLexer())
|
_process("crontab", lexers.BashLexer())
|
||||||
_process("python", lexers.PythonLexer())
|
_process("python_urllib2", lexers.PythonLexer())
|
||||||
|
_process("python_requests", lexers.PythonLexer())
|
||||||
_process("php", lexers.PhpLexer())
|
_process("php", lexers.PhpLexer())
|
||||||
_process("powershell", lexers.shell.PowerShellLexer())
|
_process("powershell", lexers.shell.PowerShellLexer())
|
||||||
_process("node", lexers.JavascriptLexer())
|
_process("node", lexers.JavascriptLexer())
|
||||||
@ -38,7 +40,8 @@ class Command(BaseCommand):
|
|||||||
# API examples
|
# API examples
|
||||||
_process("list_checks_request", lexers.BashLexer())
|
_process("list_checks_request", lexers.BashLexer())
|
||||||
_process("list_checks_response", lexers.JsonLexer())
|
_process("list_checks_response", lexers.JsonLexer())
|
||||||
_process("create_check_request", lexers.BashLexer())
|
_process("create_check_request_a", lexers.BashLexer())
|
||||||
|
_process("create_check_request_b", lexers.BashLexer())
|
||||||
_process("create_check_response", lexers.JsonLexer())
|
_process("create_check_response", lexers.JsonLexer())
|
||||||
_process("pause_check_request", lexers.BashLexer())
|
_process("pause_check_request", lexers.BashLexer())
|
||||||
_process("pause_check_response", lexers.JsonLexer())
|
_process("pause_check_response", lexers.JsonLexer())
|
||||||
|
@ -75,3 +75,7 @@ body {
|
|||||||
.dialog-body {
|
.dialog-body {
|
||||||
margin: 24px 0;
|
margin: 24px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
border: 0;
|
||||||
|
}
|
@ -55,7 +55,8 @@ a.section:hover {
|
|||||||
.page-docs code {
|
.page-docs code {
|
||||||
padding: 2px 4px;
|
padding: 2px 4px;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
color: #427d5e;
|
color: #333;
|
||||||
background-color: #f2f9f6;
|
background-color: #f5f5f5;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'icomoon';
|
font-family: 'icomoon';
|
||||||
src: url('../fonts/icomoon.eot?j2asdo');
|
src: url('../fonts/icomoon.eot?cxijqz');
|
||||||
src: url('../fonts/icomoon.eot?j2asdo#iefix') format('embedded-opentype'),
|
src: url('../fonts/icomoon.eot?cxijqz#iefix') format('embedded-opentype'),
|
||||||
url('../fonts/icomoon.ttf?j2asdo') format('truetype'),
|
url('../fonts/icomoon.ttf?cxijqz') format('truetype'),
|
||||||
url('../fonts/icomoon.woff?j2asdo') format('woff'),
|
url('../fonts/icomoon.woff?cxijqz') format('woff'),
|
||||||
url('../fonts/icomoon.svg?j2asdo#icomoon') format('svg');
|
url('../fonts/icomoon.svg?cxijqz#icomoon') format('svg');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
@ -24,6 +24,9 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-clippy:before {
|
||||||
|
content: "\e900";
|
||||||
|
}
|
||||||
.icon-cancel:before {
|
.icon-cancel:before {
|
||||||
content: "\e5c9";
|
content: "\e5c9";
|
||||||
}
|
}
|
||||||
|
@ -63,11 +63,20 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#show-usage-modal .modal-dialog {
|
#show-usage-modal .modal-dialog {
|
||||||
width: 1100px;
|
width: 1100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#show-usage-modal .modal-body {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#show-usage-modal pre {
|
||||||
|
margin: 0;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#show-usage-modal .highlight:nth-child(n+2) {
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
#show-usage-modal .tab-content {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
15
static/css/snippet-copy.css
Normal file
15
static/css/snippet-copy.css
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
.highlight {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight button {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 4px;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.1s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight:hover button {
|
||||||
|
opacity: 1
|
||||||
|
}
|
@ -50,26 +50,6 @@
|
|||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-welcome .highlight pre {
|
|
||||||
background: #FFF;
|
|
||||||
border-top: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
border-color: #dddddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
#email .instructions {
|
|
||||||
background: #FFF;
|
|
||||||
border: 1px solid #dddddd;
|
|
||||||
border-top: 0;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#email .email-address {
|
|
||||||
font-size: 18px;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#get-started {
|
#get-started {
|
||||||
margin-top: 4em;
|
margin-top: 4em;
|
||||||
}
|
}
|
||||||
@ -87,3 +67,27 @@
|
|||||||
width: 22px;
|
width: 22px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-welcome .tab-content {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-pane p {
|
||||||
|
padding: 15px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-welcome .highlight:nth-child(n+2) {
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-welcome .tab-pane pre {
|
||||||
|
margin-bottom: 0;
|
||||||
|
background: transparent;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-pane.tab-pane-email {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
Binary file not shown.
@ -19,4 +19,5 @@
|
|||||||
<glyph unicode="" glyph-name="ok" d="M426 212.667l384 384-60 62-324-324-152 152-60-60zM512 852.667c236 0 426-190 426-426s-190-426-426-426-426 190-426 426 190 426 426 426z" />
|
<glyph unicode="" glyph-name="ok" d="M426 212.667l384 384-60 62-324-324-152 152-60-60zM512 852.667c236 0 426-190 426-426s-190-426-426-426-426 190-426 426 190 426 426 426z" />
|
||||||
<glyph unicode="" glyph-name="delete" d="M810 768.667v-86h-596v86h148l44 42h212l44-42h148zM256 128.667v512h512v-512c0-46-40-86-86-86h-340c-46 0-86 40-86 86z" />
|
<glyph unicode="" glyph-name="delete" d="M810 768.667v-86h-596v86h148l44 42h212l44-42h148zM256 128.667v512h512v-512c0-46-40-86-86-86h-340c-46 0-86 40-86 86z" />
|
||||||
<glyph unicode="" glyph-name="settings" d="M512 276.667c82 0 150 68 150 150s-68 150-150 150-150-68-150-150 68-150 150-150zM830 384.667l90-70c8-6 10-18 4-28l-86-148c-6-10-16-12-26-8l-106 42c-22-16-46-32-72-42l-16-112c-2-10-10-18-20-18h-172c-10 0-18 8-20 18l-16 112c-26 10-50 24-72 42l-106-42c-10-4-20-2-26 8l-86 148c-6 10-4 22 4 28l90 70c-2 14-2 28-2 42s0 28 2 42l-90 70c-8 6-10 18-4 28l86 148c6 10 16 12 26 8l106-42c22 16 46 32 72 42l16 112c2 10 10 18 20 18h172c10 0 18-8 20-18l16-112c26-10 50-24 72-42l106 42c10 4 20 2 26-8l86-148c6-10 4-22-4-28l-90-70c2-14 2-28 2-42s0-28-2-42z" />
|
<glyph unicode="" glyph-name="settings" d="M512 276.667c82 0 150 68 150 150s-68 150-150 150-150-68-150-150 68-150 150-150zM830 384.667l90-70c8-6 10-18 4-28l-86-148c-6-10-16-12-26-8l-106 42c-22-16-46-32-72-42l-16-112c-2-10-10-18-20-18h-172c-10 0-18 8-20 18l-16 112c-26 10-50 24-72 42l-106-42c-10-4-20-2-26 8l-86 148c-6 10-4 22 4 28l90 70c-2 14-2 28-2 42s0 28 2 42l-90 70c-8 6-10 18-4 28l86 148c6 10 16 12 26 8l106-42c22 16 46 32 72 42l16 112c2 10 10 18 20 18h172c10 0 18-8 20-18l16-112c26-10 50-24 72-42l106 42c10 4 20 2 26-8l86-148c6-10 4-22-4-28l-90-70c2-14 2-28 2-42s0-28-2-42z" />
|
||||||
|
<glyph unicode="" glyph-name="clippy" horiz-adv-x="896" d="M704 64h-640v576h640v-192h64v320c0 35-29 64-64 64h-192c0 71-57 128-128 128s-128-57-128-128h-192c-35 0-64-29-64-64v-704c0-35 29-64 64-64h640c35 0 64 29 64 64v128h-64v-128zM192 768c29 0 29 0 64 0s64 29 64 64 29 64 64 64 64-29 64-64 32-64 64-64 33 0 64 0 64-29 64-64h-512c0 39 28 64 64 64zM128 256h128v64h-128v-64zM576 384v128l-256-192 256-192v128h320v128h-320zM128 128h192v64h-192v-64zM448 576h-320v-64h320v64zM256 448h-128v-64h128v64z" />
|
||||||
</font></defs></svg>
|
</font></defs></svg>
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
Binary file not shown.
41
static/js/snippet-copy.js
Normal file
41
static/js/snippet-copy.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
$(function() {
|
||||||
|
if (/Mac/i.test(navigator.userAgent)) {
|
||||||
|
// No support for Safari :(
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var markup = '<button class="btn btn-default hidden-sm">' +
|
||||||
|
'<span class="icon-clippy"></span>' +
|
||||||
|
'</button>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(".highlight").append(markup);
|
||||||
|
|
||||||
|
|
||||||
|
var reBlankLines = new RegExp("^\\s*[\\r\\n]", "gm");
|
||||||
|
var reTrailingWhitespace = new RegExp("\\s+$");
|
||||||
|
|
||||||
|
var clipboard = new Clipboard(".highlight button", {
|
||||||
|
text: function (trigger) {
|
||||||
|
var snippetElement = $(trigger).parent().children().clone();
|
||||||
|
/* remove pygmentize comment elements */
|
||||||
|
snippetElement.find(".c, .cm, .cp, .c1, .cs").remove();
|
||||||
|
/* remove blank lines and trailing whitespace */
|
||||||
|
return snippetElement.text().replace(reBlankLines, '').replace(reTrailingWhitespace, '');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on("success", function(e) {
|
||||||
|
$(e.trigger)
|
||||||
|
.tooltip({title: "Copied!", trigger: "hover"})
|
||||||
|
.tooltip("show")
|
||||||
|
.on("hidden.bs.tooltip", function(){
|
||||||
|
$(this).tooltip("destroy");
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
clipboard.on("error", function(e) {
|
||||||
|
prompt("Press Ctrl+C to select:", e.text)
|
||||||
|
});
|
||||||
|
});
|
@ -17,6 +17,7 @@
|
|||||||
<link rel="stylesheet" href="{% static 'css/icomoon.css' %}" type="text/css">
|
<link rel="stylesheet" href="{% static 'css/icomoon.css' %}" type="text/css">
|
||||||
<link rel="stylesheet" href="{% static 'css/nouislider.min.css' %}" type="text/css">
|
<link rel="stylesheet" href="{% static 'css/nouislider.min.css' %}" type="text/css">
|
||||||
<link rel="stylesheet" href="{% static 'css/nouislider.pips.css' %}" type="text/css">
|
<link rel="stylesheet" href="{% static 'css/nouislider.pips.css' %}" type="text/css">
|
||||||
|
<link rel="stylesheet" href="{% static 'css/snippet-copy.css' %}" type="text/css">
|
||||||
<link rel="stylesheet" href="{% static 'css/base.css' %}" type="text/css">
|
<link rel="stylesheet" href="{% static 'css/base.css' %}" type="text/css">
|
||||||
<link rel="stylesheet" href="{% static 'css/docs.css' %}" type="text/css">
|
<link rel="stylesheet" href="{% static 'css/docs.css' %}" type="text/css">
|
||||||
<link rel="stylesheet" href="{% static 'css/welcome.css' %}" type="text/css">
|
<link rel="stylesheet" href="{% static 'css/welcome.css' %}" type="text/css">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{% extends "front/base_docs.html" %}
|
{% extends "front/base_docs.html" %}
|
||||||
{% load staticfiles hc_extras %}
|
{% load compress staticfiles hc_extras %}
|
||||||
|
|
||||||
{% block title %}Documentation - {% site_name %}{% endblock %}
|
{% block title %}Documentation - {% site_name %}{% endblock %}
|
||||||
|
|
||||||
@ -110,17 +110,18 @@ thing: they fire off a HTTP GET method.</p>
|
|||||||
Ubuntu, for example, does not have curl installed out of the box.
|
Ubuntu, for example, does not have curl installed out of the box.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{% include "front/snippets/bash.html" %}
|
{% include "front/snippets/bash_curl.html" %}
|
||||||
|
{% include "front/snippets/bash_wget.html" %}
|
||||||
|
|
||||||
<a name="python"></a>
|
<a name="python"></a>
|
||||||
<h3>Python</h3>
|
<h3>Python</h3>
|
||||||
{% include "front/snippets/python.html" %}
|
{% include "front/snippets/python_urllib2.html" %}
|
||||||
|
{% include "front/snippets/python_requests.html" %}
|
||||||
|
|
||||||
<a name="node"></a>
|
<a name="node"></a>
|
||||||
<h3>Node</h3>
|
<h3>Node</h3>
|
||||||
{% include "front/snippets/node.html" %}
|
{% include "front/snippets/node.html" %}
|
||||||
|
|
||||||
|
|
||||||
<a name="php"></a>
|
<a name="php"></a>
|
||||||
<h3>PHP</h3>
|
<h3>PHP</h3>
|
||||||
{% include "front/snippets/php.html" %}
|
{% include "front/snippets/php.html" %}
|
||||||
@ -152,9 +153,9 @@ do more things.</p>
|
|||||||
the following command in a Scheduled Task to run the script:
|
the following command in a Scheduled Task to run the script:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<div class="highlight">
|
||||||
powershell.exe -ExecutionPolicy bypass -File C:\Scripts\healthchecks.ps1
|
<pre>powershell.exe -ExecutionPolicy bypass -File C:\Scripts\healthchecks.ps1</pre>
|
||||||
</pre>
|
</div>
|
||||||
|
|
||||||
<a name="email"></a>
|
<a name="email"></a>
|
||||||
<h3>Email</h3>
|
<h3>Email</h3>
|
||||||
@ -247,3 +248,12 @@ powershell.exe -ExecutionPolicy bypass -File C:\Scripts\healthchecks.ps1
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% endblock %}
|
{% 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,5 +1,5 @@
|
|||||||
{% extends "front/base_docs.html" %}
|
{% extends "front/base_docs.html" %}
|
||||||
{% load staticfiles hc_extras %}
|
{% load compress staticfiles hc_extras %}
|
||||||
|
|
||||||
{% block title %}REST API - {% site_name %}{% endblock %}
|
{% block title %}REST API - {% site_name %}{% endblock %}
|
||||||
|
|
||||||
@ -167,7 +167,11 @@ The response may contain a JSON document with additional data.
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3 class="api-section">Example Request</h3>
|
<h3 class="api-section">Example Request</h3>
|
||||||
{% include "front/snippets/create_check_request.html" %}
|
{% 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>
|
<h3 class="api-section">Example Response</h3>
|
||||||
{% include "front/snippets/create_check_response.html" %}
|
{% include "front/snippets/create_check_response.html" %}
|
||||||
@ -194,6 +198,7 @@ The response may contain a JSON document with additional data.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 class="api-section">Example Request</h3>
|
<h3 class="api-section">Example Request</h3>
|
||||||
|
|
||||||
{% include "front/snippets/pause_check_request.html" %}
|
{% include "front/snippets/pause_check_request.html" %}
|
||||||
|
|
||||||
<h3 class="api-section">Example Response</h3>
|
<h3 class="api-section">Example Response</h3>
|
||||||
@ -201,3 +206,12 @@ The response may contain a JSON document with additional data.
|
|||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% 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 %}
|
||||||
|
@ -230,18 +230,18 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
|
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
{% with ping_url="<span class='ex'></span>" %}
|
{% with ping_url="<span class='ex'></span>" %}
|
||||||
<div role="tabpanel" class="tab-pane active" id="crontab">
|
<div role="tabpanel" class="tab-pane active" id="crontab">
|
||||||
{% include "front/snippets/crontab.html" %}
|
{% include "front/snippets/crontab.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="bash">
|
<div role="tabpanel" class="tab-pane" id="bash">
|
||||||
{% include "front/snippets/bash.html" %}
|
{% include "front/snippets/bash_curl.html" %}
|
||||||
|
{% include "front/snippets/bash_wget.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="python">
|
<div role="tabpanel" class="tab-pane" id="python">
|
||||||
{% include "front/snippets/python.html" %}
|
{% include "front/snippets/python_urllib2.html" %}
|
||||||
|
{% include "front/snippets/python_requests.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="node">
|
<div role="tabpanel" class="tab-pane" id="node">
|
||||||
{% include "front/snippets/node.html" %}
|
{% include "front/snippets/node.html" %}
|
||||||
@ -256,12 +256,11 @@
|
|||||||
{% include "front/snippets/powershell.html" %}
|
{% include "front/snippets/powershell.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="email">
|
<div class="tab-pane" id="email">
|
||||||
|
<p>
|
||||||
As an alternative to HTTP/HTTPS requests,
|
As an alternative to HTTP/HTTPS requests,
|
||||||
you can "ping" this check by sending an
|
you can "ping" this check by sending an
|
||||||
email message to
|
email message to <code class="em"></code>
|
||||||
<div class="email-address">
|
</p>
|
||||||
<code class="em"></code>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
@ -286,6 +285,7 @@
|
|||||||
<script src="{% static 'js/bootstrap.min.js' %}"></script>
|
<script src="{% static 'js/bootstrap.min.js' %}"></script>
|
||||||
<script src="{% static 'js/nouislider.min.js' %}"></script>
|
<script src="{% static 'js/nouislider.min.js' %}"></script>
|
||||||
<script src="{% static 'js/clipboard.min.js' %}"></script>
|
<script src="{% static 'js/clipboard.min.js' %}"></script>
|
||||||
|
<script src="{% static 'js/snippet-copy.js' %}"></script>
|
||||||
<script src="{% static 'js/checks.js' %}"></script>
|
<script src="{% static 'js/checks.js' %}"></script>
|
||||||
{% endcompress %}
|
{% endcompress %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
<div class="highlight"><pre><span></span><span class="c1"># using curl:</span>
|
<div class="highlight"><pre><span></span><span class="c1"># using curl:</span>
|
||||||
<span class="c1"># (make sure it is installed on your system!)</span>
|
<span class="c1"># (make sure it is installed on your system!)</span>
|
||||||
curl --retry <span class="m">3</span> {{ ping_url }}
|
curl --retry <span class="m">3</span> {{ ping_url }}
|
||||||
|
|
||||||
<span class="c1"># using wget:</span>
|
|
||||||
wget {{ ping_url }} -O /dev/null
|
|
||||||
</pre></div>
|
</pre></div>
|
@ -1,6 +1,3 @@
|
|||||||
# using curl:
|
# using curl:
|
||||||
# (make sure it is installed on your system!)
|
# (make sure it is installed on your system!)
|
||||||
curl --retry 3 PING_URL
|
curl --retry 3 PING_URL
|
||||||
|
|
||||||
# using wget:
|
|
||||||
wget PING_URL -O /dev/null
|
|
3
templates/front/snippets/bash_wget.html
Normal file
3
templates/front/snippets/bash_wget.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<div class="highlight"><pre><span></span><span class="c1"># using wget:</span>
|
||||||
|
wget {{ ping_url }} -O /dev/null
|
||||||
|
</pre></div>
|
2
templates/front/snippets/bash_wget.txt
Normal file
2
templates/front/snippets/bash_wget.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# using wget:
|
||||||
|
wget PING_URL -O /dev/null
|
@ -1,4 +1,5 @@
|
|||||||
<div class="highlight"><pre><span></span><span class="kd">var</span> <span class="nx">xhr</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">XMLHttpRequest</span><span class="p">();</span>
|
<div class="highlight"><pre><span></span><span class="c1">// the server returns appropriate CORS headers so cross-domain AJAX requests should work:</span>
|
||||||
|
<span class="kd">var</span> <span class="nx">xhr</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">XMLHttpRequest</span><span class="p">();</span>
|
||||||
<span class="nx">xhr</span><span class="p">.</span><span class="nx">open</span><span class="p">(</span><span class="s1">'GET'</span><span class="p">,</span> <span class="s1">'{{ ping_url }}'</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
|
<span class="nx">xhr</span><span class="p">.</span><span class="nx">open</span><span class="p">(</span><span class="s1">'GET'</span><span class="p">,</span> <span class="s1">'{{ ping_url }}'</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
|
||||||
<span class="nx">xhr</span><span class="p">.</span><span class="nx">send</span><span class="p">(</span><span class="kc">null</span><span class="p">);</span>
|
<span class="nx">xhr</span><span class="p">.</span><span class="nx">send</span><span class="p">(</span><span class="kc">null</span><span class="p">);</span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// the server returns appropriate CORS headers so cross-domain AJAX requests should work:
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', 'PING_URL', true);
|
xhr.open('GET', 'PING_URL', true);
|
||||||
xhr.send(null);
|
xhr.send(null);
|
@ -1,7 +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}'
|
|
||||||
|
|
||||||
# Or, alternatively:
|
|
||||||
curl SITE_ROOT/api/v1/checks/ \
|
|
||||||
--data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
|
|
@ -1,8 +1,4 @@
|
|||||||
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/ <span class="se">\</span>
|
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/ <span class="se">\</span>
|
||||||
--header <span class="s2">"X-Api-Key: your-api-key"</span> <span class="se">\</span>
|
--header <span class="s2">"X-Api-Key: your-api-key"</span> <span class="se">\</span>
|
||||||
--data <span class="s1">'{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'</span>
|
--data <span class="s1">'{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'</span>
|
||||||
|
|
||||||
<span class="c1"># Or, alternatively:</span>
|
|
||||||
curl {{ SITE_ROOT }}/api/v1/checks/ <span class="se">\</span>
|
|
||||||
--data <span class="s1">'{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'</span>
|
|
||||||
</pre></div>
|
</pre></div>
|
3
templates/front/snippets/create_check_request_a.txt
Normal file
3
templates/front/snippets/create_check_request_a.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
curl SITE_ROOT/api/v1/checks/ \
|
||||||
|
--header "X-Api-Key: your-api-key" \
|
||||||
|
--data '{"name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
|
3
templates/front/snippets/create_check_request_b.html
Normal file
3
templates/front/snippets/create_check_request_b.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/ <span class="se">\</span>
|
||||||
|
--data <span class="s1">'{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'</span>
|
||||||
|
</pre></div>
|
2
templates/front/snippets/create_check_request_b.txt
Normal file
2
templates/front/snippets/create_check_request_b.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
curl SITE_ROOT/api/v1/checks/ \
|
||||||
|
--data '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'
|
@ -1,8 +0,0 @@
|
|||||||
<div class="highlight"><pre><span></span><span class="o">>>></span> <span class="c1"># using urllib2:</span>
|
|
||||||
<span class="o">>>></span> <span class="kn">import</span> <span class="nn">urllib2</span>
|
|
||||||
<span class="o">>>></span> <span class="n">urllib2</span><span class="o">.</span><span class="n">urlopen</span><span class="p">(</span><span class="s2">"{{ ping_url }}"</span><span class="p">)</span>
|
|
||||||
|
|
||||||
<span class="o">>>></span> <span class="c1"># using requests:</span>
|
|
||||||
<span class="o">>>></span> <span class="kn">import</span> <span class="nn">requests</span>
|
|
||||||
<span class="o">>>></span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"{{ ping_url }}"</span><span class="p">)</span>
|
|
||||||
</pre></div>
|
|
@ -1,7 +0,0 @@
|
|||||||
>>> # using urllib2:
|
|
||||||
>>> import urllib2
|
|
||||||
>>> urllib2.urlopen("PING_URL")
|
|
||||||
|
|
||||||
>>> # using requests:
|
|
||||||
>>> import requests
|
|
||||||
>>> requests.get("PING_URL")
|
|
4
templates/front/snippets/python_requests.html
Normal file
4
templates/front/snippets/python_requests.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<div class="highlight"><pre><span></span><span class="c1"># using requests:</span>
|
||||||
|
<span class="kn">import</span> <span class="nn">requests</span>
|
||||||
|
<span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"{{ ping_url }}"</span><span class="p">)</span>
|
||||||
|
</pre></div>
|
3
templates/front/snippets/python_requests.txt
Normal file
3
templates/front/snippets/python_requests.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# using requests:
|
||||||
|
import requests
|
||||||
|
requests.get("PING_URL")
|
4
templates/front/snippets/python_urllib2.html
Normal file
4
templates/front/snippets/python_urllib2.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<div class="highlight"><pre><span></span><span class="c1"># using urllib2:</span>
|
||||||
|
<span class="kn">import</span> <span class="nn">urllib2</span>
|
||||||
|
<span class="n">urllib2</span><span class="o">.</span><span class="n">urlopen</span><span class="p">(</span><span class="s2">"{{ ping_url }}"</span><span class="p">)</span>
|
||||||
|
</pre></div>
|
3
templates/front/snippets/python_urllib2.txt
Normal file
3
templates/front/snippets/python_urllib2.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# using urllib2:
|
||||||
|
import urllib2
|
||||||
|
urllib2.urlopen("PING_URL")
|
@ -62,10 +62,12 @@
|
|||||||
{% include "front/snippets/crontab.html" %}
|
{% include "front/snippets/crontab.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="bash">
|
<div role="tabpanel" class="tab-pane" id="bash">
|
||||||
{% include "front/snippets/bash.html" %}
|
{% include "front/snippets/bash_curl.html" %}
|
||||||
|
{% include "front/snippets/bash_wget.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="python">
|
<div role="tabpanel" class="tab-pane" id="python">
|
||||||
{% include "front/snippets/python.html" %}
|
{% include "front/snippets/python_urllib2.html" %}
|
||||||
|
{% include "front/snippets/python_requests.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" class="tab-pane" id="node">
|
<div role="tabpanel" class="tab-pane" id="node">
|
||||||
{% include "front/snippets/node.html" %}
|
{% include "front/snippets/node.html" %}
|
||||||
@ -79,15 +81,13 @@
|
|||||||
<div class="tab-pane" id="powershell">
|
<div class="tab-pane" id="powershell">
|
||||||
{% include "front/snippets/powershell.html" %}
|
{% include "front/snippets/powershell.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="email">
|
<div class="tab-pane tab-pane-email" id="email">
|
||||||
<div class="instructions">
|
<p>
|
||||||
As an alternative to HTTP/HTTPS requests,
|
As an alternative to HTTP/HTTPS requests,
|
||||||
you can "ping" this check by sending an
|
you can "ping" this check by sending an
|
||||||
email message to
|
email message to
|
||||||
<div class="email-address">
|
<a href="mailto:{{ check.email }}">{{ check.email }}</a>
|
||||||
<code>{{ check.email }}</code>
|
</p>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -331,9 +331,9 @@
|
|||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{% compress js %}
|
{% compress js %}
|
||||||
<script src="{% static 'js/collapse-native.js' %}"></script>
|
<script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
|
||||||
<script src="{% static 'js/tab-native.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 %}
|
{% endcompress %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user