ruboozie 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/oozie_jobs.rb +8 -8
  2. data/lib/oozie_objects.rb +2 -2
  3. metadata +3 -3
data/lib/oozie_jobs.rb CHANGED
@@ -36,20 +36,20 @@ module OozieJobs
36
36
  OozieJob.new oozie_get(resource, :json)
37
37
  end
38
38
 
39
- def submit_job(params)
40
- conf = params[:conf_xml]
41
- properties = params[:properties_hash]
39
+ # submit a job given the properties, params optionsl
40
+ # properties is a hash of the form {name => value}
41
+ # param example: {:action => :start} [starts the job on submission]
42
+ def submit_job(properties, params = {})
42
43
 
43
- body = conf || properties_hash_to_conf_xml(properties)
44
+ body = properties_hash_to_conf_xml(properties)
44
45
 
45
46
  start_now = params[:start_now]
46
-
47
- resource = "/jobs"
48
- resource += "?action=start" if start_now
47
+ proper_params = params.map{|k,v| "#{k}=#{v}"}.join("&")
48
+ resource = "/jobs?#{proper_params}"
49
49
 
50
50
  response = oozie_post(resource, :json, :body => body, :headers => {"Content-Type" => "application/xml"})
51
51
  id = response['id']
52
- id
52
+ info(id)
53
53
  end
54
54
 
55
55
  def start_job(job_id)
data/lib/oozie_objects.rb CHANGED
@@ -11,8 +11,8 @@ class OozieJob < OozieObject
11
11
  OozieApi.log(self.id)
12
12
  end
13
13
 
14
- def info
15
- OozieJobInfo.new(OozieApi.info(self.id))
14
+ def reload
15
+ OozieApi.info(self.id)
16
16
  end
17
17
 
18
18
  def definition
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboozie
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - dguttman