Sha256: 7d9369ed491e8774bab6066ced4267ef126bb161fcbff6628822b2fbf5300b6e

Contents?: true

Size: 1.77 KB

Versions: 10

Compression:

Stored size: 1.77 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

10 entries across 10 versions & 1 rubygems

Version Path
fog-openstack-0.1.21 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.20 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.19 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.18 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.17 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.15 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.14 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.13 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.12 lib/fog/compute/openstack/requests/get_host_details.rb
fog-openstack-0.1.11 lib/fog/compute/openstack/requests/get_host_details.rb