1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/ecloud/requests/compute/admin_edit_authentication_levels.rb
2012-06-07 12:50:11 -04:00

34 lines
828 B
Ruby

module Fog
module Compute
class Ecloud
class Real
def authentication_levels_edit(data)
validate_data([:basic, :sha1, :sha256, :sha512], data)
body = build_authentication_levels_edit(data)
request(
:expects => 202,
:method => 'PUT',
:headers => {},
:body => body,
:uri => data[:uri],
:parse => true
)
end
private
def build_authentication_levels_edit(data)
xml = Builder::XmlMarkup.new
xml.AuthenticationLevels do
xml.BasicEnabled data[:basic]
xml.SHA1Enabled data[:sha1]
xml.SHA256Enabled data[:sha256]
xml.SHA512Enabled data[:sha512]
end
end
end
end
end
end