mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-20 07:43:35 -05:00
adding a related field to point back to the original host
This commit is contained in:
@@ -1883,6 +1883,8 @@ class HostSerializer(BaseSerializerWithVariables):
|
|||||||
ansible_facts=self.reverse('api:host_ansible_facts_detail', kwargs={'pk': obj.pk}),
|
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:
|
if obj.inventory:
|
||||||
res['inventory'] = self.reverse('api:inventory_detail', kwargs={'pk': obj.inventory.pk})
|
res['inventory'] = self.reverse('api:inventory_detail', kwargs={'pk': obj.inventory.pk})
|
||||||
if obj.last_job:
|
if obj.last_job:
|
||||||
|
|||||||
Reference in New Issue
Block a user