Class: Mccloud::Command::KeypairCommand

Inherits:
GroupBase
  • Object
show all
Defined in:
lib/mccloud/command/keypair.rb

Instance Attribute Summary

Attributes inherited from GroupBase

#env

Instance Method Summary collapse

Methods inherited from GroupBase

#initialize, register

Methods included from Helpers

#initialize_environment

Constructor Details

This class inherits a constructor from Mccloud::Command::GroupBase

Instance Method Details

#generate(name = nil) ⇒ Object



18
19
20
21
22
# File 'lib/mccloud/command/keypair.rb', line 18

def generate(name=nil)
  rsa_key=::Mccloud::Util::SSHKey.generate({ :comment => "mykey"})
  env.ui.info rsa_key.ssh_public_key
  env.ui.info rsa_key.rsa_private_key
end

#list(selection = nil) ⇒ Object

method_options :test => :boolean



10
11
12
13
14
15
# File 'lib/mccloud/command/keypair.rb', line 10

def list(selection=nil)

  env.config.keypairs.each do |name,provider|
    env.ui.info("Keypair name:#{name}")
  end
end