Sha256: 77c704fefa08291640c6b0c70903c8dbac85eba8866a06333330f0de58300c6d

Contents?: true

Size: 1.16 KB

Versions: 17

Compression:

Stored size: 1.16 KB

Contents

module Fog
  class Vcloud
    module Terremark
      class Ecloud

        class Real
          basic_request :get_node
        end

        class Mock

          #
          # Based on http://support.theenterprisecloud.com/kb/default.asp?id=641&Lang=1&SID=
          #
          #
          #
          def mock_node_service_response(node, xmlns)
            xml = Builder::XmlMarkup.new
            xml.NodeService(xmlns) {
              xml.Id(node[:id])
              xml.Href(node[:href])
              xml.Name(node[:name])
              xml.IpAddress(node[:ip_address])
              xml.Port(node[:port])
              xml.Enabled(node[:enabled])
              xml.Description(node[:description])
            }
          end

          def get_node(node_uri)

            node_uri = ensure_unparsed(node_uri)

            if node = mock_node_from_url(node_uri)
              xml = Builder::XmlMarkup.new
              mock_it 200, mock_node_service_response(node, ecloud_xmlns), { 'Content-Type' => 'application/vnd.tmrk.ecloud.nodeService+xml' }
            else
              mock_error 200, "401 Unauthorized"
            end
          end
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
fog-0.3.16 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.15 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.14 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.13 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.12 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.11 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.10 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.9 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.8 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.7 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.6 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.5 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.4 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.3 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.2 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.1 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb
fog-0.3.0 lib/fog/vcloud/terremark/ecloud/requests/get_node.rb