Class: Datahen::Client::JobOutput

Inherits:
Base
  • Object
show all
Defined in:
lib/datahen/client/job_output.rb

Constant Summary

Constants inherited from Base

Base::CHECK_EMPTY_BODY, Base::CHECK_NIL, Base::DEFAULT_RETRY_LIMIT

Instance Method Summary collapse

Methods inherited from Base

#auth_token, #auth_token=, #default_retry_limit, #env_api_url, env_auth_token, env_ignore_ssl, #ignore_ssl, #initialize, #left_merge, random_delay, #retry

Constructor Details

This class inherits a constructor from Datahen::Client::Base

Instance Method Details

#all(job_id, collection = 'default', opts = {}) ⇒ Object



8
9
10
11
12
13
# File 'lib/datahen/client/job_output.rb', line 8

def all(job_id, collection = 'default', opts = {})
  limit = opts.has_key?(:retry_limit) ? opts.fetch(:retry_limit) : 0
  self.retry(limit, 10, "Error while updating the seeder.", true, CHECK_EMPTY_BODY) do
    self.class.get("/jobs/#{job_id}/output/collections/#{collection}/records", @options)
  end
end

#collections(job_id) ⇒ Object



15
16
17
# File 'lib/datahen/client/job_output.rb', line 15

def collections(job_id)
  self.class.get("/jobs/#{job_id}/output/collections", @options)
end

#find(job_id, collection, id) ⇒ Object



4
5
6
# File 'lib/datahen/client/job_output.rb', line 4

def find(job_id, collection, id)
  self.class.get("/jobs/#{job_id}/output/collections/#{collection}/records/#{id}", @options)
end