mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Added ninefold load balancers.
This commit is contained in:
parent
effc2f0566
commit
c6062b8263
4 changed files with 42 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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]
|
||||
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
|
||||
|
|
12
tests/ninefold/requests/compute/load_balancer_tests.rb
Normal file
12
tests/ninefold/requests/compute/load_balancer_tests.rb
Normal 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
|
Loading…
Add table
Reference in a new issue