Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"copy" features are missed. #95

Open
hongzhaoo opened this issue Dec 10, 2021 · 6 comments
Open

"copy" features are missed. #95

hongzhaoo opened this issue Dec 10, 2021 · 6 comments

Comments

@hongzhaoo
Copy link

on awx web UI, users may create job templates or inventories by copying existing ones. it would be great helpful if the towerlib supports theses features.

@phospi
Copy link

phospi commented Dec 10, 2021

Yes, you may be right. But while waiting for someone to fix that, there is neat workaround to excute a copy action with towerlib:

towerlib = Tower("tower.com", "tower_user", "tower_pw", secure=True, ssl_verify=False)

job_template = towerlib_obj.get_job_template_by_name("My Job Template")
relative_url_copy = job_template.__dict__['_data']['related']['copy']

url = f'{towerlib.api[:-7]}{relative_url_copy}'
new_job_template_name = { "name": f'{job_template.name} - Copy' }

new_job_template = towerlib.session.post(url, json=new_job_template_name)

@costastf
Copy link
Collaborator

costastf commented Dec 10, 2021

This should be easy to implement. I will try to make some time next week for this.

@hongzhaoo
Copy link
Author

@phospi @costastf thank you guys.

@costastf
Copy link
Collaborator

@hongzhaoo, @phospi apologies for not picking this up, but I have been busy with the birth of my son and parental leave. Any chance @phospi you would like to provide a PR with the feature?

@phospi
Copy link

phospi commented Feb 11, 2022

@costastf Sorry, we are currently short-staffed. The workaround is sufficient for us. We don't plan to implement this feature at the time being.

@costastf
Copy link
Collaborator

Thanks @phospi I appreciate the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants