Sha256: 40a8c00d64f2854228972d60232d885935f95f2001183e908e4725ea7a05bc12

Contents?: true

Size: 1.04 KB

Versions: 24

Compression:

Stored size: 1.04 KB

Contents

module Fog
  module Rackspace
    class Orchestration
      class Stack < Fog::Model

        identity :id

        %w{description links stack_status_reason stack_name creation_time updated_time}.each do |a|
          attribute a.to_sym
        end

        def details
          service.show_stack_details(self.stack_name, self.id).body['stack']
        rescue Fog::Rackspace::Orchestration::NotFound
          nil
        end

        def resources
          @resources ||= service.resources.all(self)
        end

        def events(options={})
          @events ||= service.events.all(self, options)
        end

        def template
          @template ||= service.templates.get(self)
        end

        def save(options={})
          if persisted?
            service.update_stack(self, options).body['stack']
          else
            service.stacks.create(options)
          end
        end

        def abandon
          service.abandon_stack(self)
        end

        def delete
          service.delete_stack(self)
        end
      end
    end
  end
end

Version data entries

24 entries across 22 versions & 4 rubygems

Version Path
fog-rackspace-0.1.6 lib/fog/rackspace/models/orchestration/stack.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/orchestration/stack.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/orchestration/stack.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/models/orchestration/stack.rb
fog-rackspace-0.1.5 lib/fog/rackspace/models/orchestration/stack.rb
fog-rackspace-0.1.4 lib/fog/rackspace/models/orchestration/stack.rb
fog-rackspace-0.1.3 lib/fog/rackspace/models/orchestration/stack.rb
fog-rackspace-0.1.2 lib/fog/rackspace/models/orchestration/stack.rb
fog-rackspace-0.1.1 lib/fog/rackspace/models/orchestration/stack.rb
fog-rackspace-0.1.0 lib/fog/rackspace/models/orchestration/stack.rb
fog-1.37.0 lib/fog/rackspace/models/orchestration/stack.rb
fog-1.36.0 lib/fog/rackspace/models/orchestration/stack.rb
fog-1.35.0 lib/fog/rackspace/models/orchestration/stack.rb
fog-2.0.0.pre.0 lib/fog/rackspace/models/orchestration/stack.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/rackspace/models/orchestration/stack.rb
fog-1.34.0 lib/fog/rackspace/models/orchestration/stack.rb
fog-1.33.0 lib/fog/rackspace/models/orchestration/stack.rb
fog-1.32.0 lib/fog/rackspace/models/orchestration/stack.rb
fog-1.31.0 lib/fog/rackspace/models/orchestration/stack.rb
fog-1.30.0 lib/fog/rackspace/models/orchestration/stack.rb