2013-02-18 17:48:34 -05:00
|
|
|
require 'fog/bluebox/models/blb/lb_application'
|
2013-02-17 18:14:17 -05:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Bluebox
|
|
|
|
class BLB
|
2013-02-18 17:29:58 -05:00
|
|
|
class LbApplications < Fog::Collection
|
2013-02-18 17:45:02 -05:00
|
|
|
model Fog::Bluebox::BLB::LbApplication
|
2013-02-17 18:14:17 -05:00
|
|
|
|
|
|
|
def all
|
2013-02-18 17:29:58 -05:00
|
|
|
data = service.get_lb_applications.body
|
2013-02-17 18:14:17 -05:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
2013-02-18 18:47:46 -05:00
|
|
|
def get(application_id)
|
|
|
|
if application_id && application = service.get_lb_application(application_id).body
|
|
|
|
new(application)
|
2013-02-17 18:14:17 -05:00
|
|
|
end
|
2013-02-18 18:47:46 -05:00
|
|
|
rescue Fog::Bluebox::BLB::NotFound
|
2013-02-17 18:14:17 -05:00
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|