ruboozie 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/oozie_jobs.rb +8 -8
- data/lib/oozie_objects.rb +2 -2
- 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
|
-
|
40
|
-
|
41
|
-
|
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 =
|
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
metadata
CHANGED