Module: Hinoki::Clients

Defined in:
lib/hinoki/clients.rb

Class Method Summary collapse

Class Method Details

.all(limit = nil, offset = nil) ⇒ Object

Retrieves list of all clients



9
10
11
12
13
14
15
# File 'lib/hinoki/clients.rb', line 9

def self.all(limit=nil, offset=nil)
  url = "/clients"
  if limit  then url.append("?limit=#{limit}") end
  if offset then url.append("&offset=#{offset}") end

  return Hinoki.conn.get(url)
end

.by_name(client) ⇒ Object

Gets info about a specific client



18
19
20
# File 'lib/hinoki/clients.rb', line 18

def self.by_name(client)
  return Hinoki.conn.get("/clients/#{client}")
end

.delete(client) ⇒ Object

Deletes a client (and resolves its events)



23
24
25
# File 'lib/hinoki/clients.rb', line 23

def self.delete(client)
  return Hinoki.conn.delete("/clients/#{client}")
end

.history(client) ⇒ Object

Gets recent history of this client’s status



28
29
30
# File 'lib/hinoki/clients.rb', line 28

def self.history(client)
  return Hinoki.conn.get("/clients/#{client}/history")
end