Add health check endpoint and refactor integration response handling
- Introduced a new public health check endpoint at `api/ping/` to verify API responsiveness. - Refactored integration response handling to utilize a unified success and error response format across various methods in `IntegrationSettingsViewSet`, improving consistency and clarity in API responses. - Updated URL patterns to include the new ping endpoint and adjusted imports accordingly.
This commit is contained in:
@@ -269,6 +269,24 @@ class StrategyViewSet(AccountModelViewSet):
|
||||
filterset_fields = ['is_active', 'sector']
|
||||
|
||||
|
||||
@api_view(['GET'])
|
||||
@permission_classes([AllowAny]) # Public endpoint
|
||||
@extend_schema(
|
||||
tags=['System'],
|
||||
summary='Health Check',
|
||||
description='Simple health check endpoint to verify API is responding'
|
||||
)
|
||||
def ping(request):
|
||||
"""
|
||||
Simple health check endpoint
|
||||
Returns unified format: {success: true, data: {status: 'ok'}}
|
||||
"""
|
||||
return success_response(
|
||||
data={'status': 'ok'},
|
||||
request=request
|
||||
)
|
||||
|
||||
|
||||
@api_view(['GET'])
|
||||
@permission_classes([AllowAny]) # Public endpoint for monitoring
|
||||
def system_status(request):
|
||||
|
||||
Reference in New Issue
Block a user