Sha256: 9940e353085ca74f0bf20f233a596f3709f8e8a63f80bf8481cbcf83894f97c0

Contents?: true

Size: 1.2 KB

Versions: 10

Compression:

Stored size: 1.2 KB

Contents

require "fog/brightbox/compute/resource_locking"

module Fog
  module Brightbox
    class Compute
      class DatabaseSnapshot < Fog::Brightbox::Model
        include Fog::Brightbox::Compute::ResourceLocking

        identity :id
        attribute :url
        attribute :resource_type

        attribute :name
        attribute :description
        attribute :state, :aliases => "status"

        attribute :database_engine
        attribute :database_version

        attribute :size

        attribute :created_at, :type => :time
        attribute :updated_at, :type => :time
        attribute :deleted_at, :type => :time

        def save
          options = {
            :name => name,
            :description => description
          }
          data = update_database_snapshot(options)
          merge_attributes(data)
          true
        end

        def ready?
          state == "available"
        end

        def destroy
          requires :identity
          merge_attributes(service.delete_database_snapshot(identity))
          true
        end

        private

        def update_database_snapshot(options)
          service.update_database_snaphot(identity, options)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fog-brightbox-1.6.0 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.5.0 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.5.0.rc1 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.4.2 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.4.1 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.4.0 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.3.0 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.2.0 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.1.0 lib/fog/brightbox/models/compute/database_snapshot.rb
fog-brightbox-1.0.0 lib/fog/brightbox/models/compute/database_snapshot.rb