Class: DataSift::Historics
- Inherits:
-
ApiResource
- Object
- ApiResource
- DataSift::Historics
- Defined in:
- lib/historics.rb
Overview
Methods for using DataSift Historics
Constant Summary
Constants inherited from ApiResource
ApiResource::TLSv1, ApiResource::TLSv1_2
Constants included from DataSift
APPLICATION_JSON, DELETE, DETECT_DEAD_SOCKETS, GET, HEAD, IS_WINDOWS, KNOWN_SOCKETS, SOCKET_DETECTOR_TIMEOUT, VERSION, X_ANALYSIS_TASKS_QUEUED, X_ANALYSIS_TASKS_QUEUE_LIMIT, X_INSIGHT_TASKS_QUEUED, X_INSIGHT_TASKS_QUEUE_LIMIT, X_RATELIMIT_COST, X_RATELIMIT_LIMIT, X_RATELIMIT_REMAINING, X_TASKS_QUEUED, X_TASKS_QUEUE_LIMIT
Instance Method Summary collapse
-
#delete(id) ⇒ Object
Delete an Historics query.
-
#get(max = 20, page = 1, with_estimate = 1) ⇒ Object
Get details for a list of Historics within the given page constraints.
-
#get_by_id(id, with_estimate = 1) ⇒ Object
Get details for a given Historics query.
-
#pause(id, reason = '') ⇒ Object
Pause Historics query.
-
#prepare(hash, start, end_time, name, sources = '', sample = 100) ⇒ Object
Prepare a new Historics query.
-
#resume(id) ⇒ Object
Resume Historics query.
-
#start(id) ⇒ Object
Start Historics query.
-
#status(start, end_time, sources = '') ⇒ Object
Check the data coverage in the archive for a specified interval.
-
#stop(id, reason = '') ⇒ Object
Stop Historics query.
-
#update(id, name) ⇒ Object
Update the name of an Historics query.
Methods inherited from ApiResource
Methods included from DataSift
Constructor Details
This class inherits a constructor from DataSift::ApiResource
Instance Method Details
#delete(id) ⇒ Object
Delete an Historics query
96 97 98 99 100 |
# File 'lib/historics.rb', line 96 def delete(id) params = { :id => id } requires params DataSift.request(:DELETE, 'historics/delete', @config, params) end |
#get(max = 20, page = 1, with_estimate = 1) ⇒ Object
Get details for a list of Historics within the given page constraints
119 120 121 122 123 |
# File 'lib/historics.rb', line 119 def get(max = 20, page = 1, with_estimate = 1) params = { :max => max, :page => page, :with_estimate => with_estimate } requires params DataSift.request(:GET, 'historics/get', @config, params) end |
#get_by_id(id, with_estimate = 1) ⇒ Object
Get details for a given Historics query
107 108 109 110 111 |
# File 'lib/historics.rb', line 107 def get_by_id(id, with_estimate = 1) params = { :id => id, :with_estimate => with_estimate } requires params DataSift.request(:GET, 'historics/get', @config, params) end |
#pause(id, reason = '') ⇒ Object
Pause Historics query
33 34 35 36 37 38 |
# File 'lib/historics.rb', line 33 def pause(id, reason = '') params = { :id => id } requires params params[:reason] = reason DataSift.request(:PUT, 'historics/pause', @config, params) end |
#prepare(hash, start, end_time, name, sources = '', sample = 100) ⇒ Object
Prepare a new Historics query
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/historics.rb', line 16 def prepare(hash, start, end_time, name, sources = '', sample = 100) params = { :hash => hash, :start => start, :end => end_time, :name => name, :sources => sources, :sample => sample } requires params DataSift.request(:POST, 'historics/prepare', @config, params) end |
#resume(id) ⇒ Object
Resume Historics query
43 44 45 46 47 |
# File 'lib/historics.rb', line 43 def resume(id) params = { :id => id } requires params DataSift.request(:PUT, 'historics/resume', @config, params) end |
#start(id) ⇒ Object
Start Historics query
52 53 54 55 56 |
# File 'lib/historics.rb', line 52 def start(id) params = { :id => id } requires params DataSift.request(:POST, 'historics/start', @config, params) end |
#status(start, end_time, sources = '') ⇒ Object
Check the data coverage in the archive for a specified interval
77 78 79 80 81 |
# File 'lib/historics.rb', line 77 def status(start, end_time, sources = '') params = { :start => start, :end => end_time, :sources => sources } requires params DataSift.request(:GET, 'historics/status', @config, params) end |
#stop(id, reason = '') ⇒ Object
Stop Historics query
62 63 64 65 66 67 |
# File 'lib/historics.rb', line 62 def stop(id, reason = '') params = { :id => id } requires params params[:reason] = reason DataSift.request(:POST, 'historics/stop', @config, params) end |
#update(id, name) ⇒ Object
Update the name of an Historics query
87 88 89 90 91 |
# File 'lib/historics.rb', line 87 def update(id, name) params = { :id => id, :name => name } requires params DataSift.request(:POST, 'historics/update', @config, params) end |