mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-07 05:42:42 +00:00
add ready and healthy probe endpoints
This commit is contained in:
committed by
Benj Fassbind
parent
352f4e8772
commit
2020ca9971
@@ -24,3 +24,6 @@ class MetricsEnabledAPITest(APITest):
|
||||
|
||||
apiRequestsDurationSummary = "# TYPE aptly_api_http_request_duration_seconds summary"
|
||||
self.check_in(apiRequestsDurationSummary, resp.text)
|
||||
|
||||
apiBuildInfoGauge = "# TYPE aptly_build_info gauge"
|
||||
self.check_in(apiBuildInfoGauge, resp.text)
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
from api_lib import APITest
|
||||
|
||||
|
||||
class ReadyAPITest(APITest):
|
||||
"""
|
||||
GET /ready
|
||||
"""
|
||||
|
||||
def check(self):
|
||||
resp = self.get("/api/ready")
|
||||
self.check_equal(resp.status_code, 200)
|
||||
|
||||
readyStatus = "{\"Status\":\"Aptly is ready\"}"
|
||||
self.check_equal(readyStatus, resp.text)
|
||||
|
||||
|
||||
class HealthyAPITest(APITest):
|
||||
"""
|
||||
GET /healthy
|
||||
"""
|
||||
|
||||
def check(self):
|
||||
resp = self.get("/api/healthy")
|
||||
self.check_equal(resp.status_code, 200)
|
||||
|
||||
healthyStatus = "{\"Status\":\"Aptly is healthy\"}"
|
||||
self.check_equal(healthyStatus, resp.text)
|
||||
Reference in New Issue
Block a user