Class: AnsibleTowerClient::Job

Inherits:
BaseModel show all
Defined in:
lib/ansible_tower_client/base_models/job.rb

Instance Attribute Summary

Attributes inherited from BaseModel

#api, #raw_hash

Instance Method Summary collapse

Methods inherited from BaseModel

base_class, create, create!, #destroy, #destroy!, endpoint, #hashify, #initialize, #override_raw_attributes, #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

Instance Method Details

#extra_vars_hashObject



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

def extra_vars_hash
  extra_vars.empty? ? {} : hashify(:extra_vars)
end

#job_events(options = nil) ⇒ Object



7
8
9
# File 'lib/ansible_tower_client/base_models/job.rb', line 7

def job_events(options = nil)
  Collection.new(api, api.job_event_class).find_all_by_url(related["job_events"], options)
end

#stdout(format = 'txt') ⇒ Object



11
12
13
14
15
# File 'lib/ansible_tower_client/base_models/job.rb', line 11

def stdout(format = 'txt')
  out_url = related['stdout']
  return unless out_url
  api.get("#{out_url}?format=#{format}").body
end