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

24 lines
498 B
Ruby
Raw Normal View History

require 'fog/rackspace/models/compute_v2/network'
module Fog
module Compute
class RackspaceV2
class Networks < Fog::Collection
model Fog::Compute::RackspaceV2::Network
def all
data = service.list_networks.body['networks']
load(data)
end
def get(id)
data = service.get_network(id).body['network']
new(data)
rescue Fog::Compute::RackspaceV2::NotFound
nil
end
end
end
end
end