Sha256: f340aef30f96db37d25cd404f9d06d3935d97b66f7f4daa82189fe55dea0c0b7

Contents?: true

Size: 1.73 KB

Versions: 22

Compression:

Stored size: 1.73 KB

Contents

module Fog
  module OpenStack
    class Compute
      class Real
        def get_host_details(host)
          request(
            :expects => [200, 203],
            :method  => 'GET',
            :path    => "os-hosts/#{host}"
          )
        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
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
fog-openstack-1.1.5 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.1.4 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.1.3 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.1.2 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-fork-99 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.1.0 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.1.0.pre lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.11 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.10 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.9 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.8 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.7 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.6 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.5 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.4 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.3 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.2 lib/fog/openstack/compute/requests/get_host_details.rb
fog-openstack-1.0.1 lib/fog/openstack/compute/requests/get_host_details.rb