Sha256: e865dce6b38841368a2de092775d377d691734b96aa053ae3787bd45bb257011

Contents?: true

Size: 722 Bytes

Versions: 22

Compression:

Stored size: 722 Bytes

Contents

require 'fog/compute/models/server'
require 'fog/openstack/compute/models/metadata'

module Fog
  module OpenStack
    class Compute
      class Host < Fog::OpenStack::Model
        attribute :host_name
        attribute :service_name
        attribute :details
        attribute :zone

        def initialize(attributes)
          attributes["service_name"] = attributes.delete "service"
          # Old 'connection' is renamed as service and should be used instead
          prepare_service_value(attributes)
          super
        end

        def details
          service.get_host_details(host_name).body['host']
        rescue Fog::OpenStack::Compute::NotFound
          nil
        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/models/host.rb
fog-openstack-1.1.4 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.1.3 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.1.2 lib/fog/openstack/compute/models/host.rb
fog-openstack-fork-99 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.1.0 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.1.0.pre lib/fog/openstack/compute/models/host.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.11 lib/fog/openstack/compute/models/host.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.10 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.9 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.8 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.7 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.6 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.5 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.4 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.3 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.2 lib/fog/openstack/compute/models/host.rb
fog-openstack-1.0.1 lib/fog/openstack/compute/models/host.rb