Class: Awshark::Ec2::Subcommand
- Inherits:
-
Thor
- Object
- Thor
- Awshark::Ec2::Subcommand
- Includes:
- ClassOptions
- Defined in:
- lib/awshark/ec2/subcommand.rb
Instance Method Summary collapse
Methods included from ClassOptions
Instance Method Details
#authorize ⇒ Object
54 55 56 57 58 59 |
# File 'lib/awshark/ec2/subcommand.rb', line 54 def group = Ec2::SecurityGroup.new(id: security_group_id, username: username) group.(ip: my_ip, ports: ports) end |
#list(state = 'running') ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/awshark/ec2/subcommand.rb', line 23 def list(state = 'running') instances = manager.public_send("#{state}_instances") instances = instances.sort_by(&:name) instances.each do |i| args = { name: i.name, type: i.type, public_dns: i.public_dns_name, state: i.state } printf "%-40<name>s %-12<type>s %-60<public_dns>s %<state>s\n", args end end |
#unauthorize ⇒ Object
76 77 78 79 80 81 |
# File 'lib/awshark/ec2/subcommand.rb', line 76 def group = Ec2::SecurityGroup.new(id: security_group_id, username: username) group. end |