class Fog::Orchestration::OpenStack::Stack

Public Class Methods

new(attributes) click to toggle source
Calls superclass method
# File lib/fog/openstack/models/orchestration/stack.rb, line 14
def initialize(attributes)
  # Old 'connection' is renamed as service and should be used instead
  prepare_service_value(attributes)
  super
end

Public Instance Methods

abandon() click to toggle source
# File lib/fog/openstack/models/orchestration/stack.rb, line 63
def abandon
  service.abandon_stack(self)
end
create() click to toggle source

Deprecated

# File lib/fog/openstack/models/orchestration/stack.rb, line 29
def create
  Fog::Logger.deprecation("#create is deprecated, use #save(options) instead [light_black](#{caller.first})[/]")
  requires :stack_name
  service.stacks.create(default_options)
end
delete() click to toggle source
# File lib/fog/openstack/models/orchestration/stack.rb, line 42
def delete
  service.delete_stack(self)
end
Also aliased as: destroy
destroy()
Alias for: delete
details() click to toggle source
# File lib/fog/openstack/models/orchestration/stack.rb, line 47
def details
  @details ||= service.stacks.get(self.stack_name, self.id)
end
events(options={}) click to toggle source
# File lib/fog/openstack/models/orchestration/stack.rb, line 55
def events(options={})
  @events ||= service.events.all(self, options)
end
resources(options={}) click to toggle source
# File lib/fog/openstack/models/orchestration/stack.rb, line 51
def resources(options={})
  @resources ||= service.resources.all(self, options)
end
save(options={}) click to toggle source
# File lib/fog/openstack/models/orchestration/stack.rb, line 20
def save(options={})
  if persisted?
    service.update_stack(self, default_options.merge(options)).body['stack']
  else
    service.stacks.create(default_options.merge(options))
  end
end
template() click to toggle source
# File lib/fog/openstack/models/orchestration/stack.rb, line 59
def template
  @template ||= service.templates.get(self)
end
template=(content) click to toggle source

Deprecated

# File lib/fog/openstack/models/orchestration/stack.rb, line 81
def template=(content)
  Fog::Logger.deprecation("#template=(content) is deprecated, use it in options for #save(options) instead [light_black](#{caller.first})[/]")
  @template = content
end
template_url() click to toggle source

Deprecated

# File lib/fog/openstack/models/orchestration/stack.rb, line 69
def template_url
  Fog::Logger.deprecation("#template_url is deprecated, use it in options for #save(options) instead [light_black](#{caller.first})[/]")
  @template_url
end
template_url=(url) click to toggle source

Deprecated

# File lib/fog/openstack/models/orchestration/stack.rb, line 75
def template_url=(url)
  Fog::Logger.deprecation("#template_url= is deprecated, use it in options for #save(options) instead [light_black](#{caller.first})[/]")
  @template_url = url
end
timeout_in_minutes() click to toggle source

Deprecated

# File lib/fog/openstack/models/orchestration/stack.rb, line 87
def timeout_in_minutes
  Fog::Logger.deprecation("#timeout_in_minutes is deprecated, set timeout_mins in options for save(options) instead [light_black](#{caller.first})[/]")
  timeout_mins
end
timeout_in_minutes=(minutes) click to toggle source

Deprecated

# File lib/fog/openstack/models/orchestration/stack.rb, line 93
def timeout_in_minutes=(minutes)
  Fog::Logger.deprecation("#timeout_in_minutes=(minutes) is deprecated, set timeout_mins in options for save(options) instead [light_black](#{caller.first})[/]")
  timeout_mins = minutes
end
update() click to toggle source

Deprecated

# File lib/fog/openstack/models/orchestration/stack.rb, line 36
def update
  Fog::Logger.deprecation("#update is deprecated, use #save(options) instead [light_black](#{caller.first})[/]")
  requires :stack_name
  service.update_stack(self, default_options).body['stack']
end

Private Instance Methods

default_options() click to toggle source

build options to create or update stack

# File lib/fog/openstack/models/orchestration/stack.rb, line 99
def default_options
  template_content =
    if template && template.is_a?(Fog::Orchestration::OpenStack::Template)
      template.content
    else
      template
    end

  {
    :stack_name       => stack_name,
    :disable_rollback => disable_rollback,
    :template_url     => @template_url,
    :template         => template_content,
    :timeout_mins     => timeout_mins
  }
end