add ready and healthy probe endpoints

This commit is contained in:
Markus Muellner
2022-07-01 10:24:23 +02:00
committed by Benj Fassbind
parent 352f4e8772
commit 2020ca9971
8 changed files with 163 additions and 46 deletions
+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)