mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 07:26:03 -03:30
Adds Instance Peers Tab and update Instance Details view with more data (#12655)
* Adds InstancePeers tab and updates details view * attempt to fix failing api tests
This commit is contained in:
committed by
Jeff Bradberry
parent
0465a10df5
commit
7e627e1d1e
@@ -384,6 +384,8 @@ class InstanceDetail(RetrieveUpdateAPIView):
|
||||
obj = self.get_object()
|
||||
obj.set_capacity_value()
|
||||
obj.save(update_fields=['capacity'])
|
||||
for instance in models.Instance.objects.filter(node_type__in=['control', 'hybrid']):
|
||||
models.InstanceLink.objects.create(source=instance, target=obj)
|
||||
r.data = serializers.InstanceSerializer(obj, context=self.get_serializer_context()).to_representation(obj)
|
||||
return r
|
||||
|
||||
@@ -402,6 +404,17 @@ class InstanceUnifiedJobsList(SubListAPIView):
|
||||
return qs
|
||||
|
||||
|
||||
class InstancePeersList(SubListAPIView):
|
||||
|
||||
name = _("Instance Peers")
|
||||
parent_model = models.Instance
|
||||
model = models.Instance
|
||||
serializer_class = serializers.InstanceSerializer
|
||||
parent_access = 'read'
|
||||
search_fields = {'hostname'}
|
||||
relationship = 'peers'
|
||||
|
||||
|
||||
class InstanceInstanceGroupsList(InstanceGroupMembershipMixin, SubListCreateAttachDetachAPIView):
|
||||
|
||||
name = _("Instance's Instance Groups")
|
||||
|
||||
Reference in New Issue
Block a user