lib/flydata/api/data_entry.rb in flydata-0.5.6 vs lib/flydata/api/data_entry.rb in flydata-0.5.7
- old
+ new
@@ -8,16 +8,22 @@
@model_name = 'data_entry'
@url_path = "/data_ports/:data_port_id/#{@model_name.pluralize}"
super
end
- 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}")
+ def buffer_stat(data_entry_id, options = {})
+ tables = options[:tables] ? options[:tables].join(',') : ''
+ @client.get("/#{@model_name.pluralize}/#{data_entry_id}/buffer_stat/#{options[:mode]}?tables=#{tables}")
end
- def cleanup_sync(data_entry_id, tables)
- @client.post("/#{@model_name.pluralize}/#{data_entry_id}/cleanup_sync", nil, {tables: tables.join(',')})
+ def table_status(data_entry_id, options = {})
+ tables = options[:tables] ? options[:tables].join(',') : ''
+ @client.post("/#{@model_name.pluralize}/#{data_entry_id}/table_status", nil, {tables: tables})
+ end
+
+ def cleanup_sync(data_entry_id, tables, options = {})
+ params = options.merge({tables: tables.join(',')})
+ @client.post("/#{@model_name.pluralize}/#{data_entry_id}/cleanup_sync", nil, params)
end
# Update validity of tables
# table_validity_hash: {"updated_tables":{ "bad_table": "error reason", "good_table": nil }}
# table "bad_table" will be marked invalid with reason "error reason"