Sha256: 434acb8ad09a6d60384269b97da650be28bc13e6ff76b407d073ab2da497e151

Contents?: true

Size: 962 Bytes

Versions: 11

Compression:

Stored size: 962 Bytes

Contents

module Fog
  module Compute
    class Ecloud
      module Shared

        def build_request_body_add_ip(networks)
          xml = Builder::XmlMarkup.new
          xml.AssignedIpAddresses do
            xml.Networks do
              networks.each do |network|
                xml.Network(:href => network[:href], :type => network[:type]) do
                  xml.IpAddresses do
                    network[:ips].each do |ip|
                      xml.IpAddress ip
                    end
                  end
                end
              end
            end
          end    
        end
      end

      class Real

        def virtual_machine_add_ip(href, options)
          body = build_request_body_add_ip(options)
          request(
            :expects => 202,
            :method => 'PUT',
            :headers => {},
            :body => body,
            :uri => href,
            :parse => true
          )
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-nirvanix-1.8.1 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-parser-fix-1.6.1 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-test-again-1.6.0 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-parser-fix-1.6.0 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-sgonyea-1.8.1 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-1.8.0 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-1.7.0 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb
fog-1.6.0 lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb