Class: Ctrl::Commands::Ssh
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#instances ⇒ Object
7 8 9 10 11 |
# File 'lib/ctrl/commands/ssh.rb', line 7 def instances @instances ||= ListInstances.new( attributes.merge(instance_state: 'running') ).instances end |
#nat_instance ⇒ Object
17 18 19 20 21 |
# File 'lib/ctrl/commands/ssh.rb', line 17 def nat_instance @nat_instance ||= ListInstances.new( attributes.merge(instance_state: 'running', instance_name: 'nat') ).instances.first end |
#perform ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/ctrl/commands/ssh.rb', line 23 def perform cmd = Ctrl::SshCommand.new( nat_instance: nat_instance, target_instance: selected_instance ) exec cmd.to_s end |
#selected_instance ⇒ Object
13 14 15 |
# File 'lib/ctrl/commands/ssh.rb', line 13 def selected_instance @selected_instance ||= Ctrl::InstanceSelector.new(instances: instances).perform end |