Class: Fog::Orchestration::OpenStack::Stack

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Stack

Returns a new instance of Stack.



21
22
23
24
25
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 21

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

Instance Method Details

#createObject



32
33
34
35
36
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 32

def create
  requires :stack_name
  service.create_stack(stack_name, self.attributes)
  self
end

#destroyObject



44
45
46
47
48
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 44

def destroy
  requires :id
  service.delete_stack(self.stack_name, self.id)
  true
end

#saveObject



27
28
29
30
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 27

def save
  requires :stack_name
  identity ? update : create
end

#updateObject



38
39
40
41
42
# File 'lib/fog/openstack/models/orchestration/stack.rb', line 38

def update
  requires :stack_name
  service.update_stack(stack_name, self.attributes)
  self
end