class AwsCli::CLI::EC2::KeyPairs

Public Instance Methods

create() click to toggle source
# File lib/awscli/cli/ec2/keypairs.rb, line 18
def create
  create_ec2_object
  @ec2.create_keypair options
end
delete() click to toggle source
# File lib/awscli/cli/ec2/keypairs.rb, line 25
def delete
  create_ec2_object
  @ec2.delete_keypair options[:name]
end
fingerprint() click to toggle source
# File lib/awscli/cli/ec2/keypairs.rb, line 32
def fingerprint
  create_ec2_object
  @ec2.fingerprint options[:name]
end
import() click to toggle source
# File lib/awscli/cli/ec2/keypairs.rb, line 41
def import
  create_ec2_object
  @ec2.import_keypair options
end
list() click to toggle source
# File lib/awscli/cli/ec2/keypairs.rb, line 8
def list
  puts "Listing Key Pairs"
  create_ec2_object
  @ec2.list_keypairs
end

Private Instance Methods

create_ec2_object() click to toggle source
# File lib/awscli/cli/ec2/keypairs.rb, line 48
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::KeyPairs.new($ec2_conn)
end