Skip to content

Commit

Permalink
Added health check API for the image service (#84)
Browse files Browse the repository at this point in the history
*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.
  • Loading branch information
AsakerMohd authored Feb 28, 2024
1 parent c00fb83 commit 523f617
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
path("", views.index, name="index"),
path("name/<str:image_name>", views.handle_image, name="image"),
path("remote-image", views.get_remote_image, name="remote-image"),
path("health-check/", views.health_check, name="health_check"),
]
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def index(request):
return HttpResponse("Hello, world LOL!")


def health_check(request):
return HttpResponse("Image Service is up and running!")


@csrf_exempt
def handle_image(request, image_name):
print(image_name)
Expand Down
3 changes: 2 additions & 1 deletion sample-applications/vehicle-dealership-sample-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ The following are the APIs and what they do:
16. `POST /images/name/<image_name>`: creates an empty file in S3. This is an async endpoint since it will put image
name in an SQS queue and not wait for the file to be created in S3. Instead, a long running thread will poll SQS
and then create the image file later.
17. `GET /image/remote-image`: makes a remote http call to google.com.
17. `GET /image/remote-image`: makes a remote http call to google.com.
18. `GET /image/heatlh-check/`: returns 200 if the image service is up and running.

0 comments on commit 523f617

Please sign in to comment.