1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge branch 'master' of github.com:fog/fog into dir_metadata

This commit is contained in:
Kyle Rames 2013-02-13 09:11:33 -06:00
commit 9600f2d13a
4 changed files with 8 additions and 2 deletions

View file

@ -21,6 +21,7 @@ module Fog
attribute :availability_zone_group, :aliases => 'availabilityZoneGroup'
attribute :product_description, :aliases => 'productDescription'
attribute :ebs_optimized, :aliases => 'LaunchSpecification.EbsOptimized'
attribute :groups, :aliases => 'LaunchSpecification.SecurityGroup'
attribute :key_name, :aliases => 'LaunchSpecification.KeyName'
attribute :availability_zone, :aliases => 'LaunchSpecification.Placement.AvailabilityZone'
@ -95,6 +96,7 @@ module Fog
'LaunchSpecification.Monitoring.Enabled' => monitoring,
'LaunchSpecification.Placement.AvailabilityZone' => availability_zone,
'LaunchSpecification.SecurityGroup' => groups,
'LaunchSpecification.EbsOptimized' => ebs_optimized,
'LaunchSpecification.UserData' => user_data,
'LaunchSpecification.SubnetId' => subnet_id,
'LaunchSpecification.IamInstanceProfile.Arn' => @iam_instance_profile_arn,

View file

@ -52,6 +52,8 @@ module Fog
end
when 'imageId', 'instanceType', 'keyname', 'subnetId'
@spot_instance_request['launchSpecification'][name] = value
when 'ebsOptimized'
@spot_instance_request['launchSpecification'][name] = value == 'true'
when 'enabled'
@spot_instance_request['launchSpecification']['monitoring'] = (value == 'true')
when 'requestId'

View file

@ -29,6 +29,7 @@ module Fog
# * 'LaunchSpecification.SecurityGroup'<~Array> or <~String> - Name of security group(s) for instances, not supported in VPC
# * 'LaunchSpecification.SecurityGroupId'<~Array> or <~String> - Id of security group(s) for instances, use this or LaunchSpecification.SecurityGroup
# * 'LaunchSpecification.UserData'<~String> - Additional data to provide to booting instances
# * 'LaunchSpecification.EbsOptimized'<~Boolean> - Whether the instance is optimized for EBS I/O
# * 'Type'<~String> - spot instance request type in ['one-time', 'persistent']
# * 'ValidFrom'<~Time> - start date for request
# * 'ValidUntil'<~Time> - end date for request

View file

@ -12,6 +12,7 @@ Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do
'imageId' => String,
'instanceType' => String,
'monitoring' => Fog::Boolean,
'ebsOptimized' => Fog::Boolean,
'subnetId' => Fog::Nullable::String,
'iamInstanceProfile' => Fog::Nullable::Hash,
},
@ -38,13 +39,13 @@ Shindo.tests('Fog::Compute[:aws] | spot instance requests', ['aws']) do
pending if Fog.mocking?
tests("#request_spot_instances('ami-3202f25b', 't1.micro', '0.001')").formats(@spot_instance_requests_format) do
data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001').body
data = Fog::Compute[:aws].request_spot_instances('ami-3202f25b', 't1.micro', '0.001',{'LaunchSpecification.EbsOptimized' => false}).body
@spot_instance_request_id = data['spotInstanceRequestSet'].first['spotInstanceRequestId']
data
end
tests("#describe_spot_instance_requests").formats(@spot_instance_requests_format) do
Fog::Compute[:aws].describe_spot_instance_requests.body
Fog::Compute[:aws].describe_spot_instance_requests('spot-instance-request-id' => [@spot_instance_request_id]).body
end
tests("#cancel_spot_instance_requests('#{@spot_instance_request_id}')").formats(@cancel_spot_instance_request_format) do