Browse Source

aws负载均衡health检查

locky 4 years ago
parent
commit
7d6e261d09
2 changed files with 5 additions and 1 deletions
  1. 1 0
      AnsjerPush/urls.py
  2. 4 1
      Controller/EquipmentInfo.py

+ 1 - 0
AnsjerPush/urls.py

@@ -26,4 +26,5 @@ urlpatterns = [
     path('deviceShadow/generateUTK', ShadowController.generate_utk),
     path('test/notify/push', TestDetectController.NotificationView.as_view()),
     path('eq/del', EquipmentInfo.deleteExpireEquipmentInfo),
+    path('push/healthCheck', EquipmentInfo.healthCheck),
 ]

+ 4 - 1
Controller/EquipmentInfo.py

@@ -4,6 +4,7 @@ import traceback
 import requests
 
 import oss2
+from django.http import JsonResponse
 from django.utils.decorators import method_decorator
 from django.views.decorators.csrf import csrf_exempt
 from django.views.generic import TemplateView
@@ -317,4 +318,6 @@ def deleteExpireEquipmentInfo(request):
     except Exception as e:
         return response.json(500, repr(e))
 
-
+# aws负载均衡health检查
+def healthCheck(request):
+    return JsonResponse(status=200, safe=False)