1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/requests/ec2/describe_images.rb
2009-07-13 19:14:59 -07:00

40 lines
1.4 KiB
Ruby

module Fog
module AWS
class EC2
# Describe all or specified images.
#
# ==== Params
# * options<~Hash> - Optional params
# * :executable_by<~String> - Only return images that the executable_by
# user has explicit permission to launch
# * :image_id<~Array> - Ids of images to describe
# * :owner<~String> - Only return images belonging to owner.
#
# ==== Returns
# * response<~Fog::AWS::Response>:
# * body<~Hash>:
# * :request_id<~String> - Id of request
# * :image_set<~Array>:
# * :architecture<~String> - Architecture of the image
# * :image_id<~String> - Id of the image
# * :image_location<~String> - Location of the image
# * :image_owner_id<~String> - Id of the owner of the image
# * :image_state<~String> - State of the image
# * :image_type<~String> - Type of the image
# * :is_public<~Boolean> - Whether or not the image is public
def describe_images(options = {})
params = {}
if options[:image_id]
params = indexed_params('ImageId', options[:image_id])
end
request({
'Action' => 'DescribeImages',
'ExecutableBy' => options[:executable_by],
'Owner' => options[:owner]
}.merge!(params), Fog::Parsers::AWS::EC2::DescribeImages.new)
end
end
end
end