mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 05:31:22 -03:30
adding a related field to point back to the original host
This commit is contained in:
parent
27a97017dd
commit
c22d8f1d7e
@ -1883,6 +1883,8 @@ class HostSerializer(BaseSerializerWithVariables):
|
||||
ansible_facts=self.reverse('api:host_ansible_facts_detail', kwargs={'pk': obj.pk}),
|
||||
)
|
||||
)
|
||||
if obj.instance_id and obj.pk != obj.instance_id:
|
||||
res['original_host'] = self.reverse('api:host_detail', kwargs={'pk': obj.instance_id }),
|
||||
if obj.inventory:
|
||||
res['inventory'] = self.reverse('api:inventory_detail', kwargs={'pk': obj.inventory.pk})
|
||||
if obj.last_job:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user