lib/fog/rackspace/models/load_balancers/load_balancer.rb in fog-maestrodev-1.8.0.20130114204828 vs lib/fog/rackspace/models/load_balancers/load_balancer.rb in fog-maestrodev-1.14.0.20130806165225
- old
+ new
@@ -24,10 +24,11 @@
attribute :virtual_ips, :aliases => 'virtualIps'
attribute :created
attribute :updated
attribute :name
attribute :state, :aliases => 'status'
+ attribute :timeout
attribute :nodes
def initialize(attributes)
#HACK - Since we are hacking how sub-collections work, we have to make sure the service is valid first.
# Old 'connection' is renamed as service and should be used instead
@@ -212,26 +213,25 @@
private
def create
requires :name, :protocol, :port, :virtual_ips, :nodes
- if algorithm
- options = { :algorithm => algorithm }
- else
- options = {}
- end
+ options = {}
+ options[:algorithm] = algorithm if algorithm
+ options[:timeout] = timeout if timeout
data = service.create_load_balancer(name, protocol, port, virtual_ips_hash, nodes_hash, options)
merge_attributes(data.body['loadBalancer'])
end
def update
- requires :name, :protocol, :port, :algorithm
+ requires :name, :protocol, :port, :algorithm, :timeout
options = {
:name => name,
:algorithm => algorithm,
:protocol => protocol,
- :port => port}
+ :port => port,
+ :timeout => timeout }
service.update_load_balancer(identity, options)
#TODO - Should this bubble down to nodes? Without tracking changes this would be very inefficient.
# For now, individual nodes will have to be saved individually after saving an LB
end