Sha256: 3ecd1d725c5225ded9842d1002305f107676d19c1e3a77c6c2c13b877974cb39

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

require 'rackspace-fog/core/collection'
require 'rackspace-fog/aws/models/rds/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

1 entries across 1 versions & 1 rubygems

Version Path
rackspace-fog-1.4.2 lib/rackspace-fog/aws/models/rds/servers.rb