Added ninefold load balancers.

This commit is contained in:
Carl Woodward 2012-08-11 20:55:30 +10:00 committed by Carl Woodward
parent effc2f0566
commit c6062b8263
4 changed files with 42 additions and 0 deletions

View File

@ -60,6 +60,8 @@ module Fog
request :create_ip_forwarding_rule
request :delete_ip_forwarding_rule
request :list_ip_forwarding_rules
# Load Balancers
request :create_load_balancer_rule
class Mock

View File

@ -0,0 +1,11 @@
module Fog
module Compute
class Ninefold
class Real
def create_load_balancer_rule(options={})
request 'createLoadBalancerRule', options, :expects => [200], :response_prefix => 'createloadbalancerruleresponse', :response_type => Hash
end
end
end
end
end

View File

@ -312,6 +312,23 @@ class Ninefold
}
FORWARDING_RULES = [FORWARDING_RULE]
end
module LoadBalancers
CREATE_LOAD_BALANCER_RULE_RESPONSE = {
"id"=>Integer,
"account"=>String,
"algorithm"=>String,
"cidrlist"=>String,
"description"=>String,
"domain"=>String,
"domainid"=>Integer,
"name"=>String,
"privateport"=>Integer,
"publicip"=>Integer,
"publicport"=>Integer,
"state"=>String,
"zoneid"=>Integer
}
end
end
end
end

View File

@ -0,0 +1,12 @@
Shindo.tests('Fog::Compute[:ninefold] | load balancers', ['ninefold']) do
tests('success') do
tests("#create_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::CREATE_LOAD_BALANCER_RULE_RESPONSE) do
pending if Fog.mocking?
job = Fog::Compute[:ninefold].create_load_balancer_rule(:algorithm => 'roundrobin', :name => 'test', :privateport => 1000, :publicport => 2000)
Ninefold::Compute::TestSupport.wait_for_job(job)['jobresult']['createloadbalancerruleresponse']
end
end
end