Sha256: 8ef1e2b516df86686398be62f0f81e382ccbea44600716e01e10d126c4e15e7b

Contents?: true

Size: 1.53 KB

Versions: 16

Compression:

Stored size: 1.53 KB

Contents

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  :iops, :aliases => 'Iops', :type => :integer
        attribute  :availability_zone, :aliases => 'AvailabilityZone'
        attribute  :type, :aliases => 'SnapshotType'
        attribute  :publicly_accessible, :aliases => 'PubliclyAccessible'

        def ready?
          state == 'available'
        end

        def destroy
          requires :id

          service.delete_db_snapshot(id)
          true
        end

        def save
          requires :instance_id
          requires :id

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

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

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
fog-aws-0.8.1 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.8.0 lib/fog/aws/models/rds/snapshot.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-aws-0.7.5/lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.7.6 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.7.5 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.7.4 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.7.3 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.7.2 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.6.0 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.5.0 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.4.1 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.4.0 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.3.0 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.2.2 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.2.0 lib/fog/aws/models/rds/snapshot.rb
fog-aws-0.1.2 lib/fog/aws/models/rds/snapshot.rb