2012-06-22 06:03:29 -04:00
|
|
|
require 'fog/core/collection'
|
2012-06-22 09:47:42 -04:00
|
|
|
require 'fog/serverlove/models/compute/server'
|
2012-06-22 06:03:29 -04:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Serverlove
|
|
|
|
|
|
|
|
class Servers < Fog::Collection
|
|
|
|
|
|
|
|
model Fog::Compute::Serverlove::Server
|
|
|
|
|
|
|
|
def all
|
2012-12-22 18:23:47 -05:00
|
|
|
data = service.get_servers.body
|
2012-06-22 06:03:29 -04:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(server_id)
|
2012-12-22 18:23:47 -05:00
|
|
|
data = service.get_server(server_id).body
|
2012-07-15 11:19:53 -04:00
|
|
|
new(data)
|
2012-06-22 06:03:29 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|