This repository was archived by the owner on Aug 4, 2021. It is now read-only.
File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -195,3 +195,15 @@ async def handle_get_container(
195
195
await download .a_write_to_response (resp )
196
196
197
197
return resp
198
+
199
+
200
+ async def handle_health_check (
201
+ request : aiohttp .web .Request
202
+ ) -> aiohttp .web .Response :
203
+ """Answer a service health check."""
204
+ # Case degraded
205
+
206
+ # Case nominal
207
+ return aiohttp .web .json_response ({
208
+ "status" : "Ok" ,
209
+ })
Original file line number Diff line number Diff line change 16
16
from .auth import handle_login , read_in_keys , handle_validate_authentication
17
17
from .api import handle_get_object , handle_get_container
18
18
from .api import handle_post_object_chunk , handle_post_object_options
19
+ from .api import handle_health_check
19
20
20
21
21
22
asyncio .set_event_loop_policy (uvloop .EventLoopPolicy ())
@@ -48,6 +49,10 @@ async def servinit() -> aiohttp.web.Application:
48
49
aiohttp .web .post ("/{project}" , handle_login )
49
50
])
50
51
52
+ app .add_routes ([
53
+ aiohttp .web .get ("/health" , handle_health_check )
54
+ ])
55
+
51
56
# Add api routes
52
57
app .add_routes ([
53
58
aiohttp .web .get ("/{project}/{container}/{object_name:.*}" ,
You can’t perform that action at this time.
0 commit comments