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/google/models/compute/servers.rb
2013-03-12 14:35:19 -07:00

28 lines
500 B
Ruby

require 'fog/core/collection'
require 'fog/google/models/compute/server'
module Fog
module Compute
class Google
class Servers < Fog::Collection
model Fog::Compute::Google::Server
def all
data = service.list_servers.body["items"]
load(data)
end
def get(identity)
data = connection.get_server(identity).body
new(data)
rescue Excon::Errors::NotFound
nil
end
end
end
end
end