Sha256: 1984aa227a56ba44edab97c7b11f3fd4e4c85393305a5f5bf2b0363fe3014ad7

Contents?: true

Size: 1.25 KB

Versions: 80

Compression:

Stored size: 1.25 KB

Contents

module Fog
  module AWS
    class RDS
      class Real
        require 'fog/aws/parsers/rds/tag_list_parser'

        # returns a Hash of tags for a database instance
        # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_ListTagsForResource.html
        # ==== Parameters
        # * rds_id <~String> - name of the RDS instance whose tags are to be retrieved
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        def list_tags_for_resource(rds_id)
          request(
            'Action'        => 'ListTagsForResource',
            'ResourceName'  => "arn:aws:rds:#{@region}:#{owner_id}:db:#{rds_id}",
            :parser         => Fog::Parsers::AWS::RDS::TagListParser.new
          )
        end
      end

      class Mock
        def list_tags_for_resource(rds_id)
          response = Excon::Response.new
          if server = self.data[:servers][rds_id]
            response.status = 200
            response.body = {
              "ListTagsForResourceResult" =>
                {"TagList" =>  self.data[:tags][rds_id]}
            }
            response
          else
            raise Fog::AWS::RDS::NotFound.new("DBInstance #{rds_id} not found")
          end
        end
      end
    end
  end
end

Version data entries

80 entries across 78 versions & 6 rubygems

Version Path
fog-aws-3.13.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.12.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.11.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.10.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.9.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.8.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.7.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.6.7 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.6.6 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.6.5 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.6.4 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.6.3 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.6.2 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.5.2 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.5.1 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.5.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.4.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.3.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.2.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-3.1.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb