@ -1,6 +1,6 @@ | |||||
<div class="highlight"><pre><span class="c"># using curl:</span> | |||||
<div class="highlight"><pre><span></span><span class="c1"># using curl:</span> | |||||
curl --retry <span class="m">3</span> {{ ping_url }} | curl --retry <span class="m">3</span> {{ ping_url }} | ||||
<span class="c"># using wget:</span> | |||||
<span class="c1"># using wget:</span> | |||||
wget {{ ping_url }} -O /dev/null | wget {{ ping_url }} -O /dev/null | ||||
</pre></div> | </pre></div> |
@ -1,4 +1,4 @@ | |||||
<div class="highlight"><pre><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="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> |
@ -0,0 +1,4 @@ | |||||
<div class="highlight"><pre><span></span>curl http://localhost:8000/api/v1/checks/ <span class="se">\</span> | |||||
-X POST <span class="se">\</span> | |||||
-d <span class="s1">'{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}'</span> | |||||
</pre></div> |
@ -0,0 +1,3 @@ | |||||
curl http://localhost:8000/api/v1/checks/ \ | |||||
-X POST \ | |||||
-d '{"api_key": "your-api-key", "name": "Backups", "tags": "prod www", "timeout": 3600, "grace": 60}' |
@ -0,0 +1,4 @@ | |||||
<div class="highlight"><pre><span></span><span class="p">{</span> | |||||
<span class="nt">"ping_url"</span><span class="p">:</span> <span class="s2">"{{ PING_ENDPOINT }}20f2d3d0-efe4-4cc1-a114-a186a225de50"</span> | |||||
<span class="p">}</span> | |||||
</pre></div> |
@ -0,0 +1,3 @@ | |||||
{ | |||||
"ping_url": "PING_ENDPOINT20f2d3d0-efe4-4cc1-a114-a186a225de50" | |||||
} |
@ -1,3 +1,3 @@ | |||||
<div class="highlight"><pre><span class="c"># m h dom mon dow command</span> | |||||
<div class="highlight"><pre><span></span><span class="c1"># m h dom mon dow command</span> | |||||
<span class="m">8</span> <span class="m">6</span> * * * /home/user/backup.sh <span class="o">&&</span> curl -fsS --retry <span class="m">3</span> {{ ping_url }} > /dev/null | <span class="m">8</span> <span class="m">6</span> * * * /home/user/backup.sh <span class="o">&&</span> curl -fsS --retry <span class="m">3</span> {{ ping_url }} > /dev/null | ||||
</pre></div> | </pre></div> |
@ -0,0 +1,4 @@ | |||||
<div class="highlight"><pre><span></span>curl {{ SITE_ROOT }}/api/v1/checks/ <span class="se">\</span> | |||||
-X GET <span class="se">\</span> | |||||
-d <span class="s1">'{"api_key": "your-api-key"}'</span> | |||||
</pre></div> |
@ -0,0 +1,3 @@ | |||||
curl SITE_ROOT/api/v1/checks/ \ | |||||
-X GET \ | |||||
-d '{"api_key": "your-api-key"}' |
@ -0,0 +1,19 @@ | |||||
<div class="highlight"><pre><span></span><span class="p">{</span> | |||||
<span class="nt">"checks"</span><span class="p">:</span> <span class="p">[</span> | |||||
<span class="p">{</span> | |||||
<span class="nt">"ping_url"</span><span class="p">:</span> <span class="s2">"{{ PING_ENDPOINT }}848f3002-266b-482a-89ad-9d66a11aa2fb"</span><span class="p">,</span> | |||||
<span class="nt">"grace"</span><span class="p">:</span> <span class="mi">900</span><span class="p">,</span> | |||||
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"API test 1"</span><span class="p">,</span> | |||||
<span class="nt">"timeout"</span><span class="p">:</span> <span class="mi">3600</span><span class="p">,</span> | |||||
<span class="nt">"tags"</span><span class="p">:</span> <span class="s2">"foo"</span> | |||||
<span class="p">},</span> | |||||
<span class="p">{</span> | |||||
<span class="nt">"ping_url"</span><span class="p">:</span> <span class="s2">"{{ PING_ENDPOINT }}20324f81-5966-4e75-9734-8440df52ed75"</span><span class="p">,</span> | |||||
<span class="nt">"grace"</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span> | |||||
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"API test 2"</span><span class="p">,</span> | |||||
<span class="nt">"timeout"</span><span class="p">:</span> <span class="mi">60</span><span class="p">,</span> | |||||
<span class="nt">"tags"</span><span class="p">:</span> <span class="s2">"bar,baz"</span> | |||||
<span class="p">}</span> | |||||
<span class="p">]</span> | |||||
<span class="p">}</span> | |||||
</pre></div> |
@ -0,0 +1,18 @@ | |||||
{ | |||||
"checks": [ | |||||
{ | |||||
"ping_url": "PING_ENDPOINT848f3002-266b-482a-89ad-9d66a11aa2fb", | |||||
"grace": 900, | |||||
"name": "API test 1", | |||||
"timeout": 3600, | |||||
"tags": "foo" | |||||
}, | |||||
{ | |||||
"ping_url": "PING_ENDPOINT20324f81-5966-4e75-9734-8440df52ed75", | |||||
"grace": 60, | |||||
"name": "API test 2", | |||||
"timeout": 60, | |||||
"tags": "bar,baz" | |||||
} | |||||
] | |||||
} |
@ -1,3 +1,3 @@ | |||||
<div class="highlight"><pre><span class="kd">var</span> <span class="nx">http</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'http'</span><span class="p">);</span> | |||||
<div class="highlight"><pre><span></span><span class="kd">var</span> <span class="nx">http</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'http'</span><span class="p">);</span> | |||||
<span class="nx">http</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">"{{ ping_url }}"</span><span class="p">);</span> | <span class="nx">http</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">"{{ ping_url }}"</span><span class="p">);</span> | ||||
</pre></div> | </pre></div> |
@ -1,2 +1,2 @@ | |||||
<div class="highlight"><pre><span class="x">file_get_contents('{{ ping_url }}');</span> | |||||
<div class="highlight"><pre><span></span><span class="x">file_get_contents('{{ ping_url }}');</span> | |||||
</pre></div> | </pre></div> |
@ -1,2 +1,2 @@ | |||||
<div class="highlight"><pre><span class="nb">Invoke-RestMethod</span> <span class="n">{{ ping_url }}</span> | |||||
<div class="highlight"><pre><span></span><span class="nb">Invoke-RestMethod</span> <span class="n">{{ ping_url }}</span> | |||||
</pre></div> | </pre></div> |
@ -1,8 +1,8 @@ | |||||
<div class="highlight"><pre><span class="o">>>></span> <span class="c"># using urllib2:</span> | |||||
<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="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="s">"{{ ping_url }}"</span><span class="p">)</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="c"># using requests:</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="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="s">"{{ ping_url }}"</span><span class="p">)</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> | </pre></div> |