Implement splitting logic in inventory & job task code

This commit is contained in:
AlanCoding
2018-08-27 11:08:06 -04:00
parent 44ffcf86de
commit dab678c5cc
8 changed files with 89 additions and 32 deletions

View File

@@ -2452,6 +2452,7 @@ class InventoryScriptView(RetrieveAPIView):
hostvars = bool(request.query_params.get('hostvars', ''))
towervars = bool(request.query_params.get('towervars', ''))
show_all = bool(request.query_params.get('all', ''))
subset = request.query_params.get('subset', '')
if hostname:
hosts_q = dict(name=hostname)
if not show_all:
@@ -2461,7 +2462,8 @@ class InventoryScriptView(RetrieveAPIView):
return Response(obj.get_script_data(
hostvars=hostvars,
towervars=towervars,
show_all=show_all
show_all=show_all,
subset=subset
))
@@ -3396,6 +3398,15 @@ class JobTemplateJobsList(SubListCreateAPIView):
return methods
class JobTemplateShardedJobsList(SubListCreateAPIView):
model = WorkflowJob
serializer_class = WorkflowJobListSerializer
parent_model = JobTemplate
relationship = 'sharded_jobs'
parent_key = 'job_template'
class JobTemplateInstanceGroupsList(SubListAttachDetachAPIView):
model = InstanceGroup