mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-20 15:01:48 -05:00
AC-601 Add groups/hosts collections to inventory sources, add inventory sources collections to groups/hosts to indicate which inventory source(s) have created/updated the given groups/hosts. Prevent setting an explicit inventory source for a group that is being managed by another parent with cloud inventory source.
This commit is contained in:
@@ -722,6 +722,14 @@ class HostAllGroupsList(SubListAPIView):
|
||||
sublist_qs = parent.all_groups.distinct()
|
||||
return qs & sublist_qs
|
||||
|
||||
class HostInventorySourcesList(SubListAPIView):
|
||||
|
||||
model = InventorySource
|
||||
serializer_class = InventorySourceSerializer
|
||||
parent_model = Host
|
||||
relationship = 'inventory_sources'
|
||||
new_in_148 = True
|
||||
|
||||
class HostActivityStreamList(SubListAPIView):
|
||||
|
||||
model = ActivityStream
|
||||
@@ -815,6 +823,14 @@ class GroupAllHostsList(SubListAPIView):
|
||||
sublist_qs = parent.all_hosts.distinct()
|
||||
return qs & sublist_qs
|
||||
|
||||
class GroupInventorySourcesList(SubListAPIView):
|
||||
|
||||
model = InventorySource
|
||||
serializer_class = InventorySourceSerializer
|
||||
parent_model = Group
|
||||
relationship = 'inventory_sources'
|
||||
new_in_148 = True
|
||||
|
||||
class GroupActivityStreamList(SubListAPIView):
|
||||
|
||||
model = ActivityStream
|
||||
@@ -980,7 +996,6 @@ class InventorySourceDetail(RetrieveUpdateAPIView):
|
||||
serializer_class = InventorySourceSerializer
|
||||
new_in_14 = True
|
||||
|
||||
|
||||
class InventorySourceSchedulesList(SubListCreateAPIView):
|
||||
|
||||
view_name = "Inventory Source Schedules"
|
||||
@@ -1000,6 +1015,22 @@ class InventorySourceActivityStreamList(SubListAPIView):
|
||||
relationship = 'activitystream_set'
|
||||
new_in_145 = True
|
||||
|
||||
class InventorySourceHostsList(SubListAPIView):
|
||||
|
||||
model = Host
|
||||
serializer_class = HostSerializer
|
||||
parent_model = InventorySource
|
||||
relationship = 'hosts'
|
||||
new_in_148 = True
|
||||
|
||||
class InventorySourceGroupsList(SubListAPIView):
|
||||
|
||||
model = Group
|
||||
serializer_class = GroupSerializer
|
||||
parent_model = InventorySource
|
||||
relationship = 'groups'
|
||||
new_in_148 = True
|
||||
|
||||
class InventorySourceUpdatesList(SubListAPIView):
|
||||
|
||||
model = InventoryUpdate
|
||||
|
||||
Reference in New Issue
Block a user