1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/models/servers/servers.rb

31 lines
582 B
Ruby
Raw Normal View History

module Fog
module Rackspace
class Servers
def servers
Fog::Rackspace::Servers::Servers.new(:connection => self)
end
class Servers < Fog::Collection
model Fog::Rackspace::Servers::Server
def all
data = connection.list_servers_detail.body['servers']
load(data)
end
def get(server_id)
if server = connection.get_server_details(server_id).body['server']
new(server)
end
rescue Excon::Errors::NotFound
nil
end
end
end
end
end