Sha256: 8a9ce4bac5d100b7d727effe22b2599b10804b09948c2b21987706d5c0b217b0

Contents?: true

Size: 757 Bytes

Versions: 12

Compression:

Stored size: 757 Bytes

Contents

module AnsibleTowerClient
  class JobTemplate < BaseModel
    def launch(options = {})
      launch_url = "#{url}launch/"
      response   = api.post(launch_url, options).body
      job        = JSON.parse(response)
      api.jobs.find(job['job'])
    end

    def survey_spec
      spec_url = related['survey_spec']
      return nil unless spec_url
      api.get(spec_url).body
    rescue AnsibleTowerClient::UnlicensedFeatureError
    end

    def survey_spec_hash
      survey_spec.nil? ? {} : hashify(:survey_spec)
    end

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

    def override_raw_attributes
      { :credential => :credential_id, :inventory => :inventory_id, :project => :project_id }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ansible_tower_client-0.17.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.16.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.15.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.14.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.13.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.12.2 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.12.1 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.12.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.11.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.10.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.9.0 lib/ansible_tower_client/base_models/job_template.rb
ansible_tower_client-0.8.0 lib/ansible_tower_client/base_models/job_template.rb