2013-02-17 18:14:17 -05:00
|
|
|
require 'fog/core/collection'
|
2013-02-18 21:09:19 -05:00
|
|
|
require 'fog/bluebox/models/blb/lb_backend'
|
2013-02-17 18:14:17 -05:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Bluebox
|
|
|
|
class BLB
|
2013-02-18 21:09:19 -05:00
|
|
|
class LbBackends < Fog::Collection
|
|
|
|
model Fog::Bluebox::BLB::LbBackend
|
|
|
|
|
|
|
|
attr_accessor :lb_service
|
2013-02-17 18:14:17 -05:00
|
|
|
|
|
|
|
def all
|
2013-02-18 21:09:19 -05:00
|
|
|
data = service.get_lb_backends(lb_service.id).body
|
2013-02-17 18:14:17 -05:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
2013-02-18 21:09:19 -05:00
|
|
|
def get(lb_backend_id)
|
|
|
|
if lb_backend = service.get_lb_backend(lb_service.id, lb_backend_id).body
|
|
|
|
new(lb_backend)
|
2013-02-17 18:14:17 -05:00
|
|
|
end
|
|
|
|
rescue Fog::Compute::Bluebox::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|