Class: OozieClient::OozieJob

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/oozie-client/oozie_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

included

Constructor Details

#initialize(oozie_id, options) ⇒ OozieJob

Returns a new instance of OozieJob.



7
8
9
10
# File 'lib/oozie-client/oozie_job.rb', line 7

def initialize oozie_id, options
  @oozie_id = oozie_id
  super(options)
end

Instance Attribute Details

#oozie_idObject (readonly)

Returns the value of attribute oozie_id.



5
6
7
# File 'lib/oozie-client/oozie_job.rb', line 5

def oozie_id
  @oozie_id
end

Instance Method Details

#definitionObject



35
36
37
# File 'lib/oozie-client/oozie_job.rb', line 35

def definition
  job_url.get({'params' => {'show' => 'definition'}})
end

#infoObject



31
32
33
# File 'lib/oozie-client/oozie_job.rb', line 31

def info
  JSON.parse job_url.get({'params' => {'show' => 'info'}})
end

#killObject



22
23
24
# File 'lib/oozie-client/oozie_job.rb', line 22

def kill
  job_url.put('', {'params' => {'action' => 'kill'}})
end

#logObject



39
40
41
# File 'lib/oozie-client/oozie_job.rb', line 39

def log
  job_url.get({'params' => {'show' => 'log'}})
end

#rerun(properties, params = {}) ⇒ Object



27
28
29
# File 'lib/oozie-client/oozie_job.rb', line 27

def rerun(properties, params={})
  job_url.put(properties_to_conf_xml(properties), {'params' => {'action' => 'rerun'}.merge(params)})
end

#resumeObject



19
20
21
# File 'lib/oozie-client/oozie_job.rb', line 19

def resume
  job_url.put('', {'params' => {'action' => 'resume'}})
end

#startObject



12
13
14
# File 'lib/oozie-client/oozie_job.rb', line 12

def start
  job_url.put('', {'params' => {'action' => 'start'}})
end

#suspendObject



16
17
18
# File 'lib/oozie-client/oozie_job.rb', line 16

def suspend
  job_url.put('', {'params' => {'action' => 'suspend'}})
end