Class: Zillabyte::API::Zillalogs

Inherits:
Base
  • Object
show all
Defined in:
lib/zillabyte/api/zillalogs.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #request

Constructor Details

This class inherits a constructor from Zillabyte::API::Base

Instance Method Details

#find(id, session = nil, options = {}) ⇒ Object

GET /zillalogs/id



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/zillabyte/api/zillalogs.rb', line 24

def find(id, session = nil, options = {})
  
  # Get the resource
  res = @api.request(
    :expects  => 200,
    :method   => :get,
    :path     => "/zillalogs/#{id}"
  )
  
  res.body
  
end

#list(options = {}) ⇒ Object

GET /zillalogs



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/zillabyte/api/zillalogs.rb', line 6

def list(options = {})

  options = {
    # TODO
  }.merge(options)
  
  res = @api.request(
    :expects  => 200,
    :method   => :get,
    :path     => "/zillalogs"
  )
  
  res.body

end

#save(id, name, zillalog, options = {}) ⇒ Object

POST /zillalogs



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/zillabyte/api/zillalogs.rb', line 41

def save(id, name, zillalog, options = {})
  
  options = {
    :name => name,
    :zillalog => zillalog
  }.merge(options)
  
  options[:id] = id if id
  
  res = @api.request(
    :expects  => 200,
    :method   => :post,
    :path     => "/zillalogs",
    :body     => options.to_json
  )

  res.body
  
end