Sha256: 63c21710a80e9a426e1448be3847e0fde5ebbca2d8036d6fca74d0dced8d80f2

Contents?: true

Size: 1.92 KB

Versions: 40

Compression:

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

40 entries across 40 versions & 5 rubygems

Version Path
fog-openstack-0.1.10 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.9 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.8 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.7 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.6 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.5 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.4 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.3 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.2 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.1 lib/fog/openstack/requests/compute/get_host_details.rb
fog-openstack-0.1.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.37.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.36.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.35.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-2.0.0.pre.0 lib/fog/openstack/requests/compute/get_host_details.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.34.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.33.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.32.0 lib/fog/openstack/requests/compute/get_host_details.rb
fog-1.31.0 lib/fog/openstack/requests/compute/get_host_details.rb