mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 22:18:01 -03:30
Fix TypeError when running a command on a host in a smart inventory See: https://github.com/ansible/awx/issues/11611
26 lines
812 B
Python
26 lines
812 B
Python
# Copyright (c) 2018 Red Hat, Inc.
|
|
# All Rights Reserved.
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from awx.api.generics import APIView, Response
|
|
from awx.api.permissions import IsSystemAdminOrAuditor
|
|
from awx.api.serializers import InstanceLinkSerializer, InstanceNodeSerializer
|
|
from awx.main.models import InstanceLink, Instance
|
|
|
|
|
|
class MeshVisualizer(APIView):
|
|
|
|
name = _("Mesh Visualizer")
|
|
permission_classes = (IsSystemAdminOrAuditor,)
|
|
swagger_topic = "System Configuration"
|
|
|
|
def get(self, request, format=None):
|
|
|
|
data = {
|
|
'nodes': InstanceNodeSerializer(Instance.objects.all(), many=True).data,
|
|
'links': InstanceLinkSerializer(InstanceLink.objects.select_related('target', 'source'), many=True).data,
|
|
}
|
|
|
|
return Response(data)
|