You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::AutoScaling::Tag::Collection

Inherits:
Resources::Collection show all
Defined in:
gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/tag.rb

Batch Actions collapse

Methods inherited from Resources::Collection

#each, #first, #limit, #size

Instance Method Details

#batch_create(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

  • options ({}) (defaults to: {})


309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/tag.rb', line 309

def batch_create(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:tags] ||= []
    batch.each do |item|
      params[:tags] << {
        resource_type: item.resource_type,
        resource_id: item.resource_id,
        key: item.key
      }
    end
    batch[0].client.create_or_update_tags(params)
  end
  nil
end

#batch_delete!(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

  • options ({}) (defaults to: {})


327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/tag.rb', line 327

def batch_delete!(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:tags] ||= []
    batch.each do |item|
      params[:tags] << {
        resource_type: item.resource_type,
        resource_id: item.resource_id,
        key: item.key
      }
    end
    batch[0].client.delete_tags(params)
  end
  nil
end