Sha256: d7cc16a63dc1224dfc823f8bc68a1a5e7021cd18edbc64b3f8f07404a18e3dac

Contents?: true

Size: 932 Bytes

Versions: 8

Compression:

Stored size: 932 Bytes

Contents

class TreasureData::API
module Export

  ####
  ## Export API
  ##

  # => jobId:String
  # @param [String] db
  # @param [String] table
  # @param [String] storage_type
  # @param [Hash] opts
  # @return [String] job_id
  def export(db, table, storage_type, opts={})
    params = opts.dup
    params['storage_type'] = storage_type
    code, body, res = post("/v3/export/run/#{e db}/#{e table}", params)
    if code != "200"
      raise_error("Export failed", res)
    end
    js = checked_json(body, %w[job_id])
    return js['job_id'].to_s
  end

  # => jobId:String
  # @param [String] target_job_id
  # @param [Hash] opts
  # @return [String] job_id
  def result_export(target_job_id, opts={})
    code, body, res = post("/v3/job/result_export/#{target_job_id}", opts)
    if code != "200"
      raise_error("Result Export failed", res)
    end
    js = checked_json(body, %w[job_id])
    return js['job_id'].to_s
  end
end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
td-client-1.0.5 lib/td/client/api/export.rb
td-client-1.0.4 lib/td/client/api/export.rb
td-client-1.0.3 lib/td/client/api/export.rb
td-client-1.0.2 lib/td/client/api/export.rb
td-client-1.0.1 lib/td/client/api/export.rb
td-client-1.0.0-java lib/td/client/api/export.rb
td-client-1.0.0 lib/td/client/api/export.rb
td-client-0.8.85 lib/td/client/api/export.rb