mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Added instance_groups method to the awxkit models
Also added additional payload fields to the wfjt model.
This commit is contained in:
parent
4579ab0d60
commit
ffe970aee5
@ -48,10 +48,12 @@ class Schedules(page.PageList, Schedule):
|
||||
self.related.credentials.post(dict(id=cred.id, disassociate=True))
|
||||
|
||||
def add_label(self, label):
|
||||
if isinstance(label, page.Page):
|
||||
label = label.json
|
||||
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)
|
||||
|
||||
@ -32,6 +32,11 @@ class WorkflowJobTemplateNode(HasCreate, base.Base):
|
||||
'extra_data',
|
||||
'identifier',
|
||||
'all_parents_must_converge',
|
||||
# prompt fields for JTs
|
||||
'job_slice_count',
|
||||
'forks',
|
||||
'timeout',
|
||||
'execution_environment',
|
||||
)
|
||||
|
||||
update_payload(payload, optional_fields, kwargs)
|
||||
@ -93,10 +98,12 @@ class WorkflowJobTemplateNode(HasCreate, base.Base):
|
||||
return candidates.results.pop()
|
||||
|
||||
def add_label(self, label):
|
||||
if isinstance(label, page.Page):
|
||||
label = label.json
|
||||
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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user