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/zones.rb

28 lines
495 B
Ruby
Raw Normal View History

2013-09-26 11:52:15 -04:00
require 'fog/core/collection'
require 'fog/google/models/compute/zone'
module Fog
module Compute
class Google
class Zones < Fog::Collection
model Fog::Compute::Google::Zone
def all
data = service.list_zones.body["items"] || []
load(data)
end
def get(identity)
data = connection.get_zone(identity).body
new(data)
rescue Excon::Errors::NotFound
nil
end
end
end
end
end