Sha256: 0852549031cf97129aa348c4a623e322443c3aa7a317489580ba2d195a61efb0

Contents?: true

Size: 1.94 KB

Versions: 82

Compression:

Stored size: 1.94 KB

Contents

module Fog
  module Compute
    class OpenStack
      class Real

        def get_host_details(host)
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => "os-hosts/#{host}.json"
          )
        end

      end

      class Mock

        def get_host_details(host)

          response = Excon::Response.new
          response.status = 200
          response.body = { "host" => [
              { "resource" => {
                  "project" => "(total)",
                  "memory_mb" => 64427,
                  "host" => "cn28.la-1-3.morphcloud.net",
                  "cpu" => 12,
                  "disk_gb" => 1608
                  }
              }, 
              { "resource" => {
                  "project" => "(used_now)",
                  "memory_mb" => 1753,
                  "host" => "cn28.la-1-3.morphcloud.net",
                  "cpu" => 3,
                  "disk_gb" => 33
                }
              }, 
              { "resource" => {
                  "project" => "(used_max)",
                  "memory_mb" => 7168,
                  "host" => "cn28.la-1-3.morphcloud.net",
                  "cpu" => 3,
                  "disk_gb" => 45
                }
              },
              { "resource" => {
                  "project" => "bf8301f5164f4790889a1bc2bfb16d99",
                  "memory_mb" => 5120,
                  "host" => "cn28.la-1-3.morphcloud.net",
                  "cpu" => 2,
                  "disk_gb" => 35
                }
              },
              { "resource" => {
                  "project" => "3bb4d0301c5f47d5b4d96a361fcf96f4",
                  "memory_mb" => 2048,
                  "host" => "cn28.la-1-3.morphcloud.net",
                  "cpu" => 1,
                  "disk_gb" => 10
                }
              }
            ]
          }
          response

          
        end


      end # mock
    end # openstack
  end # compute
end # fog

Version data entries

82 entries across 82 versions & 13 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/openstack/requests/compute/get_host_details.rb
cifrado-0.2.1 vendor/fog/lib/fog/openstack/requests/compute/get_host_details.rb
cifrado-0.2.0 vendor/fog/lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.20.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.19.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/openstack/requests/compute/get_host_details.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/openstack/requests/compute/get_host_details.rb