add ready and healthy probe endpoints

This commit is contained in:
Markus Muellner authored and Benj Fassbind committed 2022-12-12 13:39:07 +01:00
1 parent 352f4e8772
commit 2020ca9971
8 files changed
+163 -46

No files matched your search

+3
View File
@@ -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)
+27
View File
@@ -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)