Sha256: dfd14bc75d78f0e62f1184583c61c0ef057aa926b817ec5469c7c8504f24bea8

Contents?: true

Size: 1.32 KB

Versions: 17

Compression:

Stored size: 1.32 KB

Contents

module Fog
  class Vcloud
    module Terremark
      class Ecloud

        class Real
          basic_request :get_nodes
        end

        class Mock

          #
          # Based off of:
          # http://support.theenterprisecloud.com/kb/default.asp?id=637&Lang=1&SID=
          #
          def get_nodes(nodes_uri)
            nodes_uri = ensure_unparsed(nodes_uri)
            service_uri = nodes_uri.gsub('/nodeServices','')
            ip, service = mock_ip_and_service_from_service_url(service_uri)
            if ip and service
              xml = Builder::XmlMarkup.new
              mock_it 200,
                xml.NodeServices(ecloud_xmlns) {
                  service[:nodes].each do |node|
                    xml.NodeService {
                      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
                }, { '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_nodes.rb
fog-0.3.15 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.14 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.13 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.12 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.11 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.10 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.9 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.8 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.7 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.6 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.5 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.4 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.3 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.2 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.1 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb
fog-0.3.0 lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb