mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 01:38:50 -03:30
Added instance_groups method to the awxkit models
Also added additional payload fields to the wfjt model.
This commit is contained in:
committed by
Alan Rominger
parent
4579ab0d60
commit
ffe970aee5
@@ -48,10 +48,12 @@ class Schedules(page.PageList, Schedule):
|
|||||||
self.related.credentials.post(dict(id=cred.id, disassociate=True))
|
self.related.credentials.post(dict(id=cred.id, disassociate=True))
|
||||||
|
|
||||||
def add_label(self, label):
|
def add_label(self, label):
|
||||||
if isinstance(label, page.Page):
|
|
||||||
label = label.json
|
|
||||||
with suppress(exc.NoContent):
|
with suppress(exc.NoContent):
|
||||||
self.related.labels.post(label)
|
self.related.labels.post(dict(id=label.id))
|
||||||
|
|
||||||
|
def add_instance_group(self, instance_group):
|
||||||
|
with suppress(exc.NoContent):
|
||||||
|
self.related.instance_groups.post(dict(id=instance_group.id))
|
||||||
|
|
||||||
|
|
||||||
page.register_page([resources.schedules, resources.related_schedules], Schedules)
|
page.register_page([resources.schedules, resources.related_schedules], Schedules)
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ class WorkflowJobTemplateNode(HasCreate, base.Base):
|
|||||||
'extra_data',
|
'extra_data',
|
||||||
'identifier',
|
'identifier',
|
||||||
'all_parents_must_converge',
|
'all_parents_must_converge',
|
||||||
|
# prompt fields for JTs
|
||||||
|
'job_slice_count',
|
||||||
|
'forks',
|
||||||
|
'timeout',
|
||||||
|
'execution_environment',
|
||||||
)
|
)
|
||||||
|
|
||||||
update_payload(payload, optional_fields, kwargs)
|
update_payload(payload, optional_fields, kwargs)
|
||||||
@@ -93,10 +98,12 @@ class WorkflowJobTemplateNode(HasCreate, base.Base):
|
|||||||
return candidates.results.pop()
|
return candidates.results.pop()
|
||||||
|
|
||||||
def add_label(self, label):
|
def add_label(self, label):
|
||||||
if isinstance(label, page.Page):
|
|
||||||
label = label.json
|
|
||||||
with suppress(exc.NoContent):
|
with suppress(exc.NoContent):
|
||||||
self.related.labels.post(label)
|
self.related.labels.post(dict(id=label.id))
|
||||||
|
|
||||||
|
def add_instance_group(self, instance_group):
|
||||||
|
with suppress(exc.NoContent):
|
||||||
|
self.related.instance_groups.post(dict(id=instance_group.id))
|
||||||
|
|
||||||
|
|
||||||
page.register_page(
|
page.register_page(
|
||||||
|
|||||||
Reference in New Issue
Block a user