lib/aws-sdk-ec2/image.rb in aws-sdk-ec2-1.380.0 vs lib/aws-sdk-ec2/image.rb in aws-sdk-ec2-1.381.0
- old
+ new
@@ -272,11 +272,13 @@
#
# image.reload.data
#
# @return [self]
def load
- resp = @client.describe_images(image_ids: [@id])
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.describe_images(image_ids: [@id])
+ end
@data = resp.images[0]
self
end
alias :reload :load
@@ -317,11 +319,13 @@
# @return [Image]
def wait_until_exists(options = {}, &block)
options, params = separate_params_and_options(options)
waiter = Waiters::ImageExists.new(options)
yield_waiter_and_warn(waiter, &block) if block_given?
- resp = waiter.wait(params.merge(image_ids: [@id]))
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ waiter.wait(params.merge(image_ids: [@id]))
+ end
Image.new({
id: @id,
data: resp.data.images[0],
client: @client
})
@@ -419,11 +423,13 @@
else
self_copy.reload unless attempts == options[:max_attempts]
:retry
end
end
- Aws::Waiters::Waiter.new(options).wait({})
+ Aws::Plugins::UserAgent.feature('resource') do
+ Aws::Waiters::Waiter.new(options).wait({})
+ end
end
# @!group Actions
# @example Request syntax with placeholder values
@@ -449,11 +455,13 @@
# set the value to an empty string.
# @return [Tag::Collection]
def create_tags(options = {})
batch = []
options = Aws::Util.deep_merge(options, resources: [@id])
- resp = @client.create_tags(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.create_tags(options)
+ end
options[:tags].each do |t|
batch << Tag.new(
resource_id: @id,
key: t[:key],
value: t[:value],
@@ -494,11 +502,13 @@
# Constraints: Up to 1000 tags.
# @return [Tag::Collection]
def delete_tags(options = {})
batch = []
options = Aws::Util.deep_merge(options, resources: [@id])
- resp = @client.delete_tags(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.delete_tags(options)
+ end
options[:tags].each do |t|
batch << Tag.new(
resource_id: @id,
key: t[:key],
value: t[:value],
@@ -520,11 +530,13 @@
# If you have the required permissions, the error response is
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
# @return [EmptyStructure]
def deregister(options = {})
options = options.merge(image_id: @id)
- resp = @client.deregister_image(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.deregister_image(options)
+ end
resp.data
end
# @example Request syntax with placeholder values
#
@@ -546,11 +558,13 @@
# If you have the required permissions, the error response is
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
# @return [Types::ImageAttribute]
def describe_attribute(options = {})
options = options.merge(image_id: @id)
- resp = @client.describe_image_attribute(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.describe_image_attribute(options)
+ end
resp.data
end
# @example Request syntax with placeholder values
#
@@ -636,11 +650,13 @@
#
# [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration
# @return [EmptyStructure]
def modify_attribute(options = {})
options = options.merge(image_id: @id)
- resp = @client.modify_image_attribute(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.modify_image_attribute(options)
+ end
resp.data
end
# @example Request syntax with placeholder values
#
@@ -658,10 +674,12 @@
# If you have the required permissions, the error response is
# `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
# @return [EmptyStructure]
def reset_attribute(options = {})
options = options.merge(image_id: @id)
- resp = @client.reset_image_attribute(options)
+ resp = Aws::Plugins::UserAgent.feature('resource') do
+ @client.reset_image_attribute(options)
+ end
resp.data
end
# @deprecated
# @api private