Class: AnsibleTowerClient::WorkflowJobTemplate

Inherits:
JobTemplate show all
Defined in:
lib/ansible_tower_client/base_models/workflow_job_template.rb

Instance Attribute Summary

Attributes inherited from BaseModel

#api, #raw_hash

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from JobTemplate

#extra_vars_hash, #survey_spec, #survey_spec_hash

Methods inherited from BaseModel

base_class, create, create!, #destroy, #destroy!, #hashify, #initialize, #save, #save!, #update_attributes, #update_attributes!

Methods inherited from HashModel

#==, #[], #initialize, #inspect, #to_h, #to_json

Constructor Details

This class inherits a constructor from AnsibleTowerClient::BaseModel

Class Method Details

.endpointObject



3
4
5
# File 'lib/ansible_tower_client/base_models/workflow_job_template.rb', line 3

def self.endpoint
  'workflow_job_templates'.freeze
end

Instance Method Details

#launch(options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/ansible_tower_client/base_models/workflow_job_template.rb', line 7

def launch(options = {})
  launch_url = "#{url}launch/"
  response   = api.post(launch_url, options).body
  job        = JSON.parse(response)
  api.workflow_jobs.find(job['workflow_job'])
end

#override_raw_attributesObject



18
19
20
# File 'lib/ansible_tower_client/base_models/workflow_job_template.rb', line 18

def override_raw_attributes
  { :organization => :organization_id }
end

#workflow_nodesObject



14
15
16
# File 'lib/ansible_tower_client/base_models/workflow_job_template.rb', line 14

def workflow_nodes
  Collection.new(api).find_all_by_url(related['workflow_nodes'])
end