Skip to content

Commit 523f617

Browse files
authored
Added health check API for the image service (#84)
*Description of changes:* Added health check API for the image service similar to the vehicle service. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent c00fb83 commit 523f617

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

sample-applications/vehicle-dealership-sample-app/ImageServiceApp/MainService/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
path("", views.index, name="index"),
99
path("name/<str:image_name>", views.handle_image, name="image"),
1010
path("remote-image", views.get_remote_image, name="remote-image"),
11+
path("health-check/", views.health_check, name="health_check"),
1112
]

sample-applications/vehicle-dealership-sample-app/ImageServiceApp/MainService/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def index(request):
4444
return HttpResponse("Hello, world LOL!")
4545

4646

47+
def health_check(request):
48+
return HttpResponse("Image Service is up and running!")
49+
50+
4751
@csrf_exempt
4852
def handle_image(request, image_name):
4953
print(image_name)

sample-applications/vehicle-dealership-sample-app/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,5 @@ The following are the APIs and what they do:
143143
16. `POST /images/name/<image_name>`: creates an empty file in S3. This is an async endpoint since it will put image
144144
name in an SQS queue and not wait for the file to be created in S3. Instead, a long running thread will poll SQS
145145
and then create the image file later.
146-
17. `GET /image/remote-image`: makes a remote http call to google.com.
146+
17. `GET /image/remote-image`: makes a remote http call to google.com.
147+
18. `GET /image/heatlh-check/`: returns 200 if the image service is up and running.

0 commit comments

Comments
 (0)