Sha256: d2fb708d2abb006784cb30392ca7efa3cfbebf77dbe029656529115191ce860f

Contents?: true

Size: 1.14 KB

Versions: 57

Compression:

Stored size: 1.14 KB

Contents

require 'fog/core/model'

module Fog
  module Orchestration
    class OpenStack
      class Stack < Fog::Model
        identity :id

        attribute :stack_name
        attribute :stack_status
        attribute :stack_status_reason
        attribute :creation_time
        attribute :updated_time
        attribute :id

        attribute :template_url
        attribute :template
        attribute :parameters
        attribute :timeout_in_minutes

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

        def save
          requires :stack_name
          identity ? update : create
        end

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

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

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

Version data entries

57 entries across 57 versions & 5 rubygems

Version Path
fog-maestrodev-1.18.0.20131127194823 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/openstack/models/orchestration/stack.rb
fog-1.18.0 lib/fog/openstack/models/orchestration/stack.rb
fog-1.17.0 lib/fog/openstack/models/orchestration/stack.rb
fog-1.16.0 lib/fog/openstack/models/orchestration/stack.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/openstack/models/orchestration/stack.rb