Method: Fog::Compute::AWS::Real#create_tags
- Defined in:
- lib/fog/compute/requests/aws/create_tags.rb
#create_tags(resources, tags) ⇒ Object
Adds tags to resources
Parameters
-
resources<~String> - One or more resources to tag
-
tags<~String> - hash of key value tag pairs to assign
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘requestId’<~String> - Id of request
-
‘return’<~Boolean> - success?
-
-
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fog/compute/requests/aws/create_tags.rb', line 21 def (resources, ) resources = [*resources] for key, value in if value.nil? [key] = '' end end params = {} params.merge!(Fog::AWS.indexed_param('ResourceId', resources)) params.merge!(Fog::AWS.indexed_param('Tag.%d.Key', .keys)) params.merge!(Fog::AWS.indexed_param('Tag.%d.Value', .values)) request({ 'Action' => 'CreateTags', :parser => Fog::Parsers::Compute::AWS::Basic.new }.merge!(params)) end |