mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-16 23:39:54 +03:00
Documented health endpoint
This commit is contained in:
parent
144a5415da
commit
fd8d73af38
3 changed files with 101 additions and 0 deletions
31
docs/swagger/definitions/Health.json
Normal file
31
docs/swagger/definitions/Health.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"pass",
|
||||
"fail"
|
||||
],
|
||||
"description": "The status of the service"
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "Shlink version"
|
||||
},
|
||||
"links": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"about": {
|
||||
"type": "string",
|
||||
"description": "About shlink"
|
||||
},
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "Shlink project repository"
|
||||
}
|
||||
},
|
||||
"description": "A list of links"
|
||||
}
|
||||
}
|
||||
}
|
62
docs/swagger/paths/health.json
Normal file
62
docs/swagger/paths/health.json
Normal file
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"get": {
|
||||
"operationId": "health",
|
||||
"tags": [
|
||||
"Monitoring"
|
||||
],
|
||||
"summary": "Check healthiness",
|
||||
"description": "Checks the healthiness of the service, making sure it can access required resources.",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The passing health status",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "../definitions/Health.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"examples": {
|
||||
"application/json": {
|
||||
"status": "pass",
|
||||
"version": "1.16.0",
|
||||
"links": {
|
||||
"about": "https://shlink.io",
|
||||
"project": "https://github.com/shlinkio/shlink"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"503": {
|
||||
"description": "The failing health status",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "../definitions/Health.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"examples": {
|
||||
"application/json": {
|
||||
"status": "fail",
|
||||
"version": "1.16.0",
|
||||
"links": {
|
||||
"about": "https://shlink.io",
|
||||
"project": "https://github.com/shlinkio/shlink"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Unexpected error.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "../definitions/Error.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -56,6 +56,10 @@
|
|||
"name": "Visits",
|
||||
"description": "Operations to manage visits on short URLs"
|
||||
},
|
||||
{
|
||||
"name": "Monitoring",
|
||||
"description": "Public endpoints designed to monitor the service"
|
||||
},
|
||||
{
|
||||
"name": "URL Shortener",
|
||||
"description": "Non-rest endpoints, used to be publicly exposed"
|
||||
|
@ -88,6 +92,10 @@
|
|||
"$ref": "paths/v1_short-urls_{shortCode}_visits.json"
|
||||
},
|
||||
|
||||
"/rest/health": {
|
||||
"$ref": "paths/health.json"
|
||||
},
|
||||
|
||||
"/{shortCode}": {
|
||||
"$ref": "paths/{shortCode}.json"
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue