mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 11:40:05 -03:30
nest insights api response data
This commit is contained in:
@@ -2077,6 +2077,7 @@ class HostInsights(GenericAPIView):
|
|||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
host = self.get_object()
|
host = self.get_object()
|
||||||
cred = None
|
cred = None
|
||||||
|
ret = {}
|
||||||
|
|
||||||
if host.insights_system_id is None:
|
if host.insights_system_id is None:
|
||||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||||
@@ -2102,7 +2103,8 @@ class HostInsights(GenericAPIView):
|
|||||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return Response(res.json())
|
ret['insights_content'] = res.json()
|
||||||
|
return Response(ret)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user