Class Rudy::CLI::AWS::EC2::Keypairs

  1. lib/rudy/cli/aws/ec2/keypairs.rb

Public instance methods

create_keypairs ()
[show source]
    # File lib/rudy/cli/aws/ec2/keypairs.rb, line 12
12:     def create_keypairs
13:       kp = execute_action { Rudy::AWS::EC2::Keypairs.create(@argv.name) }
14:       if [:s, :string].member?(@@global.format)
15:         li "Name: #{kp.name}"
16:         li "Fingerprint: #{kp.fingerprint}", $/
17:         li "Copy the following private key data into a file."
18:         li "Set the permissions to 0600 and keep it safe.", $/
19:         li kp.private_key
20:       else
21:          print_stobject kp
22:       end
23:     end
create_keypairs_valid? ()
[show source]
    # File lib/rudy/cli/aws/ec2/keypairs.rb, line 8
 8:     def create_keypairs_valid?
 9:       raise Drydock::ArgError.new('name', @alias) unless @argv.name
10:       true
11:     end
destroy_keypairs ()
[show source]
    # File lib/rudy/cli/aws/ec2/keypairs.rb, line 29
29:     def destroy_keypairs
30:       raise "Keypair #{@argv.name} does not exist" unless Rudy::AWS::EC2::Keypairs.exists?(@argv.name)
31:       kp = Rudy::AWS::EC2::Keypairs.get(@argv.name)
32:       li "Destroying: #{kp.name}"
33:       execute_check(:medium)
34:       execute_action { Rudy::AWS::EC2::Keypairs.destroy(kp.name) }
35:     end
destroy_keypairs_valid? ()
[show source]
    # File lib/rudy/cli/aws/ec2/keypairs.rb, line 25
25:     def destroy_keypairs_valid?
26:       raise Drydock::ArgError.new('name', @alias) unless @argv.name
27:       true
28:     end
keypairs ()
[show source]
    # File lib/rudy/cli/aws/ec2/keypairs.rb, line 37
37:     def keypairs
38:       klist = Rudy::AWS::EC2::Keypairs.list
39:       print_stobjects klist
40:     end