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/networking_v2/ports.rb
2014-12-17 15:01:55 -05:00

23 lines
490 B
Ruby

require 'fog/rackspace/models/networking_v2/port'
module Fog
module Rackspace
class NetworkingV2
class Ports < Fog::Collection
model Fog::Rackspace::NetworkingV2::Port
def all
data = service.list_ports.body['ports']
load(data)
end
def get(id)
data = service.show_port(id).body['port']
new(data)
rescue Fog::Rackspace::NetworkingV2::NotFound
nil
end
end
end
end
end