Added ninefold load balancers.
This commit is contained in:
parent
effc2f0566
commit
c6062b8263
|
@ -60,6 +60,8 @@ module Fog
|
||||||
request :create_ip_forwarding_rule
|
request :create_ip_forwarding_rule
|
||||||
request :delete_ip_forwarding_rule
|
request :delete_ip_forwarding_rule
|
||||||
request :list_ip_forwarding_rules
|
request :list_ip_forwarding_rules
|
||||||
|
# Load Balancers
|
||||||
|
request :create_load_balancer_rule
|
||||||
|
|
||||||
class Mock
|
class Mock
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -312,6 +312,23 @@ class Ninefold
|
||||||
}
|
}
|
||||||
FORWARDING_RULES = [FORWARDING_RULE]
|
FORWARDING_RULES = [FORWARDING_RULE]
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue