Sha256: d22321ff2a907d752e8219599a85563c0ab52eca93bdc3d681bd539d4578c3f3

Contents?: true

Size: 1.3 KB

Versions: 30

Compression:

Stored size: 1.3 KB

Contents

module Fog
  module Vcloud
    module Terremark
      module Ecloud

        module Real
          basic_request :get_network_extensions
        end

        module Mock

          def get_network_extensions(network_uri)
            network_uri = ensure_unparsed(network_uri)
            type = "application/vnd.vmware.vcloud.network+xml"
            response = Excon::Response.new
            if network = mock_data[:organizations].map { |org| org[:vdcs].map { |vdc| vdc[:networks] } }.flatten.detect { |network| network[:extension_href] == network_uri }
              xml = Builder::XmlMarkup.new
              mock_it 200,
                xml.Network(:xmlns => "urn:tmrk:eCloudExtensions-2.3", :"xmlns:i" => "http://www.w3.org/2001/XMLSchema-instance") {
                  xml.Address(network[:name].split("/")[0])
                  xml.RnatAddress(network[:rnat])
                  xml.Href(network[:extension_href])
                  xml.Id(network[:id])
                  xml.Name(network[:name])
                  xml.GatewayAddress(network[:gateway])
                  xml.BroadcastAddress(IPAddr.new(network[:subnet]).to_range.last.to_s)
                }, { 'Content-Type' => type }
            else
              mock_error 200, "401 Unauthorized"
            end
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.28 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.27 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.26 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.25 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.24 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
tecnh-fog-0.2.23.vpc lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.23 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.22 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.21 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.20 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.19 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.18 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.17 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.16 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.15 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.14 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.13 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.12 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb
fog-0.2.11 lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb