mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
23 lines
501 B
Ruby
23 lines
501 B
Ruby
require 'fog/rackspace/models/compute_v2/network'
|
|
|
|
module Fog
|
|
module Rackspace
|
|
class Networking
|
|
class Networks < Fog::Collection
|
|
model Fog::Rackspace::Networking::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::Rackspace::Networking::NotFound
|
|
nil
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|