Class: Zillabyte::API::Data
Instance Method Summary collapse
-
#append(id, options = {}) ⇒ Object
POST /datasets/1/append.
-
#create(name, options = {}) ⇒ Object
POST /datasets.
- #delete(id, options = {}) ⇒ Object
-
#get(id, options = {}) ⇒ Object
GET /datasets/1.
- #pull(id, options = {}) ⇒ Object
- #pull_to_s3(id, options) ⇒ Object
- #show(id, method, options = {}) ⇒ Object
Methods inherited from Base
Constructor Details
This class inherits a constructor from Zillabyte::API::Base
Instance Method Details
#append(id, options = {}) ⇒ Object
POST /datasets/1/append
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/zillabyte/api/data.rb', line 83 def append(id, = {}) res = @api.request( :expects => 200, :method => :post, :path => "/relations/#{CGI.escape(id)}/append", # :headers => {"Content-Type" => "application/octet-stream"}, :body => .to_json ) hash = res.body hash end |
#create(name, options = {}) ⇒ Object
POST /datasets
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/zillabyte/api/data.rb', line 48 def create(name, = {}) = { :name => name, # rows # schema # relations }.merge() res = @api.request( :expects => 200, :method => :post, :path => "/relations", :body => .to_json ) res.body end |
#delete(id, options = {}) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/zillabyte/api/data.rb', line 69 def delete(id, ={}) res = @api.request( :expects => 200, :method => :delete, :path => "/relations/#{CGI.escape(id)}", :body => .to_json ) res.body end |
#get(id, options = {}) ⇒ Object
GET /datasets/1
6 7 8 9 10 11 12 13 14 |
# File 'lib/zillabyte/api/data.rb', line 6 def get(id, = {}) res = @api.request( :expects => 200, :method => :get, :path => "/relations/#{CGI.escape(id)}", :body => .to_json ) res.body end |
#pull(id, options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/zillabyte/api/data.rb', line 27 def pull(id, = {}) res = @api.request( :expects => 200, :method => :post, :path => "/relations/#{CGI.escape(id)}/pull", :body => .to_json ) res.body end |
#pull_to_s3(id, options) ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/zillabyte/api/data.rb', line 37 def pull_to_s3(id, ) res = @api.request( :expects => 200, :method => :post, :path => "/relations/#{CGI.escape(id)}/pull_to_s3", :body => .to_json ) res.body end |
#show(id, method, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/zillabyte/api/data.rb', line 16 def show(id, method, = {}) res = @api.request( :expects => 200, :method => method, :path => "/relations/#{CGI.escape(id)}/samples", :body => .to_json ) res.body end |