Sha256: eefde087cdb2ee254d056a96836d5f0d80a94317568b550a4846789c9e2e327b

Contents?: true

Size: 1.32 KB

Versions: 24

Compression:

Stored size: 1.32 KB

Contents

module Fog
  module Vcloud
    module Terremark
      module Ecloud

        module Real
          basic_request :get_nodes
        end

        module 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

24 entries across 24 versions & 2 rubygems

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