diff --git a/lib/fog/bluebox/models/blb/lb_backend.rb b/lib/fog/bluebox/models/blb/lb_backend.rb index 8d07bbd39..3951a4143 100644 --- a/lib/fog/bluebox/models/blb/lb_backend.rb +++ b/lib/fog/bluebox/models/blb/lb_backend.rb @@ -4,11 +4,11 @@ module Fog module Bluebox class BLB - class Backend < Fog::Model + class LbBackend < Fog::Model identity :id attribute :name - attribute :machines + attribute :lb_machines attribute :monitoring_url attribute :monitoring_url_hostname attribute :acl_name diff --git a/lib/fog/bluebox/models/blb/lb_backends.rb b/lib/fog/bluebox/models/blb/lb_backends.rb index 356de008a..d111c83d6 100644 --- a/lib/fog/bluebox/models/blb/lb_backends.rb +++ b/lib/fog/bluebox/models/blb/lb_backends.rb @@ -1,25 +1,23 @@ require 'fog/core/collection' +require 'fog/bluebox/models/blb/lb_backend' module Fog module Bluebox class BLB - class Applications < Fog::Collection + class LbBackends < Fog::Collection + + model Fog::Bluebox::BLB::LbBackend + + attr_accessor :lb_service def all - data = service.get_blocks.body + data = service.get_lb_backends(lb_service.id).body load(data) end - def bootstrap(new_attributes = {}) - server = create(new_attributes) - server.wait_for { ready? } - server.setup(:key_data => [server.private_key]) - server - end - - def get(server_id) - if server_id && server = service.get_block(server_id).body - new(server) + def get(lb_backend_id) + if lb_backend = service.get_lb_backend(lb_service.id, lb_backend_id).body + new(lb_backend) end rescue Fog::Compute::Bluebox::NotFound nil diff --git a/lib/fog/bluebox/models/blb/lb_service.rb b/lib/fog/bluebox/models/blb/lb_service.rb index d02db9f2a..5d2ef9fa8 100644 --- a/lib/fog/bluebox/models/blb/lb_service.rb +++ b/lib/fog/bluebox/models/blb/lb_service.rb @@ -9,7 +9,7 @@ module Fog attribute :name attribute :port - attribute :backends + attribute :service_type attribute :private attribute :status_url @@ -17,12 +17,19 @@ module Fog attribute :status_password attribute :created, :aliases => 'created_at' - end - def lb_application - collection.lb_application - end + def lb_application + collection.lb_application + end + def lb_backends + Fog::Bluebox::BLB::LbBackends.new({ + :service => service, + :lb_service => self + }) + end + + end end end end