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,
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
Constant Summary collapse
- API_VERSION_HACKED =
'2011-11-01'
Instance Method Summary collapse
- #api_version ⇒ Object
- #describe_instance_attribute(options) ⇒ Object
- #describe_internetgateways(options = {}) ⇒ Object
- #describe_vpcs(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
#api_version ⇒ Object
22 23 24 |
# File 'lib/help/ec2_helper.rb', line 22 def api_version API_VERSION_HACKED end |
#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 |
#describe_internetgateways(options = {}) ⇒ Object
32 33 34 35 36 |
# File 'lib/help/ec2_helper.rb', line 32 def describe_internetgateways( = {} ) = { :interetgateway_id => [] }.merge() params = pathlist("internetGatewayId", [:interetgateway_id]) return response_generator(:action => "DescribeInternetGateways", :params => params) end |
#describe_vpcs(options = {}) ⇒ Object
26 27 28 29 30 |
# File 'lib/help/ec2_helper.rb', line 26 def describe_vpcs( = {} ) = { :vpc_id => [] }.merge() params = pathlist("VpcId", [:vpc_id]) return response_generator(:action => "DescribeVpcs", :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
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/help/state_transition_helper.rb', line 16 def register_image_updated() puts "register_image_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 |