1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #1488 from brightbox/updates

[Brightbox] General updates
This commit is contained in:
Paul Thornthwaite 2013-01-21 03:49:26 -08:00
commit 2fb1ea7d64
4 changed files with 37 additions and 2 deletions

View file

@ -125,6 +125,7 @@ module Fog
request :update_api_client
request :update_application
request :update_cloud_ip
request :update_firewall_policy
request :update_firewall_rule
request :update_image
request :update_load_balancer

View file

@ -0,0 +1,25 @@
module Fog
module Compute
class Brightbox
class Real
# Updates details of the firewall policy
#
# @param [String] identifier Unique reference to identify the resource
# @param [Hash] options
# @option options [String] :name Editable label
# @option options [String] :description Longer editable description
#
# @return [Hash, nil] The JSON response parsed to a Hash or nil if no options passed
#
# @see https://api.gb1.brightbox.com/1.0/#firewall_policy_update_firewall_policy
#
def update_firewall_policy(identifier, options)
return nil if identifier.nil? || identifier == ""
return nil if options.empty? || options.nil?
request("put", "/1.0/firewall_policies/#{identifier}", [200], options)
end
end
end
end
end

View file

@ -25,6 +25,13 @@ Shindo.tests('Fog::Compute[:brightbox] | firewall policy requests', ['brightbox'
end
end
update_options = {:name => "Fog test policy B"}
tests("#update_firewall_policy('#{@firewall_policy_id}', #{update_options.inspect})") do
result = Fog::Compute[:brightbox].update_firewall_policy(@firewall_policy_id, update_options)
formats(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, false) { result }
returns("Fog test policy B") { result["name"] }
end
tests("#destroy_firewall_policy('#{@firewall_policy_id}')") do
result = Fog::Compute[:brightbox].destroy_firewall_policy(@firewall_policy_id)
formats(Brightbox::Compute::Formats::Full::FIREWALL_POLICY, false) { result }

View file

@ -372,7 +372,8 @@ class Brightbox
"snapshots" => [Brightbox::Compute::Formats::Nested::IMAGE],
"interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
"zone" => Fog::Brightbox::Nullable::Zone,
"username" => Fog::Nullable::String
"username" => Fog::Nullable::String,
"compatibility_mode" => Fog::Boolean
}
SERVER_GROUP = {
@ -612,7 +613,8 @@ class Brightbox
"interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
"zone" => Fog::Brightbox::Nullable::Zone,
"licence_name" => Fog::Nullable::String,
"username" => Fog::Nullable::String
"username" => Fog::Nullable::String,
"compatibility_mode" => Fog::Boolean
}
SERVER_GROUP = {