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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#create, #destroy, #save, #update

Constructor Details

#initialize(attributes) ⇒ Host

Returns a new instance of Host.



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

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



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

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