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/hp/models/lb/protocols.rb

26 lines
538 B
Ruby
Raw Normal View History

2013-03-01 14:26:52 -06:00
require 'fog/core/collection'
2013-03-06 11:01:54 -06:00
require 'fog/hp/models/lb/protocol'
2013-03-01 14:26:52 -06:00
module Fog
module HP
class LB
class Protocols < Fog::Collection
model Fog::HP::LB::Protocol
def all
data = service.list_protocols.body['protocols']
2013-03-01 14:26:52 -06:00
load(data)
end
def get(name)
data = service.list_protocols.body['protocols']
protocol = data.find {|p| p['name'] == name}
new(protocol)
2013-03-01 14:26:52 -06:00
rescue Fog::HP::LB::NotFound
nil
end
end
end
end
end