1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 06:51:10 +03:00

View Fixes for instance groups

* Return "instance_groups" instead of "rampart_groups" on the ping
  endpoint
* Don't pre-filter IG jobs endpoints for status
This commit is contained in:
Matthew Jones 2017-05-11 13:55:31 -04:00
parent 704da9c7f2
commit 47f4e5358b

View File

@ -240,11 +240,11 @@ class ApiV1PingView(APIView):
response['instances'].append(dict(node=instance.hostname, heartbeat=instance.modified,
capacity=instance.capacity, version=instance.version))
response['instances'].sort()
response['rampart_groups'] = []
response['instance_groups'] = []
for instance_group in InstanceGroup.objects.all():
response['rampart_groups'].append(dict(name=instance_group.name,
capacity=instance_group.capacity,
instances=[x.hostname for x in instance_group.instances.all()]))
response['instance_groups'].append(dict(name=instance_group.name,
capacity=instance_group.capacity,
instances=[x.hostname for x in instance_group.instances.all()]))
return Response(response)
@ -532,7 +532,7 @@ class InstanceUnifiedJobsList(SubListAPIView):
def get_queryset(self):
po = self.get_parent_object()
qs = get_user_queryset(self.request.user, UnifiedJob)
qs = qs.filter(execution_node=po.hostname, status__in=('running', 'waiting', 'pending'))
qs = qs.filter(execution_node=po.hostname)
return qs
@ -568,14 +568,9 @@ class InstanceGroupUnifiedJobsList(SubListAPIView):
model = UnifiedJob
serializer_class = UnifiedJobSerializer
parent_model = InstanceGroup
relationship = "instance_group"
new_in_320 = True
def get_queryset(self):
po = self.get_parent_object()
qs = get_user_queryset(self.request.user, UnifiedJob)
qs = qs.filter(instance_group=po, status__in=('running', 'waiting', 'pending'))
return qs
class InstanceGroupInstanceList(SubListAPIView):