Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Workflow Modify --extra-vars does not work with workflow name #735

Open
itcultus opened this issue Aug 29, 2019 · 1 comment
Open

Workflow Modify --extra-vars does not work with workflow name #735

itcultus opened this issue Aug 29, 2019 · 1 comment

Comments

@itcultus
Copy link

itcultus commented Aug 29, 2019

Since the tower_workflow_template cannot add the extra_vars during the workflow creation, I tried to create it via the tower-cli (version 3.3.0)

Although the --help says that the ID argument should be any identity element, it doesn't:

tower-cli workflow modify  --extra-vars "myownvar=yes" my_workflow_template
Error: The requested object could not be found.

When I use the ID of the object it works:

tower-cli workflow modify --extra-vars "myownvar=yes" 42

Resource changed.
== =========================== ============ 
id            name             organization 
== =========================== ============ 
42 my_workflow_template            1
== =========================== ============

If this is the expected behaviour, documentation should:

  1. Make it clear in the documentation
  2. Modify the functionality in order to support any identity object during the update.
@AlanCoding
Copy link
Member

You have very valid points about lack of documentation around this. I'd expect a variation of your command, might work in this form:

tower-cli workflow modify  --extra-vars "myownvar=yes" "my_workflow_template++Default"

The <pk> argument is allowed to be either the object id, or the named URL syntax. The named URL is a server feature and the detail view in the API browser (/api/v2/workflow_job_templates/N/) has a related link that will give you the syntax for that particular entry. Because name does not make something unique, the named URL will not work based on name alone.

But using named URL is quite a different animal from name-based lookup, which is done in a million other places.

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

No branches or pull requests

2 participants