Class: AWS::EC2::Base
- Defined in:
- lib/AWS/EC2.rb,
lib/AWS/EC2/devpay.rb,
lib/AWS/EC2/images.rb,
lib/AWS/EC2/console.rb,
lib/AWS/EC2/volumes.rb,
lib/AWS/EC2/keypairs.rb,
lib/AWS/EC2/products.rb,
lib/AWS/EC2/instances.rb,
lib/AWS/EC2/snapshots.rb,
lib/AWS/EC2/elastic_ips.rb,
lib/AWS/EC2/security_groups.rb,
lib/AWS/EC2/image_attributes.rb,
lib/AWS/EC2/availability_zones.rb,
lib/AWS/EC2/spot_instance_requests.rb
Instance Attribute Summary
Attributes inherited from Base
#port, #proxy_server, #server, #use_ssl
Instance Method Summary collapse
-
#allocate_address ⇒ Object
The AllocateAddress operation acquires an elastic IP address for use with your account.
- #api_version ⇒ Object
-
#associate_address(options = {}) ⇒ Object
The AssociateAddress operation associates an elastic IP address with an instance.
-
#attach_volume(options = {}) ⇒ Object
The AttachVolume operation attaches an Amazon EBS volume to an instance.
-
#authorize_security_group_ingress(options = {}) ⇒ Object
The AuthorizeSecurityGroupIngress operation adds permissions to a security group.
-
#confirm_product_instance(options = {}) ⇒ Object
The ConfirmProductInstance operation returns true if the given product code is attached to the instance with the given instance id.
-
#create_image(options = {}) ⇒ Object
Creates an AMI that uses an Amazon EBS root device from a “running” or “stopped” instance.
-
#create_keypair(options = {}) ⇒ Object
The CreateKeyPair operation creates a new 2048 bit RSA keypair and returns a unique ID that can be used to reference this keypair when launching new instances.
-
#create_security_group(options = {}) ⇒ Object
The CreateSecurityGroup operation creates a new security group.
-
#create_snapshot(options = {}) ⇒ Object
The CreateSnapshot operation creates a snapshot of an Amazon EBS volume and stores it in Amazon S3.
-
#create_spot_instances_request(options = {}) ⇒ Object
Creates a Spot Instance request.
-
#create_volume(options = {}) ⇒ Object
The CreateVolume operation creates a new Amazon EBS volume that you can mount from any Amazon EC2 instance.
- #default_host ⇒ Object
-
#delete_keypair(options = {}) ⇒ Object
The DeleteKeyPair operation deletes a keypair.
-
#delete_security_group(options = {}) ⇒ Object
The DeleteSecurityGroup operation deletes a security group.
-
#delete_snapshot(options = {}) ⇒ Object
The DeleteSnapshot operation deletes a snapshot of an Amazon EBS volume that is stored in Amazon S3.
-
#delete_volume(options = {}) ⇒ Object
The DeleteVolume operation deletes an Amazon EBS volume.
-
#deregister_image(options = {}) ⇒ Object
The DeregisterImage operation deregisters an AMI.
-
#describe_addresses(options = {}) ⇒ Object
The DescribeAddresses operation lists elastic IP addresses assigned to your account.
-
#describe_availability_zones(options = {}) ⇒ Object
The DescribeAvailabilityZones operation describes availability zones that are currently available to the account and their states.
-
#describe_image_attribute(options = {}) ⇒ Object
The DescribeImageAttribute operation returns information about an attribute of an AMI.
-
#describe_images(options = {}) ⇒ Object
The DescribeImages operation returns information about AMIs available for use by the user.
-
#describe_instance_attribute(options = {}) ⇒ Object
Not yet implemented.
-
#describe_instances(options = {}) ⇒ Object
The DescribeInstances operation returns information about instances owned by the user making the request.
-
#describe_keypairs(options = {}) ⇒ Object
The DescribeKeyPairs operation returns information about keypairs available for use by the user making the request.
-
#describe_regions(options = {}) ⇒ Object
Not yet implemented.
-
#describe_reserved_instances(options = {}) ⇒ Object
Not yet implemented.
-
#describe_reserved_instances_offerings(options = {}) ⇒ Object
Not yet implemented.
-
#describe_security_groups(options = {}) ⇒ Object
The DescribeSecurityGroups operation returns information about security groups owned by the user making the request.
-
#describe_snapshot_attribute(options = {}) ⇒ Object
The DescribeSnapshotAttribute operation returns information about an attribute of a snapshot.
-
#describe_snapshots(options = {}) ⇒ Object
The DescribeSnapshots operation describes the status of Amazon EBS snapshots.
-
#describe_spot_instance_requests(options = {}) ⇒ Object
Describes Spot Instance requests.
-
#describe_volumes(options = {}) ⇒ Object
The DescribeVolumes operation lists one or more Amazon EBS volumes that you own, If you do not specify any volumes, Amazon EBS returns all volumes that you own.
-
#destroy_spot_instance_requests(options = {}) ⇒ Object
Cancels one or more Spot Instance requests.
-
#detach_volume(options = {}) ⇒ Object
The DetachVolume operation detaches an Amazon EBS volume from an instance.
-
#disassociate_address(options = {}) ⇒ Object
The DisassociateAddress operation disassociates the specified elastic IP address from the instance to which it is assigned.
-
#get_console_output(options = {}) ⇒ Object
The GetConsoleOutput operation retrieves console output that has been posted for the specified instance.
-
#modify_image_attribute(options = {}) ⇒ Object
The ModifyImageAttribute operation modifies an attribute of an AMI.
-
#modify_instance_attribute(options = {}) ⇒ Object
Not yet implemented.
-
#modify_snapshot_attribute(options = {}) ⇒ Object
The ModifySnapshotAttribute operation adds or remove permission settings for the specified snapshot.
-
#monitor_instances(options = {}) ⇒ Object
The MonitorInstances operation tells Cloudwatch to begin logging metrics from one or more EC2 instances.
-
#purchase_reserved_instances_offering(options = {}) ⇒ Object
Not yet implemented.
-
#reboot_instances(options = {}) ⇒ Object
The RebootInstances operation requests a reboot of one or more instances.
-
#register_image(options = {}) ⇒ Object
The RegisterImage operation registers an AMI with Amazon EC2.
-
#release_address(options = {}) ⇒ Object
The ReleaseAddress operation releases an elastic IP address associated with your account.
-
#reset_image_attribute(options = {}) ⇒ Object
The ResetImageAttribute operation resets an attribute of an AMI to its default value.
-
#reset_instance_attribute(options = {}) ⇒ Object
Not yet implemented.
-
#reset_snapshot_attribute(options = {}) ⇒ Object
The ResetSnapshotAttribute operation resets permission settings for the specified snapshot.
-
#revoke_security_group_ingress(options = {}) ⇒ Object
The RevokeSecurityGroupIngress operation revokes existing permissions that were previously granted to a security group.
-
#run_instances(options = {}) ⇒ Object
Launches a specified number of instances of an AMI for which you have permissions.
-
#start_instances(options = {}) ⇒ Object
Starts an instance that uses an Amazon EBS volume as its root device.
-
#stop_instances(options = {}) ⇒ Object
Stops an instance that uses an Amazon EBS volume as its root device.
-
#terminate_instances(options = {}) ⇒ Object
The TerminateInstances operation shuts down one or more instances.
-
#unmonitor_instances(options = {}) ⇒ Object
The UnmonitorInstances operation tells Cloudwatch to stop logging metrics from one or more EC2 instances.
Methods inherited from Base
#extract_user_data, #initialize
Constructor Details
This class inherits a constructor from AWS::Base
Instance Method Details
#allocate_address ⇒ Object
The AllocateAddress operation acquires an elastic IP address for use with your account.
8 9 10 |
# File 'lib/AWS/EC2/elastic_ips.rb', line 8 def allocate_address return response_generator(:action => "AllocateAddress") end |
#api_version ⇒ Object
22 23 24 |
# File 'lib/AWS/EC2.rb', line 22 def api_version API_VERSION end |
#associate_address(options = {}) ⇒ Object
The AssociateAddress operation associates an elastic IP address with an instance.
If the IP address is currently assigned to another instance, the IP address is assigned to the new instance. This is an idempotent operation. If you enter it more than once, Amazon EC2 does not return an error.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/AWS/EC2/elastic_ips.rb', line 22 def associate_address( = {} ) = { :instance_id => '', :public_ip => '' }.merge() raise ArgumentError, "No ':instance_id' provided" if [:instance_id].nil? || [:instance_id].empty? raise ArgumentError, "No ':public_ip' provided" if [:public_ip].nil? || [:public_ip].empty? params = { "InstanceId" => [:instance_id], "PublicIp" => [:public_ip] } return response_generator(:action => "AssociateAddress", :params => params) end |
#attach_volume(options = {}) ⇒ Object
The AttachVolume operation attaches an Amazon EBS volume to an instance.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/AWS/EC2/volumes.rb', line 57 def attach_volume( = {} ) = { :volume_id => '' }.merge() = { :instance_id => '' }.merge() = { :device => '' }.merge() raise ArgumentError, "No :volume_id provided" if [:volume_id].nil? || [:volume_id].empty? raise ArgumentError, "No :instance_id provided" if [:instance_id].nil? || [:instance_id].empty? raise ArgumentError, "No :device provided" if [:device].nil? || [:device].empty? params = { "VolumeId" => [:volume_id], "InstanceId" => [:instance_id], "Device" => [:device] } return response_generator(:action => "AttachVolume", :params => params) end |
#authorize_security_group_ingress(options = {}) ⇒ Object
The AuthorizeSecurityGroupIngress operation adds permissions to a security group.
Permissions are specified in terms of the IP protocol (TCP, UDP or ICMP), the source of the request (by IP range or an Amazon EC2 user-group pair), source and destination port ranges (for TCP and UDP), and ICMP codes and types (for ICMP). When authorizing ICMP, -1 may be used as a wildcard in the type and code fields.
Permission changes are propagated to instances within the security group being modified as quickly as possible. However, a small delay is likely, depending on the number of instances that are members of the indicated group.
When authorizing a user/group pair permission, GroupName, SourceSecurityGroupName and SourceSecurityGroupOwnerId must be specified. When authorizing a CIDR IP permission, GroupName, IpProtocol, FromPort, ToPort and CidrIp must be specified. Mixing these two types of parameters is not allowed.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/AWS/EC2/security_groups.rb', line 85 def ( = {} ) = { :group_name => nil, :ip_protocol => nil, :from_port => nil, :to_port => nil, :cidr_ip => nil, :source_security_group_name => nil, :source_security_group_owner_id => nil }.merge() # lets not validate the rest of the possible permutations of required params and instead let # EC2 sort it out on the server side. We'll only require :group_name as that is always needed. raise ArgumentError, "No :group_name provided" if [:group_name].nil? || [:group_name].empty? params = { "GroupName" => [:group_name], "IpProtocol" => [:ip_protocol], "FromPort" => [:from_port].to_s, "ToPort" => [:to_port].to_s, "CidrIp" => [:cidr_ip], "SourceSecurityGroupName" => [:source_security_group_name], "SourceSecurityGroupOwnerId" => [:source_security_group_owner_id] } return response_generator(:action => "AuthorizeSecurityGroupIngress", :params => params) end |
#confirm_product_instance(options = {}) ⇒ Object
The ConfirmProductInstance operation returns true if the given product code is attached to the instance with the given instance id. False is returned if the product code is not attached to the instance.
10 11 12 |
# File 'lib/AWS/EC2/devpay.rb', line 10 def confirm_product_instance( = {} ) raise "Not yet implemented" end |
#create_image(options = {}) ⇒ Object
Creates an AMI that uses an Amazon EBS root device from a “running” or “stopped” instance.
AMIs that use an Amazon EBS root device boot faster than AMIs that use instance stores. They can be up to 1 TiB in size, use storage that persists on instance failure, and can be stopped and started.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/AWS/EC2/images.rb', line 17 def create_image( = {} ) = { :instance_id => "", :name => "" }.merge() raise ArgumentError, "No :instance_id provided" if .does_not_have? :instance_id raise ArgumentError, "No :name provided" if .does_not_have? :name raise ArgumentError, "Invalid string length for :name provided" if [:name] && [:name].size < 3 || [:name].size > 128 raise ArgumentError, "Invalid string length for :description provided (too long)" if [:description] && [:description].size > 255 raise ArgumentError, ":no_reboot option must be a Boolean" unless [:no_reboot].nil? || [true, false].include?([:no_reboot]) params = {} params["InstanceId"] = [:instance_id].to_s params["Name"] = [:name].to_s params["Description"] = [:description].to_s params["NoReboot"] = [:no_reboot].to_s return response_generator(:action => "CreateImage", :params => params) end |
#create_keypair(options = {}) ⇒ Object
The CreateKeyPair operation creates a new 2048 bit RSA keypair and returns a unique ID that can be used to reference this keypair when launching new instances.
11 12 13 14 15 16 |
# File 'lib/AWS/EC2/keypairs.rb', line 11 def create_keypair( = {} ) = { :key_name => "" }.merge() raise ArgumentError, "No :key_name provided" if [:key_name].nil? || [:key_name].empty? params = { "KeyName" => [:key_name] } return response_generator(:action => "CreateKeyPair", :params => params) end |
#create_security_group(options = {}) ⇒ Object
The CreateSecurityGroup operation creates a new security group. Every instance is launched in a security group. If none is specified as part of the launch request then instances are launched in the default security group. Instances within the same security group have unrestricted network access to one another. Instances will reject network access attempts from other instances in a different security group. As the owner of instances you may grant or revoke specific permissions using the AuthorizeSecurityGroupIngress and RevokeSecurityGroupIngress operations.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/AWS/EC2/security_groups.rb', line 16 def create_security_group( = {} ) = {:group_name => "", :group_description => "" }.merge() raise ArgumentError, "No :group_name provided" if [:group_name].nil? || [:group_name].empty? raise ArgumentError, "No :group_description provided" if [:group_description].nil? || [:group_description].empty? params = { "GroupName" => [:group_name], "GroupDescription" => [:group_description] } return response_generator(:action => "CreateSecurityGroup", :params => params) end |
#create_snapshot(options = {}) ⇒ Object
The CreateSnapshot operation creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to launch instances from identical snapshots, and to save data before shutting down an instance.
26 27 28 29 30 31 32 33 |
# File 'lib/AWS/EC2/snapshots.rb', line 26 def create_snapshot( = {} ) = { :volume_id => '' }.merge() raise ArgumentError, "No :volume_id provided" if [:volume_id].nil? || [:volume_id].empty? params = { "VolumeId" => [:volume_id] } return response_generator(:action => "CreateSnapshot", :params => params) end |
#create_spot_instances_request(options = {}) ⇒ Object
Creates a Spot Instance request. Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current spot instance requests. For conceptual information about Spot Instances, refer to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/AWS/EC2/spot_instance_requests.rb', line 31 def create_spot_instances_request( = {} ) = { :instance_count => 1, :instance_type => 'm1.small', :base64_encoded => false }.merge() raise ArgumentError, ":addressing_type has been deprecated." if [:addressing_type] raise ArgumentError, ":spot_price must be provided" if [:spot_price].nil? || [:spot_price].empty? user_data = extract_user_data() params = {} if [:security_group] params.merge!(pathlist("LaunchSpecification.SecurityGroup", [:security_group])) end if [:block_device_mapping] params.merge!(pathhashlist('LaunchSpecification.BlockDeviceMapping', [:block_device_mapping].flatten, {:device_name => 'DeviceName', :virtual_name => 'VirtualName', :ebs_snapshot_id => 'Ebs.SnapshotId', :ebs_volume_size => 'Ebs.VolumeSize', :ebs_delete_on_termination => 'Ebs.DeleteOnTermination' })) end params["SpotPrice"] = [:spot_price] params["InstanceCount"] = [:instance_count].to_s params["Type"] = [:type] unless [:type].nil? params["ValidFrom"] = [:valid_from].to_s unless [:valid_from].nil? params["ValidUntil"] = [:valid_until].to_s unless [:valid_until].nil? params["LaunchGroup"] = [:launch_group] unless [:launch_group].nil? params["AvailabilityZoneGroup"] = [:availability_zone_group] unless [:availability_zone_group].nil? params["LaunchSpecification.ImageId"] = [:image_id] unless [:image_id].nil? params["LaunchSpecification.KeyName"] = [:key_name] unless [:key_name].nil? params["LaunchSpecification.UserData"] = user_data unless user_data.nil? params["LaunchSpecification.InstanceType"] = [:instance_type] unless [:instance_type].nil? params["LaunchSpecification.KernelId"] = [:kernel_id] unless [:kernel_id].nil? params["LaunchSpecification.RamdiskId"] = [:ramdisk_id] unless [:ramdisk_id].nil? params["LaunchSpecification.SubnetId"] = [:subnet_id] unless [:subnet_id].nil? params["LaunchSpecification.Placement.AvailabilityZone"] = [:availability_zone] unless [:availability_zone].nil? params["LaunchSpecification.Monitoring.Enabled"] = [:monitoring_enabled].to_s unless [:monitoring_enabled].nil? return response_generator(:action => "RequestSpotInstances", :params => params) end |
#create_volume(options = {}) ⇒ Object
The CreateVolume operation creates a new Amazon EBS volume that you can mount from any Amazon EC2 instance.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/AWS/EC2/volumes.rb', line 23 def create_volume( = {} ) = { :availability_zone => '' }.merge() raise ArgumentError, "No :availability_zone provided" if [:availability_zone].nil? || [:availability_zone].empty? = { :size => '' }.merge() = { :snapshot_id => '' }.merge() params = { "AvailabilityZone" => [:availability_zone], "Size" => [:size], "SnapshotId" => [:snapshot_id] } return response_generator(:action => "CreateVolume", :params => params) end |
#default_host ⇒ Object
26 27 28 |
# File 'lib/AWS/EC2.rb', line 26 def default_host DEFAULT_HOST end |
#delete_keypair(options = {}) ⇒ Object
The DeleteKeyPair operation deletes a keypair.
36 37 38 39 40 41 |
# File 'lib/AWS/EC2/keypairs.rb', line 36 def delete_keypair( = {} ) = { :key_name => "" }.merge() raise ArgumentError, "No :key_name provided" if [:key_name].nil? || [:key_name].empty? params = { "KeyName" => [:key_name] } return response_generator(:action => "DeleteKeyPair", :params => params) end |
#delete_security_group(options = {}) ⇒ Object
The DeleteSecurityGroup operation deletes a security group.
If an attempt is made to delete a security group and any instances exist that are members of that group a fault is returned.
53 54 55 56 57 58 |
# File 'lib/AWS/EC2/security_groups.rb', line 53 def delete_security_group( = {} ) = { :group_name => "" }.merge() raise ArgumentError, "No :group_name provided" if [:group_name].nil? || [:group_name].empty? params = { "GroupName" => [:group_name] } return response_generator(:action => "DeleteSecurityGroup", :params => params) end |
#delete_snapshot(options = {}) ⇒ Object
The DeleteSnapshot operation deletes a snapshot of an Amazon EBS volume that is stored in Amazon S3.
40 41 42 43 44 45 46 47 |
# File 'lib/AWS/EC2/snapshots.rb', line 40 def delete_snapshot( = {} ) = { :snapshot_id => '' }.merge() raise ArgumentError, "No :snapshot_id provided" if [:snapshot_id].nil? || [:snapshot_id].empty? params = { "SnapshotId" => [:snapshot_id] } return response_generator(:action => "DeleteSnapshot", :params => params) end |
#delete_volume(options = {}) ⇒ Object
The DeleteVolume operation deletes an Amazon EBS volume.
41 42 43 44 45 46 47 48 |
# File 'lib/AWS/EC2/volumes.rb', line 41 def delete_volume( = {} ) = { :volume_id => '' }.merge() raise ArgumentError, "No :volume_id provided" if [:volume_id].nil? || [:volume_id].empty? params = { "VolumeId" => [:volume_id] } return response_generator(:action => "DeleteVolume", :params => params) end |
#deregister_image(options = {}) ⇒ Object
The DeregisterImage operation deregisters an AMI. Once deregistered, instances of the AMI may no longer be launched.
38 39 40 41 42 43 |
# File 'lib/AWS/EC2/images.rb', line 38 def deregister_image( = {} ) = { :image_id => "" }.merge() raise ArgumentError, "No :image_id provided" if [:image_id].nil? || [:image_id].empty? params = { "ImageId" => [:image_id] } return response_generator(:action => "DeregisterImage", :params => params) end |
#describe_addresses(options = {}) ⇒ Object
The DescribeAddresses operation lists elastic IP addresses assigned to your account.
38 39 40 41 42 |
# File 'lib/AWS/EC2/elastic_ips.rb', line 38 def describe_addresses( = {} ) = { :public_ip => [] }.merge() params = pathlist("PublicIp", [:public_ip]) return response_generator(:action => "DescribeAddresses", :params => params) end |
#describe_availability_zones(options = {}) ⇒ Object
The DescribeAvailabilityZones operation describes availability zones that are currently available to the account and their states.
An optional list of zone names can be passed.
12 13 14 15 16 |
# File 'lib/AWS/EC2/availability_zones.rb', line 12 def describe_availability_zones( = {} ) = { :zone_name => [] }.merge() params = pathlist("ZoneName", [:zone_name] ) return response_generator(:action => "DescribeAvailabilityZones", :params => params) end |
#describe_image_attribute(options = {}) ⇒ Object
The DescribeImageAttribute operation returns information about an attribute of an AMI.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/AWS/EC2/image_attributes.rb', line 77 def describe_image_attribute( = {} ) # defaults = {:image_id => "", :attribute => "launchPermission" }.merge() raise ArgumentError, "No ':image_id' provided" if [:image_id].nil? || [:image_id].empty? raise ArgumentError, "No ':attribute' provided" if [:attribute].nil? || [:attribute].empty? params = { "ImageId" => [:image_id], "Attribute" => [:attribute] } # test options provided and make sure they are valid case [:attribute] when "launchPermission", "productCodes" # these args are ok else raise ArgumentError, "attribute : #{[:attribute].to_s} is not an known attribute." end return response_generator(:action => "DescribeImageAttribute", :params => params) end |
#describe_images(options = {}) ⇒ Object
The DescribeImages operation returns information about AMIs available for use by the user. This includes both public AMIs (those available for any user to launch) and private AMIs (those owned by the user making the request and those owned by other users that the user making the request has explicit launch permissions for).
The list of AMIs returned can be modified via optional lists of AMI IDs, owners or users with launch permissions. If all three optional lists are empty all AMIs the user has launch permissions for are returned. Launch permissions fall into three categories:
Launch Permission Description
public - The all group has launch permissions for the AMI. All users have launch permissions for these AMIs. explicit - The owner of the AMIs has granted a specific user launch permissions for the AMI. implicit - A user has implicit launch permissions for all AMIs he or she owns.
If one or more of the lists are specified the result set is the intersection of AMIs matching the criteria of the individual lists.
Providing the list of AMI IDs requests information for those AMIs only. If no AMI IDs are provided, information of all relevant AMIs will be returned. If an AMI is specified that does not exist a fault is returned. If an AMI is specified that exists but the user making the request does not have launch permissions for, then that AMI will not be included in the returned results.
Providing the list of owners requests information for AMIs owned by the specified owners only. Only AMIs the user has launch permissions for are returned. The items of the list may be account ids for AMIs owned by users with those account ids, amazon for AMIs owned by Amazon or self for AMIs owned by the user making the request.
The executable list may be provided to request information for AMIs that only the specified users have launch permissions for. The items of the list may be account ids for AMIs owned by the user making the request that the users with the specified account ids have explicit launch permissions for, self for AMIs the user making the request has explicit launch permissions for or all for public AMIs.
Deregistered images will be included in the returned results for an unspecified interval subsequent to deregistration.
105 106 107 108 109 110 111 |
# File 'lib/AWS/EC2/images.rb', line 105 def describe_images( = {} ) = { :image_id => [], :owner_id => [], :executable_by => [] }.merge() params = pathlist( "ImageId", [:image_id] ) params.merge!(pathlist( "Owner", [:owner_id] )) params.merge!(pathlist( "ExecutableBy", [:executable_by] )) return response_generator(:action => "DescribeImages", :params => params) end |
#describe_instance_attribute(options = {}) ⇒ Object
Implement this method
Not yet implemented
99 100 101 |
# File 'lib/AWS/EC2/instances.rb', line 99 def describe_instance_attribute( = {} ) raise "Not yet implemented" end |
#describe_instances(options = {}) ⇒ Object
The DescribeInstances operation returns information about instances owned by the user making the request.
An optional list of instance IDs may be provided to request information for those instances only. If no instance IDs are provided, information of all relevant instances information will be returned. If an instance is specified that does not exist a fault is returned. If an instance is specified that exists but is not owned by the user making the request, then that instance will not be included in the returned results.
Recently terminated instances will be included in the returned results for a small interval subsequent to their termination. This interval is typically of the order of one hour
88 89 90 91 92 |
# File 'lib/AWS/EC2/instances.rb', line 88 def describe_instances( = {} ) = { :instance_id => [] }.merge() params = pathlist("InstanceId", [:instance_id]) return response_generator(:action => "DescribeInstances", :params => params) end |
#describe_keypairs(options = {}) ⇒ Object
The DescribeKeyPairs operation returns information about keypairs available for use by the user making the request. Selected keypairs may be specified or the list may be left empty if information for all registered keypairs is required.
25 26 27 28 29 |
# File 'lib/AWS/EC2/keypairs.rb', line 25 def describe_keypairs( = {} ) = { :key_name => [] }.merge() params = pathlist("KeyName", [:key_name] ) return response_generator(:action => "DescribeKeyPairs", :params => params) end |
#describe_regions(options = {}) ⇒ Object
Implement this method
Not yet implemented
22 23 24 |
# File 'lib/AWS/EC2/availability_zones.rb', line 22 def describe_regions( = {} ) raise "Not yet implemented" end |
#describe_reserved_instances(options = {}) ⇒ Object
Implement this method
Not yet implemented
208 209 210 |
# File 'lib/AWS/EC2/instances.rb', line 208 def describe_reserved_instances( = {} ) raise "Not yet implemented" end |
#describe_reserved_instances_offerings(options = {}) ⇒ Object
Implement this method
Not yet implemented
217 218 219 |
# File 'lib/AWS/EC2/instances.rb', line 217 def describe_reserved_instances_offerings( = {} ) raise "Not yet implemented" end |
#describe_security_groups(options = {}) ⇒ Object
The DescribeSecurityGroups operation returns information about security groups owned by the user making the request.
An optional list of security group names may be provided to request information for those security groups only. If no security group names are provided, information of all security groups will be returned. If a group is specified that does not exist an exception is returned.
39 40 41 42 43 |
# File 'lib/AWS/EC2/security_groups.rb', line 39 def describe_security_groups( = {} ) = { :group_name => [] }.merge() params = pathlist("GroupName", [:group_name] ) return response_generator(:action => "DescribeSecurityGroups", :params => params) end |
#describe_snapshot_attribute(options = {}) ⇒ Object
The DescribeSnapshotAttribute operation returns information about an attribute of a snapshot. Only one attribute can be specified per call.
55 56 57 58 59 |
# File 'lib/AWS/EC2/snapshots.rb', line 55 def describe_snapshot_attribute( = {} ) params = { "Attribute" => [:attribute] || 'createVolumePermission' } params.merge!(pathlist("SnapshotId", [:snapshot_id] )) unless [:snapshot_id].nil? || [:snapshot_id] == [] return response_generator(:action => "DescribeSnapshotAttribute", :params => params) end |
#describe_snapshots(options = {}) ⇒ Object
The DescribeSnapshots operation describes the status of Amazon EBS snapshots.
13 14 15 16 17 18 19 |
# File 'lib/AWS/EC2/snapshots.rb', line 13 def describe_snapshots( = {} ) params = {} params.merge!(pathlist("SnapshotId", [:snapshot_id] )) unless [:snapshot_id].nil? || [:snapshot_id] == [] params["RestorableBy"] = [:restorable_by] unless [:restorable_by].nil? params["Owner"] = [:owner] unless [:owner].nil? return response_generator(:action => "DescribeSnapshots", :params => params) end |
#describe_spot_instance_requests(options = {}) ⇒ Object
Describes Spot Instance requests. Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current spot instance requests. For conceptual information about Spot Instances, refer to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.
78 79 80 81 82 83 |
# File 'lib/AWS/EC2/spot_instance_requests.rb', line 78 def describe_spot_instance_requests( = {} ) = { :spot_instance_request_id => []}.merge() params = pathlist( "SpotInstanceRequestId", [:spot_instance_request_id] ) return response_generator(:action => "DescribeSpotInstanceRequests", :params => params) end |
#describe_volumes(options = {}) ⇒ Object
The DescribeVolumes operation lists one or more Amazon EBS volumes that you own, If you do not specify any volumes, Amazon EBS returns all volumes that you own.
10 11 12 13 14 |
# File 'lib/AWS/EC2/volumes.rb', line 10 def describe_volumes( = {} ) = { :volume_id => [] }.merge() params = pathlist("VolumeId", [:volume_id] ) return response_generator(:action => "DescribeVolumes", :params => params) end |
#destroy_spot_instance_requests(options = {}) ⇒ Object
Cancels one or more Spot Instance requests. Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based on available Spot Instance capacity and current spot instance requests. For conceptual information about Spot Instances, refer to the Amazon Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud User Guide.
NB: Canceling a Spot Instance request does not terminiate running Spot Instances associated with the request.
95 96 97 98 99 100 |
# File 'lib/AWS/EC2/spot_instance_requests.rb', line 95 def destroy_spot_instance_requests( = {} ) = { :spot_instance_request_id => []}.merge() params = pathlist( "SpotInstanceRequestId", [:spot_instance_request_id] ) return response_generator(:action => "CancelSpotInstanceRequests", :params => params) end |
#detach_volume(options = {}) ⇒ Object
The DetachVolume operation detaches an Amazon EBS volume from an instance.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/AWS/EC2/volumes.rb', line 81 def detach_volume( = {} ) = { :volume_id => '' }.merge() raise ArgumentError, "No :volume_id provided" if [:volume_id].nil? || [:volume_id].empty? = { :instance_id => '' }.merge() = { :device => '' }.merge() = { :force => '' }.merge() params = { "VolumeId" => [:volume_id], "InstanceId" => [:instance_id], "Device" => [:device], "Force" => [:force] } return response_generator(:action => "DetachVolume", :params => params) end |
#disassociate_address(options = {}) ⇒ Object
The DisassociateAddress operation disassociates the specified elastic IP address from the instance to which it is assigned. This is an idempotent operation. If you enter it more than once, Amazon EC2 does not return an error.
52 53 54 55 56 57 |
# File 'lib/AWS/EC2/elastic_ips.rb', line 52 def disassociate_address( = {} ) = { :public_ip => '' }.merge() raise ArgumentError, "No ':public_ip' provided" if [:public_ip].nil? || [:public_ip].empty? params = { "PublicIp" => [:public_ip] } return response_generator(:action => "DisassociateAddress", :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.
14 15 16 17 18 19 |
# File 'lib/AWS/EC2/console.rb', line 14 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 |
#modify_image_attribute(options = {}) ⇒ Object
The ModifyImageAttribute operation modifies an attribute of an AMI. The following attributes may currently be modified:
‘launchPermission’ : Controls who has permission to launch the AMI. Launch permissions can be granted to specific users by adding userIds. The AMI can be made public by adding the ‘all’ group.
‘productCodes’ : Associates product codes with AMIs. This allows a developer to charge a user extra for using the AMIs. productCodes is a write once attribute - once it has been set it can not be changed or removed. Currently only one product code is supported per AMI.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/AWS/EC2/image_attributes.rb', line 22 def modify_image_attribute( = {} ) # defaults = { :image_id => "", :attribute => "launchPermission", :operation_type => "", :user_id => [], :group => [], :product_code => [] }.merge() raise ArgumentError, "No ':image_id' provided" if [:image_id].nil? || [:image_id].empty? raise ArgumentError, "No ':attribute' provided" if [:attribute].nil? || [:attribute].empty? # OperationType is not required if modifying a product code. unless [:attribute] == 'productCodes' raise ArgumentError, "No ':operation_type' provided" if [:operation_type].nil? || [:operation_type].empty? end params = { "ImageId" => [:image_id], "Attribute" => [:attribute], "OperationType" => [:operation_type] } # test options provided and make sure they are valid case [:attribute] when "launchPermission" unless [:operation_type] == "add" || [:operation_type] == "remove" raise ArgumentError, ":operation_type was #{[:operation_type].to_s} but must be either 'add' or 'remove'" end if ([:user_id].nil? || [:user_id].empty?) && ([:group].nil? || [:group].empty?) raise ArgumentError, "Option :attribute=>'launchPermission' requires ':user_id' or ':group' options to also be specified" end params.merge!(pathlist("UserId", [:user_id])) unless [:user_id].nil? params.merge!(pathlist("Group", [:group])) unless [:group].nil? when "productCodes" if ([:product_code].nil? || [:product_code].empty?) raise ArgumentError, "Option :attribute=>'productCodes' requires ':product_code' to be specified" end params.merge!(pathlist("ProductCode", [:product_code])) unless [:product_code].nil? else raise ArgumentError, "attribute : #{[:attribute].to_s} is not an known attribute." end return response_generator(:action => "ModifyImageAttribute", :params => params) end |
#modify_instance_attribute(options = {}) ⇒ Object
Implement this method
Not yet implemented
108 109 110 |
# File 'lib/AWS/EC2/instances.rb', line 108 def modify_instance_attribute( = {} ) raise "Not yet implemented" end |
#modify_snapshot_attribute(options = {}) ⇒ Object
The ModifySnapshotAttribute operation adds or remove permission settings for the specified snapshot.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/AWS/EC2/snapshots.rb', line 70 def modify_snapshot_attribute( = {} ) = { :snapshot_id => '' }.merge() raise ArgumentError, "No :snapshot_id provided" if [:snapshot_id].nil? || [:snapshot_id].empty? = { :operation_type => '' }.merge() raise ArgumentError, "No :operation_type provided" if [:snapshot_id].nil? || [:snapshot_id].empty? params = { "Attribute" => [:attribute] || 'createVolumePermission', "SnapshotId" => [:snapshot_id], "OperationType" => [:operation_type] } params["UserId"] = [:user_id] unless [:user_id].nil? params["UserGroup"] = [:user_group] unless [:user_group].nil? return response_generator(:action => "ModifySnapshotAttribute", :params => params) end |
#monitor_instances(options = {}) ⇒ Object
The MonitorInstances operation tells Cloudwatch to begin logging metrics from one or more EC2 instances
184 185 186 187 188 189 |
# File 'lib/AWS/EC2/instances.rb', line 184 def monitor_instances( = {} ) = { :instance_id => [] }.merge() raise ArgumentError, "No :instance_id provided" if [:instance_id].nil? || [:instance_id].empty? params = pathlist("InstanceId", [:instance_id]) return response_generator(:action => "MonitorInstances", :params => params) end |
#purchase_reserved_instances_offering(options = {}) ⇒ Object
Implement this method
Not yet implemented
226 227 228 |
# File 'lib/AWS/EC2/instances.rb', line 226 def purchase_reserved_instances_offering( = {} ) raise "Not yet implemented" end |
#reboot_instances(options = {}) ⇒ Object
The RebootInstances operation requests a reboot of one or more instances. This operation is asynchronous; it only queues a request to reboot the specified instance(s). The operation will succeed provided the instances are valid and belong to the user. Terminated instances will be ignored.
157 158 159 160 161 162 |
# File 'lib/AWS/EC2/instances.rb', line 157 def reboot_instances( = {} ) = { :instance_id => [] }.merge() raise ArgumentError, "No instance IDs provided" if [:instance_id].nil? || [:instance_id].empty? params = pathlist("InstanceId", [:instance_id]) return response_generator(:action => "RebootInstances", :params => params) end |
#register_image(options = {}) ⇒ Object
The RegisterImage operation registers an AMI with Amazon EC2. Images must be registered before they can be launched. Each AMI is associated with an unique ID which is provided by the EC2 service via the Registerimage operation. As part of the registration process, Amazon EC2 will retrieve the specified image manifest from Amazon S3 and verify that the image is owned by the user requesting image registration. The image manifest is retrieved once and stored within the Amazon EC2 network. Any modifications to an image in Amazon S3 invalidate this registration. If you do have to make changes and upload a new image deregister the previous image and register the new image.
57 58 59 60 61 62 |
# File 'lib/AWS/EC2/images.rb', line 57 def register_image( = {} ) = {:image_location => ""}.merge() raise ArgumentError, "No :image_location provided" if [:image_location].nil? || [:image_location].empty? params = { "ImageLocation" => [:image_location] } return response_generator(:action => "RegisterImage", :params => params) end |
#release_address(options = {}) ⇒ Object
The ReleaseAddress operation releases an elastic IP address associated with your account.
If you run this operation on an elastic IP address that is already released, the address might be assigned to another account which will cause Amazon EC2 to return an error.
Note : Releasing an IP address automatically disassociates it from any instance with which it is associated. For more information, see DisassociateAddress.
Important! After releasing an elastic IP address, it is released to the IP address pool and might no longer be available to your account. Make sure to update your DNS records and any servers or devices that communicate with the address.
75 76 77 78 79 80 |
# File 'lib/AWS/EC2/elastic_ips.rb', line 75 def release_address( = {} ) = { :public_ip => '' }.merge() raise ArgumentError, "No ':public_ip' provided" if [:public_ip].nil? || [:public_ip].empty? params = { "PublicIp" => [:public_ip] } return response_generator(:action => "ReleaseAddress", :params => params) end |
#reset_image_attribute(options = {}) ⇒ Object
The ResetImageAttribute operation resets an attribute of an AMI to its default value.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/AWS/EC2/image_attributes.rb', line 107 def reset_image_attribute( = {} ) # defaults = {:image_id => "", :attribute => "launchPermission"}.merge() raise ArgumentError, "No ':image_id' provided" if [:image_id].nil? || [:image_id].empty? raise ArgumentError, "No ':attribute' provided" if [:attribute].nil? || [:attribute].empty? params = {"ImageId" => [:image_id], "Attribute" => [:attribute] } # test options provided and make sure they are valid case [:attribute] when "launchPermission" # these args are ok else raise ArgumentError, "attribute : #{[:attribute].to_s} is not an known attribute." end return response_generator(:action => "ResetImageAttribute", :params => params) end |
#reset_instance_attribute(options = {}) ⇒ Object
Implement this method
Not yet implemented
117 118 119 |
# File 'lib/AWS/EC2/instances.rb', line 117 def reset_instance_attribute( = {} ) raise "Not yet implemented" end |
#reset_snapshot_attribute(options = {}) ⇒ Object
The ResetSnapshotAttribute operation resets permission settings for the specified snapshot.
91 92 93 94 95 96 97 |
# File 'lib/AWS/EC2/snapshots.rb', line 91 def reset_snapshot_attribute( = {} ) = { :snapshot_id => '' }.merge() raise ArgumentError, "No :snapshot_id provided" if [:snapshot_id].nil? || [:snapshot_id].empty? params = { "Attribute" => [:attribute] || 'createVolumePermission' } params["SnapshotId"] = [:snapshot_id] unless [:snapshot_id].nil? || [:snapshot_id].empty? return response_generator(:action => "ResetSnapshotAttribute", :params => params) end |
#revoke_security_group_ingress(options = {}) ⇒ Object
The RevokeSecurityGroupIngress operation revokes existing permissions that were previously granted to a security group. The permissions to revoke must be specified using the same values originally used to grant the permission.
Permissions are specified in terms of the IP protocol (TCP, UDP or ICMP), the source of the request (by IP range or an Amazon EC2 user-group pair), source and destination port ranges (for TCP and UDP), and ICMP codes and types (for ICMP). When authorizing ICMP, -1 may be used as a wildcard in the type and code fields.
Permission changes are propagated to instances within the security group being modified as quickly as possible. However, a small delay is likely, depending on the number of instances that are members of the indicated group.
When revoking a user/group pair permission, GroupName, SourceSecurityGroupName and SourceSecurityGroupOwnerId must be specified. When authorizing a CIDR IP permission, GroupName, IpProtocol, FromPort, ToPort and CidrIp must be specified. Mixing these two types of parameters is not allowed.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/AWS/EC2/security_groups.rb', line 136 def revoke_security_group_ingress( = {} ) = { :group_name => nil, :ip_protocol => nil, :from_port => nil, :to_port => nil, :cidr_ip => nil, :source_security_group_name => nil, :source_security_group_owner_id => nil }.merge() # lets not validate the rest of the possible permutations of required params and instead let # EC2 sort it out on the server side. We'll only require :group_name as that is always needed. raise ArgumentError, "No :group_name provided" if [:group_name].nil? || [:group_name].empty? params = { "GroupName" => [:group_name], "IpProtocol" => [:ip_protocol], "FromPort" => [:from_port].to_s, "ToPort" => [:to_port].to_s, "CidrIp" => [:cidr_ip], "SourceSecurityGroupName" => [:source_security_group_name], "SourceSecurityGroupOwnerId" => [:source_security_group_owner_id] } return response_generator(:action => "RevokeSecurityGroupIngress", :params => params) end |
#run_instances(options = {}) ⇒ Object
Launches a specified number of instances of an AMI for which you have permissions.
Amazon API Docs : HTML
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/AWS/EC2/instances.rb', line 27 def run_instances( = {} ) = { :image_id => "", :min_count => 1, :max_count => 1, :base64_encoded => false }.merge() raise ArgumentError, ":addressing_type has been deprecated." if [:addressing_type] raise ArgumentError, ":group_id has been deprecated." if [:group_id] raise ArgumentError, ":image_id must be provided" if [:image_id].nil? || [:image_id].empty? raise ArgumentError, ":min_count is not valid" unless [:min_count].to_i > 0 raise ArgumentError, ":max_count is not valid or must be >= :min_count" unless [:max_count].to_i > 0 && [:max_count].to_i >= [:min_count].to_i raise ArgumentError, ":instance_type must specify a valid instance size" unless [:instance_type].nil? || ["m1.small", "m1.large", "m1.xlarge", "c1.medium", "c1.xlarge", "m2.2xlarge", "m2.4xlarge"].include?([:instance_type]) raise ArgumentError, ":monitoring_enabled must be 'true' or 'false'" unless [:monitoring_enabled].nil? || [true, false].include?([:monitoring_enabled]) raise ArgumentError, ":disable_api_termination must be 'true' or 'false'" unless [:disable_api_termination].nil? || [true, false].include?([:disable_api_termination]) raise ArgumentError, ":instance_initiated_shutdown_behavior must be 'stop' or 'terminate'" unless [:instance_initiated_shutdown_behavior].nil? || ["stop", "terminate"].include?([:instance_initiated_shutdown_behavior]) raise ArgumentError, ":base64_encoded must be 'true' or 'false'" unless [true, false].include?([:base64_encoded]) user_data = extract_user_data() params = {} if [:security_group] params.merge!(pathlist("SecurityGroup", [:security_group])) end if [:block_device_mapping] params.merge!(pathhashlist('BlockDeviceMapping', [:block_device_mapping].flatten, {:device_name => 'DeviceName', :virtual_name => 'VirtualName', :ebs_snapshot_id => 'Ebs.SnapshotId', :ebs_volume_size => 'Ebs.VolumeSize', :ebs_delete_on_termination => 'Ebs.DeleteOnTermination' })) end params["ImageId"] = [:image_id] params["MinCount"] = [:min_count].to_s params["MaxCount"] = [:max_count].to_s params["KeyName"] = [:key_name] unless [:key_name].nil? params["AdditionalInfo"] = [:additional_info] unless [:additional_info].nil? params["UserData"] = user_data unless user_data.nil? params["InstanceType"] = [:instance_type] unless [:instance_type].nil? params["Placement.AvailabilityZone"] = [:availability_zone] unless [:availability_zone].nil? params["KernelId"] = [:kernel_id] unless [:kernel_id].nil? params["RamdiskId"] = [:ramdisk_id] unless [:ramdisk_id].nil? params["Monitoring.Enabled"] = [:monitoring_enabled].to_s unless [:monitoring_enabled].nil? params["SubnetId"] = [:subnet_id] unless [:subnet_id].nil? params["DisableApiTermination"] = [:disable_api_termination].to_s unless [:disable_api_termination].nil? params["InstanceInitiatedShutdownBehavior"] = [:instance_initiated_shutdown_behavior] unless [:instance_initiated_shutdown_behavior].nil? return response_generator(:action => "RunInstances", :params => params) end |
#start_instances(options = {}) ⇒ Object
Starts an instance that uses an Amazon EBS volume as its root device.
126 127 128 129 130 131 132 |
# File 'lib/AWS/EC2/instances.rb', line 126 def start_instances( = {} ) = { :instance_id => [] }.merge() raise ArgumentError, "No :instance_id provided" if [:instance_id].nil? || [:instance_id].empty? params = {} params.merge!(pathlist("InstanceId", [:instance_id])) return response_generator(:action => "StartInstances", :params => params) end |
#stop_instances(options = {}) ⇒ Object
Stops an instance that uses an Amazon EBS volume as its root device.
140 141 142 143 144 145 146 147 148 |
# File 'lib/AWS/EC2/instances.rb', line 140 def stop_instances( = {} ) = { :instance_id => [] }.merge() raise ArgumentError, "No :instance_id provided" if [:instance_id].nil? || [:instance_id].empty? raise ArgumentError, ":force must be 'true' or 'false'" unless [:force].nil? || [true, false].include?([:force]) params = {} params.merge!(pathlist("InstanceId", [:instance_id])) params["Force"] = [:force].to_s unless [:force].nil? return response_generator(:action => "StopInstances", :params => params) end |
#terminate_instances(options = {}) ⇒ Object
The TerminateInstances operation shuts down one or more instances. This operation is idempotent and terminating an instance that is in the process of shutting down (or already terminated) will succeed. Terminated instances remain visible for a short period of time (approximately one hour) after termination, after which their instance ID is invalidated.
172 173 174 175 176 177 |
# File 'lib/AWS/EC2/instances.rb', line 172 def terminate_instances( = {} ) = { :instance_id => [] }.merge() raise ArgumentError, "No :instance_id provided" if [:instance_id].nil? || [:instance_id].empty? params = pathlist("InstanceId", [:instance_id]) return response_generator(:action => "TerminateInstances", :params => params) end |
#unmonitor_instances(options = {}) ⇒ Object
The UnmonitorInstances operation tells Cloudwatch to stop logging metrics from one or more EC2 instances
196 197 198 199 200 201 |
# File 'lib/AWS/EC2/instances.rb', line 196 def unmonitor_instances( = {} ) = { :instance_id => [] }.merge() raise ArgumentError, "No :instance_id provided" if [:instance_id].nil? || [:instance_id].empty? params = pathlist("InstanceId", [:instance_id]) return response_generator(:action => "UnmonitorInstances", :params => params) end |