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/compute_v2/servers.rb

25 lines
542 B
Ruby

require 'fog/core/collection'
require 'fog/rackspace/models/compute_v2/server'
module Fog
module Compute
class RackspaceV2
class Servers < Fog::Collection
model Fog::Compute::RackspaceV2::Server
def all
data = connection.list_servers.body['servers']
load(data)
end
def get(server_id)
data = connection.get_server(server_id).body['server']
new(data)
rescue Fog::Compute::RackspaceV2::NotFound
nil
end
end
end
end
end