Permalink
Browse files

Added delete_tags

  • Loading branch information...
1 parent 8cd676b commit 5a5aab3d0560017940004d690966946ad9d70c2c Thomas Dudziak committed Oct 16, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/AWS/EC2/tags.rb
View
@@ -27,6 +27,20 @@ def describe_tags( options = {} )
end
return response_generator(:action => "DescribeTags", :params => params)
end
+
+ # The DeleteTags operation deletes tags for the specified resource(s).
+ #
+ # @option options [Array] :resource_id ([]) The ids of the resource(s) to tag
+ # @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
+ #
+ def delete_tags( options = {} )
+ raise ArgumentError, "No :resource_id provided" if options[:resource_id].nil? || options[:resource_id].empty?
+ raise ArgumentError, "No :tag provided" if options[:tag].nil? || options[:tag].empty?
+
+ params = pathlist("ResourceId", options[:resource_id] )
+ params.merge!(pathkvlist('Tag', options[:tag], 'Key', 'Value', {}))
+ return response_generator(:action => "DeleteTags", :params => params)
+ end
end
end
end

0 comments on commit 5a5aab3

Please sign in to comment.