Class: Flydata::Api::DataEntry
- Defined in:
- lib/flydata/api/data_entry.rb
Instance Method Summary collapse
- #buffer_stat(data_entry_id, params = {}) ⇒ Object
- #cleanup_sync(data_entry_id, tables) ⇒ Object
-
#initialize(api_client) ⇒ DataEntry
constructor
A new instance of DataEntry.
-
#update_table_validity(data_entry_id, table_validity_hash) ⇒ Object
Update validity of tables table_validity_hash: { “bad_table”: “error reason”, “good_table”: nil } table “bad_table” will be marked invalid with reason “error reason” table “good table” will be marked valid, that is, clear its error reason if it’s set.
Methods inherited from Base
Constructor Details
#initialize(api_client) ⇒ DataEntry
Returns a new instance of DataEntry.
7 8 9 10 11 |
# File 'lib/flydata/api/data_entry.rb', line 7 def initialize(api_client) @model_name = 'data_entry' @url_path = "/data_ports/:data_port_id/#{@model_name.pluralize}" super end |
Instance Method Details
#buffer_stat(data_entry_id, params = {}) ⇒ Object
13 14 15 16 |
# File 'lib/flydata/api/data_entry.rb', line 13 def buffer_stat(data_entry_id, params = {}) tables = params[:tables] ? params[:tables].join(',') : '' @client.get("/#{@model_name.pluralize}/#{data_entry_id}/buffer_stat/#{params[:mode]}?tables=#{tables}") end |
#cleanup_sync(data_entry_id, tables) ⇒ Object
18 19 20 |
# File 'lib/flydata/api/data_entry.rb', line 18 def cleanup_sync(data_entry_id, tables) @client.post("/#{@model_name.pluralize}/#{data_entry_id}/cleanup_sync", nil, {tables: tables.join(',')}) end |
#update_table_validity(data_entry_id, table_validity_hash) ⇒ Object
Update validity of tables
table_validity_hash: { "bad_table": "error reason", "good_table": nil }
table "bad_table" will be marked invalid with reason "error reason"
table "good table" will be marked valid, that is, clear its error reason if it's set.
26 27 28 |
# File 'lib/flydata/api/data_entry.rb', line 26 def update_table_validity(data_entry_id, table_validity_hash) @client.post("/#{@model_name.pluralize}/#{data_entry_id}/update_table_validity", {:headers => {:content_type => :json}}, table_validity_hash.to_json) end |