Module: Sem4r::BulkMutateJobAccountExtension
- Included in:
- Account
- Defined in:
- lib/sem4r/bulk_mutate_job/bulk_mutate_job_account_extension.rb
Instance Method Summary collapse
- #job_delete(job_id) ⇒ Object
- #job_mutate(bulk_mutate_job) ⇒ Object
- #job_result(job_id) ⇒ Object
- #jobs(refresh = false) ⇒ Object
- #p_jobs ⇒ Object
Instance Method Details
#job_delete(job_id) ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/sem4r/bulk_mutate_job/bulk_mutate_job_account_extension.rb', line 40 def job_delete(job_id) job = BulkMutateJob.new job.instance_eval { @id = job_id } operation = JobOperation.remove(job) = service.bulk_mutate_job.mutate(credentials, operation.to_xml("operation")) add_counters(.counters) self end |
#job_mutate(bulk_mutate_job) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/sem4r/bulk_mutate_job/bulk_mutate_job_account_extension.rb', line 50 def job_mutate(bulk_mutate_job) = service.bulk_mutate_job.mutate(credentials, bulk_mutate_job.to_xml("operation")) add_counters(.counters) el = .response.at_xpath("//rval") BulkMutateJob.from_element(el) end |
#job_result(job_id) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sem4r/bulk_mutate_job/bulk_mutate_job_account_extension.rb', line 29 def job_result(job_id) selector = BulkMutateJobSelector.new do jobId job_id stats true history true end = service.bulk_mutate_job.get(credentials, selector.to_xml) add_counters(.counters) self end |
#jobs(refresh = false) ⇒ Object
65 66 67 68 |
# File 'lib/sem4r/bulk_mutate_job/bulk_mutate_job_account_extension.rb', line 65 def jobs(refresh = false) _jobs unless @jobs and !refresh @jobs end |
#p_jobs ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/sem4r/bulk_mutate_job/bulk_mutate_job_account_extension.rb', line 57 def p_jobs puts "#{jobs.length} bulk mutate jobs" jobs.each do |job| puts job.to_s end self end |