Sha256: 40dd4c299b53a765c25b1f57ef101762cc96899506dd7585b77a30730a91e1a1
Contents?: true
Size: 1.75 KB
Versions: 33
Compression:
Stored size: 1.75 KB
Contents
module Fog class Vcloud module Terremark class Ecloud class Real def validate_network_ip_data(network_ip_data, configure=false) valid_opts = [:id, :href, :name, :status, :server, :rnat] unless valid_opts.all? { |opt| network_ip_data.keys.include?(opt) } raise ArgumentError.new("Required data missing: #{(valid_opts - network_ip_data.keys).map(&:inspect).join(", ")}") end end def configure_network_ip(network_ip_uri, network_ip_data) validate_network_ip_data(network_ip_data) request( :body => generate_configure_network_ip_request(network_ip_data), :expects => 200, :headers => {'Content-Type' => 'application/vnd.tmrk.ecloud.ip+xml' }, :method => 'PUT', :uri => network_ip_uri, :parse => true ) end private def generate_configure_network_ip_request(network_ip_data) builder = Builder::XmlMarkup.new builder.IpAddress(:"xmlns:i" => "http://www.w3.org/2001/XMLSchema-instance", :xmlns => "urn:tmrk:eCloudExtensions-2.3") { builder.Id(network_ip_data[:id]) builder.Href(network_ip_data[:href]) builder.Name(network_ip_data[:name]) builder.Status(network_ip_data[:status]) builder.Server(network_ip_data[:server]) builder.RnatAddress(network_ip_data[:rnat]) } end end class Mock def configure_network_ip(network_ip_uri, network_ip_data) Fog::Mock.not_implemented end end end end end end
Version data entries
33 entries across 33 versions & 2 rubygems