mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-17 05:21:49 -05:00
Co-authored-by: Christopher Wang <cwang@ansible.com> Co-authored-by: Jake McDermott <jmcdermott@ansible.com> Co-authored-by: Jim Ladd <jladd@redhat.com> Co-authored-by: Elijah DeLee <kdelee@redhat.com> Co-authored-by: Alan Rominger <arominge@redhat.com> Co-authored-by: Yanis Guenane <yanis@guenane.org>
16 lines
443 B
Python
16 lines
443 B
Python
from awxkit.api.pages import Page
|
|
from awxkit.utils import random_title
|
|
|
|
|
|
class HasCopy(object):
|
|
|
|
def can_copy(self):
|
|
return self.get_related('copy').can_copy
|
|
|
|
def copy(self, name=''):
|
|
"""Return a copy of current page"""
|
|
payload = {"name": name or "Copy - " + random_title()}
|
|
endpoint = self.json.related['copy']
|
|
page = Page(self.connection, endpoint=endpoint)
|
|
return page.post(payload)
|