Class: AwsCli::CLI::EC2::Instances
- Inherits:
-
Thor
- Object
- Thor
- AwsCli::CLI::EC2::Instances
- Defined in:
- lib/awscli/cli/ec2/instances.rb
Instance Method Summary collapse
- #console_output ⇒ Object
- #create ⇒ Object
- #diatt ⇒ Object
- #dins ⇒ Object
- #list ⇒ Object
- #miatt ⇒ Object
- #reboot ⇒ Object
- #riatt ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #terminate ⇒ Object
Instance Method Details
#console_output ⇒ Object
197 198 199 200 |
# File 'lib/awscli/cli/ec2/instances.rb', line 197 def console_output create_ec2_object @ec2.get_console_output [:instance_id] end |
#create ⇒ Object
160 161 162 163 |
# File 'lib/awscli/cli/ec2/instances.rb', line 160 def create create_ec2_object @ec2.create_instance end |
#diatt ⇒ Object
35 36 37 38 |
# File 'lib/awscli/cli/ec2/instances.rb', line 35 def diatt create_ec2_object @ec2.describe_instance_attribute([:id], [:attr]) end |
#dins ⇒ Object
88 89 90 91 |
# File 'lib/awscli/cli/ec2/instances.rb', line 88 def dins create_ec2_object @ec2.describe_instance_status [:instance_id] end |
#list ⇒ Object
15 16 17 18 19 20 |
# File 'lib/awscli/cli/ec2/instances.rb', line 15 def list puts "Listing Instances" create_ec2_object # puts parent_options #access awscli/cli/ec2.rb class options @ec2.list_instances end |
#miatt ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/awscli/cli/ec2/instances.rb', line 54 def miatt create_ec2_object opts = Marshal.load(Marshal.dump()) #create a copy of options, as original options hash cannot be modified opts.reject!{ |k| k == 'id' } #remove id from opts abort "Please pass an attribute by setting respective option" unless opts abort "You can only pass one attribute at a time" if opts.size != 1 opts.each do |k,v| puts "calling modify_instance_attribute with: #{[:id]}, #{k}, #{opts[k]}" @ec2.modify_instance_attribute([:id], k, opts[k]) end end |
#reboot ⇒ Object
109 110 111 112 |
# File 'lib/awscli/cli/ec2/instances.rb', line 109 def reboot create_ec2_object @ec2.reboot_instance [:instance_id] end |
#riatt ⇒ Object
71 72 73 |
# File 'lib/awscli/cli/ec2/instances.rb', line 71 def riatt puts "Not yet Implemented" end |
#start ⇒ Object
170 171 172 173 |
# File 'lib/awscli/cli/ec2/instances.rb', line 170 def start create_ec2_object @ec2.start_instance [:instance_id] end |
#stop ⇒ Object
180 181 182 183 |
# File 'lib/awscli/cli/ec2/instances.rb', line 180 def stop create_ec2_object @ec2.stop_instance [:instance_id] end |
#terminate ⇒ Object
190 191 192 193 |
# File 'lib/awscli/cli/ec2/instances.rb', line 190 def terminate create_ec2_object @ec2.terminate_instance [:instance_id] end |