Sha256: 7b5614b7f88ac9dca031882fdbbec805b092e7180dc70ca8604a0f35073ac2e6

Contents?: true

Size: 652 Bytes

Versions: 3

Compression:

Stored size: 652 Bytes

Contents

require 'fog/core/collection'
require 'fog/aws/rds/models/server'

module Fog
  module AWS
    class RDS

      class Servers < Fog::Collection

        model Fog::AWS::RDS::Server

        def all
          data = connection.describe_db_instances.body['DescribeDBInstancesResult']['DBInstances']
          load(data) # data is an array of attribute hashes
        end

        def get(identity)
          data = connection.describe_db_instances(identity).body['DescribeDBInstancesResult']['DBInstances'].first
          new(data) # data is an attribute hash
        rescue Fog::AWS::RDS::NotFound
          nil
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-0.7.2 lib/fog/aws/rds/models/servers.rb
fog-0.7.1 lib/fog/aws/rds/models/servers.rb
fog-0.7.0 lib/fog/aws/rds/models/servers.rb