Sha256: 274c07ecdffbd6350532735911e5173af492ee05e5bbaf66e6873d50b10cafb9

Contents?: true

Size: 1.38 KB

Versions: 40

Compression:

Stored size: 1.38 KB

Contents

require 'fog/core/model'

module Fog
  module AWS
    class RDS

      class Snapshot < Fog::Model

        identity  :id, :aliases => ['DBSnapshotIdentifier', :name]
        attribute  :instance_id, :aliases => 'DBInstanceIdentifier'
        attribute  :created_at, :aliases => 'SnapshotCreateTime', :type => :time
        attribute  :instance_created_at, :aliases => 'InstanceCreateTime', :type => :time
        attribute  :engine, :aliases => 'Engine'
        attribute  :engine_version, :aliases => 'EngineVersion'
        attribute  :master_username, :aliases => 'MasterUsername'
        attribute  :state, :aliases => 'Status'
        attribute  :port, :aliases => 'Port', :type => :integer
        attribute  :allocated_storage, :aliases => 'AllocatedStorage', :type => :integer
        attribute  :availability_zone, :aliases => 'AvailabilityZone'

        def ready?
          state == 'available'
        end

        def destroy
          requires :id

          connection.delete_db_snapshot(id)
          true
        end

        def save
          requires :instance_id
          requires :id

          data = connection.create_db_snapshot(instance_id, id).body['CreateDBSnapshotResult']['DBSnapshot']
          merge_attributes(data)
          true
        end

        def server
          requires :instance_id
          connection.servers.get(instance_id)
        end

      end
    end
  end
end

Version data entries

40 entries across 40 versions & 8 rubygems

Version Path
fog-1.5.0 lib/fog/aws/models/rds/snapshot.rb
fog-1.4.0 lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb
michiels-fog-1.3.1 lib/fog/aws/models/rds/snapshot.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb
fog-1.3.1 lib/fog/aws/models/rds/snapshot.rb
fog-1.3.0 lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb
fog-1.2.0 lib/fog/aws/models/rds/snapshot.rb
ktheory-fog-1.1.2 lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb
fog-1.1.2 lib/fog/aws/models/rds/snapshot.rb
fog_tractical-1.1.4 lib/fog/aws/models/rds/snapshot.rb
fog_tractical-1.1.3 lib/fog/aws/models/rds/snapshot.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/models/rds/snapshot.rb