Class: Fog::Compute::OpenStack::Service

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Service

Returns a new instance of Service.



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

def initialize(attributes)
  # Old 'connection' is renamed as service and should be used instead
  prepare_service_value(attributes)
  super
end

Instance Method Details

#destroyObject



40
41
42
43
44
# File 'lib/fog/openstack/models/compute/service.rb', line 40

def destroy
  requires :id
  service.delete_service(self.id)
  true
end

#disableObject



30
31
32
33
# File 'lib/fog/openstack/models/compute/service.rb', line 30

def disable
  requires :binary, :host
  service.disable_service(self.host, self.binary)
end

#disable_and_log_reasonObject



35
36
37
38
# File 'lib/fog/openstack/models/compute/service.rb', line 35

def disable_and_log_reason
  requires :binary, :host, :disabled_reason
  service.disable_service_log_reason(self.host, self.binary, self.disabled_reason)
end

#enableObject



25
26
27
28
# File 'lib/fog/openstack/models/compute/service.rb', line 25

def enable
  requires :binary, :host
  service.enable_service(self.host, self.binary)
end