Class: Fog::Compute::OpenStack::Host

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/openstack/models/compute/host.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

#initialize(attributes) ⇒ Host

Returns a new instance of Host.



15
16
17
18
19
20
# File 'lib/fog/openstack/models/compute/host.rb', line 15

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

Instance Method Details

#detailsObject



22
23
24
25
26
# File 'lib/fog/openstack/models/compute/host.rb', line 22

def details
  service.get_host_details(self.host_name).body['host']
rescue Fog::Compute::OpenStack::NotFound
  nil
end