Skip to content
This repository
Browse code

Added delete_tags

  • Loading branch information...
commit 5a5aab3d0560017940004d690966946ad9d70c2c 1 parent 8cd676b
authored October 15, 2010

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. 14  lib/AWS/EC2/tags.rb
14  lib/AWS/EC2/tags.rb
@@ -27,6 +27,20 @@ def describe_tags( options = {} )
27 27
         end
28 28
         return response_generator(:action => "DescribeTags", :params => params)
29 29
       end
  30
+
  31
+      # The DeleteTags operation deletes tags for the specified resource(s).
  32
+      #
  33
+      # @option options [Array] :resource_id ([]) The ids of the resource(s) to tag
  34
+      # @option options [Array] :tag ([]) An array of Hashes representing the tags { tag_name => tag_value }. If a value is given (instead of nil/empty string), then the tag is only deleted if it has this value
  35
+      #
  36
+      def delete_tags( options = {} )
  37
+        raise ArgumentError, "No :resource_id provided" if options[:resource_id].nil? || options[:resource_id].empty?
  38
+        raise ArgumentError, "No :tag provided" if options[:tag].nil? || options[:tag].empty?
  39
+
  40
+        params = pathlist("ResourceId", options[:resource_id] )
  41
+        params.merge!(pathkvlist('Tag', options[:tag], 'Key', 'Value', {}))
  42
+        return response_generator(:action => "DeleteTags", :params => params)
  43
+      end
30 44
     end
31 45
   end
32 46
 end

0 notes on commit 5a5aab3

Please sign in to comment.
Something went wrong with that request. Please try again.