Workflow Node

Description

This resource is used for managing workflow job template nodes in Tower. It can also used for building workflow topology by associating/disassociating nodes.

Fields Table

name type help_text read_only unique filterable required
workflow_job_template Resource workflow The workflow_job_template field. False False True True
unified_job_template String The unified_job_template field. False False True False
inventory Resource inventory The inventory field. False False True False
credential Resource credential The credential field. False False True False
job_type String The job_type field. False False True False
job_tags String The job_tags field. False False True False
skip_tags String The skip_tags field. False False True False
limit String The limit field. False False True False

API Specification

class tower_cli.resources.node.Resource[source]

A resource for workflow nodes.

associate_always_node(**kwargs)[source]

Add a node to always run after the parent is finished.

Parameters:
  • parent (int) – Primary key of parent node to associate always node to.
  • child (int) – Primary key of child node to be associated.
  • **kwargs – Fields used to create child node if child is not provided.
Returns:

Dictionary of only one key “changed”, which indicates whether the association succeeded.

Return type:

dict

associate_failure_node(**kwargs)[source]

Add a node to run on failure.

Parameters:
  • parent (int) – Primary key of parent node to associate failure node to.
  • child (int) – Primary key of child node to be associated.
  • **kwargs – Fields used to create child node if child is not provided.
Returns:

Dictionary of only one key “changed”, which indicates whether the association succeeded.

Return type:

dict

associate_success_node(**kwargs)[source]

Add a node to run on success.

Parameters:
  • parent (int) – Primary key of parent node to associate success node to.
  • child (int) – Primary key of child node to be associated.
  • **kwargs – Fields used to create child node if child is not provided.
Returns:

Dictionary of only one key “changed”, which indicates whether the association succeeded.

Return type:

dict

copy(pk=None, new_name=None, **kwargs)[source]

Copy an object.

Parameters:
  • pk (int) – Primary key of the resource object to be copied
  • new_name – The new name to give the resource if deep copying via the API
  • **kwargs – Keyword arguments of fields whose given value will override the original value.
Returns:

loaded JSON of the copied new resource object.

Return type:

dict

create(**kwargs)[source]

Create an object.

Parameters:
  • fail_on_found (bool) – Flag that if set, the operation fails if an object matching the unique criteria already exists.
  • force_on_exists (bool) – Flag that if set, then if a match is found on unique fields, other fields will be updated to the provided values.; If unset, a match causes the request to be a no-op.
  • **kwargs – Keyword arguments which, all together, will be used as POST body to create the resource object.
Returns:

A dictionary combining the JSON output of the created resource, as well as two extra fields: “changed”, a flag indicating if the resource is created successfully; “id”, an integer which is the primary key of the created object.

Return type:

dict

delete(pk=None, fail_on_missing=False, **kwargs)

Remove the given object.

Parameters:
  • pk (int) – Primary key of the resource to be deleted.
  • fail_on_missing (bool) – Flag that if set, the object’s not being found is considered a failure; otherwise, a success with no change is reported.
  • **kwargs – Keyword arguments used to look up resource object to delete if pk is not provided.
Returns:

dictionary of only one field “changed”, which is a flag indicating whether the specified resource is successfully deleted.

Return type:

dict

disassociate_always_node(parent, child)[source]

Remove an always node link.

Parameters:
  • parent (int) – Primary key of parent node to disassociate always node from.
  • child (int) – Primary key of child node to be disassociated.
Returns:

Dictionary of only one key “changed”, which indicates whether the disassociation succeeded.

Return type:

dict

disassociate_failure_node(parent, child)[source]

Remove a failure node link.

Parameters:
  • parent (int) – Primary key of parent node to disassociate failure node from.
  • child (int) – Primary key of child node to be disassociated.
Returns:

Dictionary of only one key “changed”, which indicates whether the disassociation succeeded.

Return type:

dict

disassociate_success_node(parent, child)[source]

Remove success node.

Parameters:
  • parent (int) – Primary key of parent node to disassociate success node from.
  • child (int) – Primary key of child node to be disassociated.
Returns:

Dictionary of only one key “changed”, which indicates whether the disassociation succeeded.

Return type:

dict

get(pk=None, **kwargs)

Retrieve one and exactly one object.

Parameters:
  • pk (int) – Primary key of the resource to be read. Tower CLI will only attempt to read that object if pk is provided (not None).
  • **kwargs – Keyword arguments used to look up resource object to retrieve if pk is not provided.
Returns:

loaded JSON of the retrieved resource object.

Return type:

dict

list(all_pages=False, **kwargs)

Retrieve a list of objects.

Parameters:
  • all_pages (bool) – Flag that if set, collect all pages of content from the API when returning results.
  • page (int) – The page to show. Ignored if all_pages is set.
  • query (list) – Contains 2-tuples used as query parameters to filter resulting resource objects.
  • **kwargs – Keyword arguments list of available fields used for searching resource objects.
Returns:

A JSON object containing details of all resource objects returned by Tower backend.

Return type:

dict

modify(pk=None, create_on_missing=False, **kwargs)[source]

Modify an already existing object.

Parameters:
  • pk (int) – Primary key of the resource to be modified.
  • create_on_missing (bool) – Flag that if set, a new object is created if pk is not set and objects matching the appropriate unique criteria is not found.
  • **kwargs – Keyword arguments which, all together, will be used as PATCH body to modify the resource object. if pk is not set, key-value pairs of **kwargs which are also in resource’s identity will be used to lookup existing reosource.
Returns:

A dictionary combining the JSON output of the modified resource, as well as two extra fields: “changed”, a flag indicating if the resource is successfully updated; “id”, an integer which is the primary key of the updated object.

Return type:

dict