Fixes #38547 - Add job template clone command to expose clone API endpoint#55
Conversation
4b846e4 to
a3c7794
Compare
adamruzicka
left a comment
There was a problem hiding this comment.
This should have the same interface as hammer template clone - --name (and --id) should identify the source template (the one being cloned), --new-name should be the name for the clone
|
Tested the changes and everything works as expected |
|
Here is the command Adam was referring to https://github.com/theforeman/hammer-cli-foreman/blob/master/lib/hammer_cli_foreman/template.rb#L190-L218 |
| let(:cmd) { HammerCLIForemanRemoteExecution::JobTemplate::CloneCommand.new('', ctx) } | ||
|
|
||
| describe 'parameters' do | ||
| it_should_accept 'id and name', ['--id=1', '--name=Cloned Template'] |
There was a problem hiding this comment.
The be bin/hammer template clone --new-name "clone_wars" --id 150 command uses --new-name param, we should do the same here, as mentioned by other reviewers.
a3c7794 to
7dca8bf
Compare
|
@adamruzicka @stejskalleos Updated, Thank you! Could you please take another look at this PR? |
|
Tested using packit, Works as expected. |
stejskalleos
left a comment
There was a problem hiding this comment.
@Gauravtalreja1 Rubocop CI is failing, please fix it so we can merge it.
…point Exposes the POST /api/job_templates/:id/clone API endpoint that was previously unavailable in the Hammer CLI. Signed-off-by: Gaurav Talreja <gtalreja@redhat.com>
Signed-off-by: Gaurav Talreja <gtalreja@redhat.com>
7dca8bf to
afb6645
Compare
stejskalleos
left a comment
There was a problem hiding this comment.
🍏 LGTM
hammer job-template clone --new-name "clone_wars" --id 150
Job template cloned
Description:
Exposeing the
POST /api/job_templates/:id/cloneAPI endpoint that was previously unavailable in the Hammer CLITest Results: