Sha256: 5e12a97d5e60fa966a83f1b3216626b2e9fb53ebfffbd26e3ba2b0711e0aa728

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

module Fog
  module Compute
    class Ecloud

      class Real
        basic_request :get_compute_pool
      end

      class Mock
        #
        #Based off of:
        #http://support.theenterprisecloud.com/kb/default.asp?id=567&Lang=1&SID=
        #

        def get_compute_pool(compute_pool_uri)
          compute_pool_uri = ensure_unparsed(compute_pool_uri)

          if compute_pool = mock_data.compute_pool_from_href(compute_pool_uri)
            xml = Builder::XmlMarkup.new
            mock_it 200,
              xml.ComputePool(:xmlns => "urn:tmrk:eCloudExtensions-2.8", :"xmlns:i" => "http://www.w3.org/2001/XMLSchema-instance") {
                xml.Id compute_pool.object_id
                xml.Href compute_pool.href
                xml.Name compute_pool.name
                xml.State compute_pool.state
                xml.IsDefault compute_pool.is_default
              }, { 'Content-Type' => 'application/vnd.tmrk.ecloud.computePoolsList+xml' }
          else
            mock_error 200, "401 Unauthorized"
          end
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
michiels-fog-1.3.1 lib/fog/ecloud/requests/compute/get_compute_pool.rb