Module: TreasureData::API::PartialDelete

Included in:
TreasureData::API
Defined in:
lib/td/client/api/partial_delete.rb

Instance Method Summary collapse

Instance Method Details

#partial_delete(db, table, to, from, opts = {}) ⇒ String

Parameters:

  • db (String)
  • table (String)
  • to (Fixnum)
  • from (Fixnum)
  • opts (Hash) (defaults to: {})

Returns:

  • (String)


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/td/client/api/partial_delete.rb', line 14

def partial_delete(db, table, to, from, opts={})
  params = opts.dup
  params['to'] = to.to_s
  params['from'] = from.to_s
  code, body, res = post("/v3/table/partialdelete/#{e db}/#{e table}", params)
  if code != "200"
    raise_error("Partial delete failed", res)
  end
  js = checked_json(body, %w[job_id])
  return js['job_id'].to_s
end