forked from GithubBackups/healthchecks
Minor cleanup, update CHANGELOG
This commit is contained in:
parent
ffc7ccddf2
commit
da4cf5241e
@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
- Zulip integration (#202)
|
- Zulip integration (#202)
|
||||||
- OpsGenie integration returns more detailed error messages
|
- OpsGenie integration returns more detailed error messages
|
||||||
- Telegram integration returns more detailed error messages
|
- Telegram integration returns more detailed error messages
|
||||||
|
- Added the "Get a single check" API call (#337)
|
||||||
|
|
||||||
### 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)
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
from datetime import timedelta as td
|
from datetime import timedelta as td
|
||||||
import uuid
|
|
||||||
|
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
from hc.api.models import Channel, Check
|
from hc.api.models import Channel, Check
|
||||||
|
@ -191,7 +191,7 @@ def single(request, code):
|
|||||||
try:
|
try:
|
||||||
validate(request.json, schemas.check)
|
validate(request.json, schemas.check)
|
||||||
_update(check, request.json)
|
_update(check, request.json)
|
||||||
except (BadChannelException,ValidationError) as e:
|
except (BadChannelException, ValidationError) as e:
|
||||||
return JsonResponse({"error": str(e)}, status=400)
|
return JsonResponse({"error": str(e)}, status=400)
|
||||||
|
|
||||||
return JsonResponse(check.to_dict())
|
return JsonResponse(check.to_dict())
|
||||||
@ -208,14 +208,6 @@ def single(request, code):
|
|||||||
return HttpResponse(status=405)
|
return HttpResponse(status=405)
|
||||||
|
|
||||||
|
|
||||||
@csrf_exempt
|
|
||||||
@cors("POST", "DELETE")
|
|
||||||
@validate_json(schemas.check)
|
|
||||||
@authorize
|
|
||||||
def update(request, code):
|
|
||||||
single(request, code)
|
|
||||||
|
|
||||||
|
|
||||||
@cors("POST")
|
@cors("POST")
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
@validate_json()
|
@validate_json()
|
||||||
|
@ -15,7 +15,7 @@ checks in user's account.</p>
|
|||||||
<td><code>GET SITE_ROOT/api/v1/checks/</code></td>
|
<td><code>GET SITE_ROOT/api/v1/checks/</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="#get-check">Create a single check</a></td>
|
<td><a href="#get-check">Get a single check</a></td>
|
||||||
<td><code>GET SITE_ROOT/api/v1/checks/<uuid></code></td>
|
<td><code>GET SITE_ROOT/api/v1/checks/<uuid></code></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -178,15 +178,19 @@ is added. This identifier is stable across API calls. Example:</p>
|
|||||||
</code></pre></div>
|
</code></pre></div>
|
||||||
|
|
||||||
|
|
||||||
<h2 class="rule" id="get-check">Get a single Check</h2>
|
<h2 class="rule" id="get-check">Get a Single Check</h2>
|
||||||
<p><code>GET SITE_ROOT/api/v1/checks/<uuid></code></p>
|
<p><code>GET SITE_ROOT/api/v1/checks/<uuid></code></p>
|
||||||
<p>Returns a JSON object containing information information from a single check.</p>
|
<p>Returns a JSON representation of a single check.</p>
|
||||||
<h3>Response Codes</h3>
|
<h3>Response Codes</h3>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>200 OK</dt>
|
<dt>200 OK</dt>
|
||||||
<dd>The request succeeded.</dd>
|
<dd>The request succeeded.</dd>
|
||||||
<dt>401 Unauthorized</dt>
|
<dt>401 Unauthorized</dt>
|
||||||
<dd>The API key is either missing or invalid.</dd>
|
<dd>The API key is either missing or invalid.</dd>
|
||||||
|
<dt>403 Forbidden</dt>
|
||||||
|
<dd>Access denied, wrong API key.</dd>
|
||||||
|
<dt>404 Not Found</dt>
|
||||||
|
<dd>The specified check does not exist.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<h3>Example Request</h3>
|
<h3>Example Request</h3>
|
||||||
<div class="highlight"><pre><span></span><code>curl --header <span class="s2">"X-Api-Key: your-api-key"</span> SITE_ROOT/api/v1/checks/<uuid>
|
<div class="highlight"><pre><span></span><code>curl --header <span class="s2">"X-Api-Key: your-api-key"</span> SITE_ROOT/api/v1/checks/<uuid>
|
||||||
|
@ -8,7 +8,7 @@ checks in user's account.
|
|||||||
Endpoint Name | Endpoint Address
|
Endpoint Name | Endpoint Address
|
||||||
------------------------------------------------------|-------
|
------------------------------------------------------|-------
|
||||||
[Get a list of existing checks](#list-checks) | `GET SITE_ROOT/api/v1/checks/`
|
[Get a list of existing checks](#list-checks) | `GET SITE_ROOT/api/v1/checks/`
|
||||||
[Create a single check](#get-check) | `GET SITE_ROOT/api/v1/checks/<uuid>`
|
[Get a single check](#get-check) | `GET SITE_ROOT/api/v1/checks/<uuid>`
|
||||||
[Create a new check](#create-check) | `POST 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>`
|
[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`
|
[Pause monitoring of a check](#pause-check) | `POST SITE_ROOT/api/v1/checks/<uuid>/pause`
|
||||||
@ -158,10 +158,10 @@ is added. This identifier is stable across API calls. Example:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Get a single Check {: #get-check .rule }
|
## Get a Single Check {: #get-check .rule }
|
||||||
`GET SITE_ROOT/api/v1/checks/<uuid>`
|
`GET SITE_ROOT/api/v1/checks/<uuid>`
|
||||||
|
|
||||||
Returns a JSON object containing information information from a single check.
|
Returns a JSON representation of a single check.
|
||||||
|
|
||||||
### Response Codes
|
### Response Codes
|
||||||
|
|
||||||
@ -171,6 +171,13 @@ Returns a JSON object containing information information from a single check.
|
|||||||
401 Unauthorized
|
401 Unauthorized
|
||||||
: The API key is either missing or invalid.
|
: The API key is either missing or invalid.
|
||||||
|
|
||||||
|
403 Forbidden
|
||||||
|
: Access denied, wrong API key.
|
||||||
|
|
||||||
|
404 Not Found
|
||||||
|
: The specified check does not exist.
|
||||||
|
|
||||||
|
|
||||||
### Example Request
|
### Example Request
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<h1>Cloning Checks</h1>
|
<h1>Cloning Checks</h1>
|
||||||
<p>You can individually clone individual checks SITE_NAME from the "Check Details"
|
<p>You can clone individual checks from the "Check Details"
|
||||||
page:</p>
|
page:</p>
|
||||||
<p><img alt="The "Create a Copy" button" src="IMG_URL/create_copy.png" /></p>
|
<p><img alt="The "Create a Copy" button" src="IMG_URL/create_copy.png" /></p>
|
||||||
<p>The "Create a Copy..." function creates a new check in the same project, and copies
|
<p>The "Create a Copy..." function creates a new check in the same project, and copies
|
||||||
|
Loading…
x
Reference in New Issue
Block a user