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-0.9.1 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.9.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.8.1 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.8.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-aws-0.7.5/lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.7.6 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.7.5 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.7.4 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.7.3 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.7.2 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.6.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.5.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.4.1 lib/fog/aws/requests/rds/list_tags_for_resource.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.4.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.3.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.2.2 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.2.0 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.1.2 lib/fog/aws/requests/rds/list_tags_for_resource.rb
fog-aws-0.1.1 lib/fog/aws/requests/rds/list_tags_for_resource.rb