mirror of
https://github.com/Luzifer/mondash.git
synced 2024-12-22 20:11:18 +00:00
Added "value" parameter to API documentation and welcome runner
This commit is contained in:
parent
13beddc97a
commit
daa9b7eed7
2 changed files with 13 additions and 11 deletions
23
apiary.apib
23
apiary.apib
|
@ -2,7 +2,7 @@ FORMAT: 1A
|
|||
HOST: https://mondash.org
|
||||
|
||||
# MonDash
|
||||
MonDash is a service for everyone having to display monitoring results to people who have not
|
||||
MonDash is a service for everyone having to display monitoring results to people who have not
|
||||
the time or knowledge to get familar with Nagios / Icinga or similar monitoring systems. Therefore
|
||||
MonDash provides a simple API to submit monitoring results and a simple dashboard to view those
|
||||
results.
|
||||
|
@ -33,13 +33,13 @@ as we are not storing any data beyond this DELETE request._
|
|||
+ Request
|
||||
|
||||
+ Header
|
||||
|
||||
|
||||
Authorization: MyAPIToken
|
||||
|
||||
|
||||
+ Response 200 (text/plain)
|
||||
|
||||
OK
|
||||
|
||||
|
||||
## Metric [/{dashid}/{metricid}]
|
||||
|
||||
This API controls the metrics on your dashboard
|
||||
|
@ -52,19 +52,20 @@ This API controls the metrics on your dashboard
|
|||
+ Request (application/json)
|
||||
|
||||
+ Header
|
||||
|
||||
|
||||
Authorization: MyAPIToken
|
||||
|
||||
|
||||
+ Body
|
||||
|
||||
|
||||
{
|
||||
"title": "Amount of beer in the fridge",
|
||||
"description": "Currently there are 12 bottles of beer in the fridge",
|
||||
"status": "OK",
|
||||
"expires": 604800,
|
||||
"freshness": 3600
|
||||
"freshness": 3600,
|
||||
"value": 12.0
|
||||
}
|
||||
|
||||
|
||||
+ Attributes (object)
|
||||
+ title (required, string) - The title of the metric to display on the dashboard
|
||||
+ description (required, string) - A descriptive text for the current state of the metric
|
||||
|
@ -87,11 +88,11 @@ This API controls the metrics on your dashboard
|
|||
+ Request
|
||||
|
||||
+ Header
|
||||
|
||||
|
||||
Authorization: MyAPIToken
|
||||
|
||||
+ Response 200 (text/plain)
|
||||
|
||||
+ Body
|
||||
|
||||
|
||||
OK
|
||||
|
|
|
@ -36,6 +36,7 @@ func runWelcomePage() {
|
|||
Status: status,
|
||||
Expires: 86400,
|
||||
Freshness: 120,
|
||||
Value: float64(beers),
|
||||
}
|
||||
|
||||
body, err := json.Marshal(beer)
|
||||
|
|
Loading…
Reference in a new issue