class AwsCli::CLI::EC2::Ami

Public Instance Methods

create() click to toggle source
# File lib/awscli/cli/ec2/ami.rb, line 30
def create
  create_ec2_object
  @ec2.create_image_from_instance options
end
deregister() click to toggle source
# File lib/awscli/cli/ec2/ami.rb, line 37
def deregister
  create_ec2_object
  @ec2.deregister options[:image_id]
end
list() click to toggle source
# File lib/awscli/cli/ec2/ami.rb, line 12
def list
  create_ec2_object
  if options[:amazon_owned]
    @ec2.list_amazon
  elsif options[:show_filters]
    @ec2.show_filters
  elsif options[:self_owned]
    @ec2.list_self
  else
    @ec2.list options[:filter]
  end
end

Private Instance Methods

create_ec2_object() click to toggle source
# File lib/awscli/cli/ec2/ami.rb, line 45
def create_ec2_object
  puts "ec2 Establishing Connetion..."
  $ec2_conn = if parent_options[:region]
                Awscli::Connection.new.request_ec2(parent_options[:region])
              else
                Awscli::Connection.new.request_ec2
              end
  puts "ec2 Establishing Connetion... OK"
  @ec2 = Awscli::EC2::Ami.new($ec2_conn)
end