Class: AWS::EC2::Base
- Inherits:
-
Base
- Object
- Base
- AWS::EC2::Base
- Defined in:
- lib/help/state_transition_helper.rb,
lib/audit/lib/ec2_utils.rb,
lib/help/ec2_helper.rb
Overview
Implements some helper methods around the EC2 API and methods that are not yet implemented in the amazon-ec2 gem
Instance Method Summary collapse
- #describe_instance_attribute(options) ⇒ Object
-
#get_console_output(options = {}) ⇒ Object
The GetConsoleOutput operation retrieves console output that has been posted for the specified instance.
- #register_image_updated(options) ⇒ Object
Instance Method Details
#describe_instance_attribute(options) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/help/ec2_helper.rb', line 7 def describe_instance_attribute() params = {} params["InstanceId"] = [:instance_id].to_s params["Attribute"] = "rootDeviceName" unless [:attributes][:rootDeviceName] == nil return response_generator(:action => "DescribeInstanceAttribute", :params => params) end |
#get_console_output(options = {}) ⇒ Object
The GetConsoleOutput operation retrieves console output that has been posted for the specified instance.
Instance console output is buffered and posted shortly after instance boot, reboot and once the instance is terminated. Only the most recent 64 KB of posted output is available. Console output is available for at least 1 hour after the most recent post.
234 235 236 237 238 239 |
# File 'lib/audit/lib/ec2_utils.rb', line 234 def get_console_output( = {} ) = {:instance_id => ""}.merge() raise ArgumentError, "No instance ID provided" if [:instance_id].nil? || [:instance_id].empty? params = { "InstanceId" => [:instance_id] } return response_generator(:action => "GetConsoleOutput", :params => params) end |
#register_image_updated(options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/help/state_transition_helper.rb', line 15 def register_image_updated() puts "register_iamge_updated: #{.inspect}" params = {} params["Name"] = [:name].to_s params["BlockDeviceMapping.1.Ebs.SnapshotId"] = [:snapshot_id].to_s params["BlockDeviceMapping.1.DeviceName"] = [:root_device_name].to_s params["Description"] = [:description].to_s params["KernelId"] = [:kernel_id].to_s unless [:kernel_id] == nil params["RamdiskId"] = [:ramdisk_id].to_s unless [:ramdisk_id] == nil params["Architecture"] = [:architecture].to_s params["RootDeviceName"] = [:root_device_name].to_s return response_generator(:action => "RegisterImage", :params => params) end |