Sha256: 4d32bab59cb7319749dd68ba0272cc98ad2c3a2cc33a1c8fc975253df8059dcc

Contents?: true

Size: 1.44 KB

Versions: 31

Compression:

Stored size: 1.44 KB

Contents

module Fog
  module AWS
    class ELBV2
      class Real
        require 'fog/aws/parsers/elbv2/empty'

        # removes tags from an elastic load balancer instance
        # http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_RemoveTags.html
        # ==== Parameters
        # * resource_arn <~String> - ARN of the ELB instance whose tags are to be retrieved
        # * keys <~Array> A list of String keys for the tags to remove
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        def remove_tags(resource_arn, keys)
          request(
            { 'Action'                      => 'RemoveTags',
              'ResourceArns.member.1'  => resource_arn,
              :parser => Fog::Parsers::AWS::ELBV2::Empty.new,
            }.merge(Fog::AWS.indexed_param('TagKeys.member.%d', keys))
          )
        end

      end

      class Mock

        def remove_tags(resource_arn, keys)
          response = Excon::Response.new
          if self.data[:load_balancers_v2][resource_arn]
            keys.each {|key| self.data[:tags][resource_arn].delete key}
            response.status = 200
            response.body = {
              "ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id }
            }
            response
          else
            raise Fog::AWS::ELBV2::NotFound.new("Elastic load balancer #{resource_arn} not found")
          end
        end

      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
fog-aws-3.30.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.29.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.28.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.27.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.26.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.25.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.24.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.23.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.22.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.21.1 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.21.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.20.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.19.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.18.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.17.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.16.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.15.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.14.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.13.0 lib/fog/aws/requests/elbv2/remove_tags.rb
fog-aws-3.12.0 lib/fog/aws/requests/elbv2/remove_tags.rb