mirror of
https://github.com/ansible/awx.git
synced 2026-04-11 21:19:22 -02:30
add per-inventory insights credential
This commit is contained in:
@@ -1112,7 +1112,8 @@ class InventorySerializer(BaseSerializerWithVariables):
|
||||
fields = ('*', 'organization', 'kind', 'host_filter', 'variables', 'has_active_failures',
|
||||
'total_hosts', 'hosts_with_active_failures', 'total_groups',
|
||||
'groups_with_active_failures', 'has_inventory_sources',
|
||||
'total_inventory_sources', 'inventory_sources_with_failures')
|
||||
'total_inventory_sources', 'inventory_sources_with_failures',
|
||||
'insights_credential',)
|
||||
|
||||
def get_related(self, obj):
|
||||
res = super(InventorySerializer, self).get_related(obj)
|
||||
@@ -1133,6 +1134,8 @@ class InventorySerializer(BaseSerializerWithVariables):
|
||||
object_roles = self.reverse('api:inventory_object_roles_list', kwargs={'pk': obj.pk}),
|
||||
instance_groups = self.reverse('api:inventory_instance_groups_list', kwargs={'pk': obj.pk}),
|
||||
))
|
||||
if obj.insights_credential:
|
||||
res['insights_credential'] = self.reverse('api:credential_detail', kwargs={'pk': obj.insights_credential.pk})
|
||||
if obj.organization:
|
||||
res['organization'] = self.reverse('api:organization_detail', kwargs={'pk': obj.organization.pk})
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user