fog-aws 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +51 -2
  3. data/lib/fog/aws.rb +29 -27
  4. data/lib/fog/aws/elb.rb +0 -1
  5. data/lib/fog/aws/iam.rb +4 -2
  6. data/lib/fog/aws/kms.rb +180 -0
  7. data/lib/fog/aws/mock.rb +13 -1
  8. data/lib/fog/aws/models/compute/flavors.rb +40 -0
  9. data/lib/fog/aws/models/elasticache/cluster.rb +1 -0
  10. data/lib/fog/aws/models/kms/key.rb +34 -0
  11. data/lib/fog/aws/models/kms/keys.rb +29 -0
  12. data/lib/fog/aws/models/rds/server.rb +33 -26
  13. data/lib/fog/aws/parsers/compute/describe_reserved_instances.rb +1 -1
  14. data/lib/fog/aws/parsers/elasticache/cache_cluster_parser.rb +15 -3
  15. data/lib/fog/aws/parsers/kms/describe_key.rb +34 -0
  16. data/lib/fog/aws/parsers/kms/list_keys.rb +38 -0
  17. data/lib/fog/aws/parsers/rds/db_parser.rb +7 -14
  18. data/lib/fog/aws/rds.rb +1 -1
  19. data/lib/fog/aws/requests/compute/describe_spot_price_history.rb +59 -0
  20. data/lib/fog/aws/requests/compute/request_spot_instances.rb +80 -0
  21. data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +36 -5
  22. data/lib/fog/aws/requests/dns/list_resource_record_sets.rb +33 -5
  23. data/lib/fog/aws/requests/elb/create_load_balancer.rb +15 -2
  24. data/lib/fog/aws/requests/iam/create_role.rb +5 -5
  25. data/lib/fog/aws/requests/kms/create_key.rb +62 -0
  26. data/lib/fog/aws/requests/kms/describe_key.rb +27 -0
  27. data/lib/fog/aws/requests/kms/list_keys.rb +82 -0
  28. data/lib/fog/aws/requests/rds/create_db_instance.rb +33 -38
  29. data/lib/fog/aws/requests/rds/create_db_instance_read_replica.rb +7 -2
  30. data/lib/fog/aws/requests/rds/promote_read_replica.rb +7 -6
  31. data/lib/fog/aws/requests/sns/subscribe.rb +1 -1
  32. data/lib/fog/aws/storage.rb +6 -3
  33. data/lib/fog/aws/version.rb +1 -1
  34. data/tests/helper.rb +2 -2
  35. data/tests/models/rds/helper.rb +10 -3
  36. data/tests/models/rds/server_tests.rb +7 -4
  37. data/tests/requests/compute/spot_instance_tests.rb +2 -2
  38. data/tests/requests/compute/spot_price_history_tests.rb +0 -2
  39. data/tests/requests/kms/helper.rb +27 -0
  40. data/tests/requests/kms/key_tests.rb +23 -0
  41. data/tests/requests/rds/helper.rb +52 -46
  42. data/tests/requests/rds/instance_tests.rb +16 -12
  43. metadata +12 -2
@@ -23,6 +23,7 @@ module Fog
23
23
  attribute :cache_subnet_group_name, :aliases => 'CacheSubnetGroupName'
24
24
  attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups', :type => :array
25
25
  attribute :s3_snapshot_location, :aliases => 'SnapshotArns', :type => :array
26
+ attribute :configuration_endpoint, :aliases => 'ConfigurationEndpoint'
26
27
 
27
28
  attr_accessor :parameter_group_name
28
29
 
@@ -0,0 +1,34 @@
1
+ module Fog
2
+ module AWS
3
+ class KMS
4
+ class Key < Fog::Model
5
+ identity :id, :aliases => 'KeyId'
6
+
7
+ attribute :account_id, :aliases => 'AWSAccountId'
8
+ attribute :arn, :aliases => 'KeyArn'
9
+ attribute :created_at, :aliases => 'CreationDate', :type => :time
10
+ attribute :description, :aliases => 'Description'
11
+ attribute :enabled, :aliases => 'Enabled', :type => :boolean
12
+ attribute :usage, :aliases => 'KeyUsage'
13
+
14
+ attr_writer :policy
15
+
16
+ def reload
17
+ requires :identity
18
+
19
+ data = service.describe_key(self.identity)
20
+ merge_attributes(data.body['KeyMetadata'])
21
+
22
+ self
23
+ end
24
+
25
+ def save
26
+ data = service.create_key(@policy, description, usage)
27
+
28
+ merge_attributes(data.body['KeyMetadata'])
29
+ true
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,29 @@
1
+ require 'fog/aws/models/kms/key'
2
+
3
+ module Fog
4
+ module AWS
5
+ class KMS
6
+ class Keys < Fog::PagedCollection
7
+ attribute :filters
8
+ attribute :truncated
9
+
10
+ model Fog::AWS::KMS::Key
11
+
12
+ def initialize(attributes)
13
+ self.filters ||= {}
14
+ super
15
+ end
16
+
17
+ # This method deliberately returns only a single page of results
18
+ def all(filters_arg = filters)
19
+ filters.merge!(filters_arg)
20
+
21
+ result = service.list_keys(filters).body
22
+ filters[:marker] = result['Marker']
23
+ self.truncated = result['Truncated']
24
+ load(result['Keys'])
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -3,33 +3,40 @@ module Fog
3
3
  class RDS
4
4
  class Server < Fog::Model
5
5
  identity :id, :aliases => 'DBInstanceIdentifier'
6
- attribute :engine, :aliases => 'Engine'
7
- attribute :engine_version, :aliases => 'EngineVersion'
8
- attribute :state, :aliases => 'DBInstanceStatus'
9
- attribute :allocated_storage, :aliases => 'AllocatedStorage', :type => :integer
10
- attribute :iops, :aliases => 'Iops'
11
- attribute :availability_zone , :aliases => 'AvailabilityZone'
12
- attribute :flavor_id, :aliases => 'DBInstanceClass'
13
- attribute :endpoint, :aliases => 'Endpoint'
14
- attribute :read_replica_source, :aliases => 'ReadReplicaSourceDBInstanceIdentifier'
15
- attribute :read_replica_identifiers, :aliases => 'ReadReplicaDBInstanceIdentifiers', :type => :array
16
- attribute :master_username, :aliases => 'MasterUsername'
17
- attribute :multi_az, :aliases => 'MultiAZ'
18
- attribute :created_at, :aliases => 'InstanceCreateTime', :type => :time
19
- attribute :last_restorable_time, :aliases => 'LatestRestorableTime', :type => :time
20
- attribute :auto_minor_version_upgrade, :aliases => 'AutoMinorVersionUpgrade'
21
- attribute :pending_modified_values, :aliases => 'PendingModifiedValues'
22
- attribute :preferred_backup_window, :aliases => 'PreferredBackupWindow'
6
+
7
+ attribute :allocated_storage, :aliases => 'AllocatedStorage', :type => :integer
8
+ attribute :auto_minor_version_upgrade, :aliases => 'AutoMinorVersionUpgrade'
9
+ attribute :availability_zone, :aliases => 'AvailabilityZone'
10
+ attribute :backup_retention_period, :aliases => 'BackupRetentionPeriod', :type => :integer
11
+ attribute :ca_certificate_id, :aliases => 'CACertificateIdentifier'
12
+ attribute :character_set_name, :aliases => 'CharacterSetName'
13
+ attribute :created_at, :aliases => 'InstanceCreateTime', :type => :time
14
+ attribute :db_name, :aliases => 'DBName'
15
+ attribute :db_parameter_groups, :aliases => 'DBParameterGroups'
16
+ attribute :db_security_groups, :aliases => 'DBSecurityGroups', :type => :array
17
+ attribute :db_subnet_group_name, :aliases => 'DBSubnetGroupName'
18
+ attribute :dbi_resource_id, :aliases => 'DbiResourceId'
19
+ attribute :endpoint, :aliases => 'Endpoint'
20
+ attribute :engine, :aliases => 'Engine'
21
+ attribute :engine_version, :aliases => 'EngineVersion'
22
+ attribute :flavor_id, :aliases => 'DBInstanceClass'
23
+ attribute :iops, :aliases => 'Iops', :type => :integer
24
+ attribute :kms_key_id, :aliases => 'KmsKeyId'
25
+ attribute :last_restorable_time, :aliases => 'LatestRestorableTime', :type => :time
26
+ attribute :license_model, :aliases => 'LicenseModel'
27
+ attribute :master_username, :aliases => 'MasterUsername'
28
+ attribute :multi_az, :aliases => 'MultiAZ', :type => :boolean
29
+ attribute :pending_modified_values, :aliases => 'PendingModifiedValues'
30
+ attribute :preferred_backup_window, :aliases => 'PreferredBackupWindow'
23
31
  attribute :preferred_maintenance_window, :aliases => 'PreferredMaintenanceWindow'
24
- attribute :db_name, :aliases => 'DBName'
25
- attribute :db_security_groups, :aliases => 'DBSecurityGroups', :type => :array
26
- attribute :db_parameter_groups, :aliases => 'DBParameterGroups'
27
- attribute :backup_retention_period, :aliases => 'BackupRetentionPeriod', :type => :integer
28
- attribute :license_model, :aliases => 'LicenseModel'
29
- attribute :db_subnet_group_name, :aliases => 'DBSubnetGroupName'
30
- attribute :publicly_accessible, :aliases => 'PubliclyAccessible'
31
- attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups', :type => :array
32
- attribute :storage_type, :aliases => 'StorageType'
32
+ attribute :publicly_accessible, :aliases => 'PubliclyAccessible'
33
+ attribute :read_replica_identifiers, :aliases => 'ReadReplicaDBInstanceIdentifiers', :type => :array
34
+ attribute :read_replica_source, :aliases => 'ReadReplicaSourceDBInstanceIdentifier'
35
+ attribute :state, :aliases => 'DBInstanceStatus'
36
+ attribute :storage_encrypted, :aliases => 'StorageEncrypted', :type => :boolean
37
+ attribute :storage_type, :aliases => 'StorageType'
38
+ attribute :tde_credential_arn, :aliases => 'TdeCredentialArn'
39
+ attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups', :type => :array
33
40
 
34
41
  attr_accessor :password, :parameter_group_name, :security_group_names, :port
35
42
 
@@ -26,7 +26,7 @@ module Fog
26
26
 
27
27
  def end_element(name)
28
28
  case name
29
- when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesId', 'state', 'offeringType'
29
+ when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesId', 'state', 'offeringType', 'instanceTenancy'
30
30
  @reserved_instance[name] = value
31
31
  when 'duration', 'instanceCount'
32
32
  @reserved_instance[name] = value.to_i
@@ -14,7 +14,8 @@ module Fog
14
14
  @cache_cluster = {
15
15
  'CacheSecurityGroups' => [],
16
16
  'CacheNodes' => [],
17
- 'CacheParameterGroup' => {}
17
+ 'CacheParameterGroup' => {},
18
+ 'ConfigurationEndpoint' => {}
18
19
  }
19
20
  end
20
21
 
@@ -24,6 +25,7 @@ module Fog
24
25
  when 'CacheSecurityGroup'; then @security_group = {}
25
26
  when 'CacheNode'; then @cache_node = {}
26
27
  when 'PendingModifiedValues'; then @pending_values = {}
28
+ when 'ConfigurationEndpoint'; then @configuration_endpoint = {}
27
29
  end
28
30
  end
29
31
 
@@ -49,6 +51,8 @@ module Fog
49
51
  @cache_cluster[name] = DateTime.parse(value)
50
52
  when 'CacheSecurityGroup'
51
53
  @cache_cluster["#{name}s"] << @security_group unless @security_group.empty?
54
+ when 'ConfigurationEndpoint'
55
+ @cache_cluster['ConfigurationEndpoint'] = @configuration_endpoint
52
56
  when 'CacheSecurityGroupName', 'Status', 'CacheSubnetGroupName'
53
57
  @cache_cluster[name] = value
54
58
  when 'CacheNode'
@@ -57,8 +61,16 @@ module Fog
57
61
  when'PendingModifiedValues'
58
62
  @cache_cluster[name] = @pending_values
59
63
  @pending_values = nil
60
- when 'CacheNodeCreateTime', 'CacheNodeStatus', 'Address',
61
- 'ParameterGroupStatus', 'Port', 'CacheNodeId'
64
+ when 'Port', 'Address'
65
+ if @cache_node
66
+ @cache_node[name] = value ? value.strip : name
67
+ elsif @pending_values
68
+ @pending_values[name] = value ? value.strip : name
69
+ elsif @configuration_endpoint
70
+ @configuration_endpoint[name] = value ? value.strip : name
71
+ end
72
+ when 'CacheNodeCreateTime', 'CacheNodeStatus',
73
+ 'ParameterGroupStatus', 'CacheNodeId'
62
74
  if @cache_node
63
75
  @cache_node[name] = value ? value.strip : name
64
76
  elsif @pending_values
@@ -0,0 +1,34 @@
1
+ module Fog
2
+ module Parsers
3
+ module AWS
4
+ module KMS
5
+ class DescribeKey < Fog::Parsers::Base
6
+ def reset
7
+ @response = { 'KeyMetadata' => {} }
8
+ end
9
+
10
+ def start_element(name, attrs = [])
11
+ super
12
+ case name
13
+ when 'KeyMetadata'
14
+ @key = {}
15
+ end
16
+ end
17
+
18
+ def end_element(name)
19
+ case name
20
+ when 'KeyUsage', 'AWSAccountId', 'Description', 'KeyId', 'Arn'
21
+ @key[name] = value
22
+ when 'CreationDate'
23
+ @key[name] = Time.parse(value)
24
+ when 'Enabled'
25
+ @key[name] = (value == 'true')
26
+ when 'KeyMetadata'
27
+ @response['KeyMetadata'] = @key
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,38 @@
1
+ module Fog
2
+ module Parsers
3
+ module AWS
4
+ module KMS
5
+ class ListKeys < Fog::Parsers::Base
6
+ def reset
7
+ @response = { 'Keys' => [] }
8
+ end
9
+
10
+ def start_element(name, attrs = [])
11
+ super
12
+ case name
13
+ when 'Keys'
14
+ @keys = []
15
+ when 'member'
16
+ @key = {}
17
+ end
18
+ end
19
+
20
+ def end_element(name)
21
+ case name
22
+ when 'KeyId', 'KeyArn'
23
+ @key[name] = value
24
+ when 'member'
25
+ @keys << @key
26
+ when 'Keys'
27
+ @response['Keys'] = @keys
28
+ when 'Truncated'
29
+ @response['Truncated'] = (value == 'true')
30
+ when 'NextMarker'
31
+ @response['Marker'] = value
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -46,14 +46,12 @@ module Fog
46
46
  when 'Engine', 'DBInstanceStatus', 'DBInstanceIdentifier',
47
47
  'PreferredBackupWindow', 'PreferredMaintenanceWindow',
48
48
  'AvailabilityZone', 'MasterUsername', 'DBName', 'LicenseModel',
49
- 'DBSubnetGroupName', 'StorageType'
49
+ 'DBSubnetGroupName', 'StorageType', 'KmsKeyId', 'TdeCredentialArn',
50
+ 'SecondaryAvailabilityZone', 'DbiResourceId', 'CACertificateIdentifier',
51
+ 'CharacterSetName', 'DbiResourceId', 'LicenseModel', 'KmsKeyId'
50
52
  @db_instance[name] = value
51
- when 'MultiAZ', 'AutoMinorVersionUpgrade', 'PubliclyAccessible'
52
- if value == 'false'
53
- @db_instance[name] = false
54
- else
55
- @db_instance[name] = true
56
- end
53
+ when 'MultiAZ', 'AutoMinorVersionUpgrade', 'PubliclyAccessible', 'StorageEncrypted'
54
+ @db_instance[name] = (value == 'true')
57
55
  when 'DBParameterGroups'
58
56
  @in_db_parameter_groups = false
59
57
  @db_instance['DBParameterGroups'] = @db_parameter_groups
@@ -64,15 +62,14 @@ module Fog
64
62
  if @in_db_parameter_groups
65
63
  @db_parameter_group[name] = value
66
64
  end
67
-
68
- when 'BackupRetentionPeriod'
65
+ when 'BackupRetentionPeriod', 'Iops', 'AllocatedStorage'
69
66
  if @in_pending_modified_values
70
67
  @pending_modified_values[name] = value.to_i
71
68
  else
72
69
  @db_instance[name] = value.to_i
73
70
  end
74
71
  when 'DBInstanceClass', 'EngineVersion', 'MasterUserPassword',
75
- 'MultiAZ', 'Iops', 'AllocatedStorage'
72
+ 'MultiAZ'
76
73
  if @in_pending_modified_values
77
74
  @pending_modified_values[name] = value
78
75
  else
@@ -86,7 +83,6 @@ module Fog
86
83
  when 'DBSecurityGroup'
87
84
  @db_security_groups << @db_security_group
88
85
  @db_security_group = {}
89
-
90
86
  when 'VpcSecurityGroups'
91
87
  @in_vpc_security_groups = false
92
88
  @db_instance['VpcSecurityGroups'] = @vpc_security_groups
@@ -95,7 +91,6 @@ module Fog
95
91
  @vpc_security_group = {}
96
92
  when 'VpcSecurityGroupId'
97
93
  @vpc_security_group[name] = value
98
-
99
94
  when 'Status'
100
95
  # Unfortunately, status is used in VpcSecurityGroupMemebership and
101
96
  # DBSecurityGroups
@@ -105,7 +100,6 @@ module Fog
105
100
  if @in_vpc_security_groups
106
101
  @vpc_security_group[name] = value
107
102
  end
108
-
109
103
  when 'Address'
110
104
  @endpoint[name] = value
111
105
  when 'Port'
@@ -114,7 +108,6 @@ module Fog
114
108
  elsif @in_endpoint
115
109
  @endpoint[name] = value.to_i
116
110
  end
117
-
118
111
  when 'PendingModifiedValues'
119
112
  @in_pending_modified_values = false
120
113
  @db_instance['PendingModifiedValues'] = @pending_modified_values
@@ -197,7 +197,7 @@ module Fog
197
197
  @port = options[:port] || 443
198
198
  @scheme = options[:scheme] || 'https'
199
199
  @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
200
- @version = options[:version] || '2013-05-15'
200
+ @version = options[:version] || '2014-10-31'
201
201
 
202
202
  setup_credentials(options)
203
203
  end
@@ -56,6 +56,65 @@ module Fog
56
56
  }.merge!(params))
57
57
  end
58
58
  end
59
+
60
+ class Mock
61
+ def describe_spot_price_history(filters = {})
62
+ params = {}
63
+ spot_price_history_set = []
64
+
65
+ response = Excon::Response.new
66
+ response.status = 200
67
+
68
+ for key in %w(StartTime EndTime NextToken)
69
+ if filters.is_a?(Hash) && filters.key?(key)
70
+ Fog::Logger.warning("#{key} filters are not yet mocked [light_black](#{caller.first})[/]")
71
+ Fog::Mock.not_implemented
72
+ end
73
+ end
74
+
75
+ for key in %w(AvailabilityZone MaxResults)
76
+ if filters.is_a?(Hash) && filters.key?(key)
77
+ params[key] = filters.delete(key)
78
+ end
79
+ end
80
+
81
+ all_zones = describe_availability_zones.body['availabilityZoneInfo'].map { |z| z['zoneName'] }
82
+ zones = params['AvailabilityZone']
83
+ if (!zones.nil? && !all_zones.include?([*zones].shuffle.first))
84
+ az_error = "InvalidParameterValue => Invalid availability zone: [#{zones}]"
85
+ raise Fog::Compute::AWS::Error, az_error
86
+ end
87
+ zones = all_zones if zones.nil?
88
+
89
+ max_results = params['MaxResults'] || Fog::Mock.random_numbers(3).to_i
90
+ if !(max_results.is_a?(Integer) && max_results > 0)
91
+ max_results_error = "InvalidParameterValue => Invalid value '#{max_results}' for maxResults"
92
+ raise Fog::Compute::AWS::Error, max_results_error
93
+ end
94
+
95
+ all_instance_types = flavors.map { |f| f.id }
96
+ instance_types = filters.delete('InstanceType') || all_instance_types
97
+ product_descriptions = filters.delete('ProductDescription') || Fog::AWS::Mock.spot_product_descriptions
98
+
99
+ max_results.times do
100
+ spot_price_history_set << {
101
+ 'instanceType' => [*instance_types].shuffle.first,
102
+ 'productDescription' => [*product_descriptions].shuffle.first,
103
+ 'spotPrice' => ((rand + [0 , 1].shuffle.first) * 10000).round / 10000.0,
104
+ 'timestamp' => Time.now - (1 + rand(86400)),
105
+ 'availabilityZone' => [*zones].shuffle.first
106
+ }
107
+ end
108
+ spot_price_history_set.sort! { |x,y| x['timestamp'] <=> y['timestamp'] }
109
+
110
+ response.body = {
111
+ 'spotPriceHistorySet' => spot_price_history_set,
112
+ 'requestId' => Fog::AWS::Mock.request_id,
113
+ 'nextToken' => nil
114
+ }
115
+ response
116
+ end
117
+ end
59
118
  end
60
119
  end
61
120
  end
@@ -91,6 +91,86 @@ module Fog
91
91
  }.merge!(options))
92
92
  end
93
93
  end
94
+
95
+ class Mock
96
+ def request_spot_instances(image_id, instance_type, spot_price, options = {})
97
+ response = Excon::Response.new
98
+
99
+ if (image_id && instance_type && spot_price)
100
+ response.status = 200
101
+
102
+ all_instance_types = flavors.map { |f| f.id }
103
+ if !all_instance_types.include?(instance_type)
104
+ message = "InvalidParameterValue => Invalid value '#{instance_type}' for InstanceType."
105
+ raise Fog::Compute::AWS::Error.new(message)
106
+ end
107
+
108
+ spot_price = spot_price.to_f
109
+ if !(spot_price > 0)
110
+ message = "InvalidParameterValue => Value (#{spot_price}) for parameter price is invalid."
111
+ message << " \"#{spot_price}\" is an invalid spot instance price"
112
+ raise Fog::Compute::AWS::Error.new(message)
113
+ end
114
+
115
+ if !image_id.match(/^ami-[a-f0-9]{8}$/)
116
+ message = "The image id '[#{image_id}]' does not exist"
117
+ raise Fog::Compute::AWS::NotFound.new(message)
118
+ end
119
+
120
+ else
121
+ message = 'MissingParameter => '
122
+ message << 'The request must contain the parameter '
123
+ if !image_id
124
+ message << 'image_id'
125
+ elsif !instance_type
126
+ message << 'instance_type'
127
+ else
128
+ message << 'spot_price'
129
+ end
130
+ raise Fog::Compute::AWS::Error.new(message)
131
+ end
132
+
133
+ for key in %w(AvailabilityZoneGroup LaunchGroup)
134
+ if options.is_a?(Hash) && options.key?(key)
135
+ Fog::Logger.warning("#{key} filters are not yet mocked [light_black](#{caller.first})[/]")
136
+ Fog::Mock.not_implemented
137
+ end
138
+ end
139
+
140
+ launch_spec = {
141
+ 'iamInstanceProfile' => {},
142
+ 'blockDeviceMapping' => [],
143
+ 'groupSet' => [Fog::AWS::Mock.security_group_id],
144
+ 'imageId' => image_id,
145
+ 'instanceType' => instance_type,
146
+ 'monitoring' => options['MonitoringEnabled'] || false,
147
+ 'subnetId' => nil,
148
+ 'ebsOptimized' => false,
149
+ 'keyName' => options['KeyName'] || nil
150
+ }
151
+
152
+ response.body = {
153
+ 'spotInstanceRequestSet' => [
154
+ {
155
+ 'launchSpecification' => launch_spec,
156
+ 'spotInstanceRequestId' => Fog::AWS::Mock.spot_instance_request_id,
157
+ 'spotPrice' => spot_price,
158
+ 'type' => options['Type'] || 'one-time',
159
+ 'state' => 'open',
160
+ 'fault' => {
161
+ 'code' => 'pending-evaluation',
162
+ 'message' => 'Your Spot request has been submitted for review, and is pending evaluation.'
163
+ },
164
+ 'createTime' => Time.now,
165
+ 'productDescription' => 'Linux/UNIX'
166
+ }
167
+ ],
168
+ 'requestId' => Fog::AWS::Mock.request_id
169
+ }
170
+
171
+ response
172
+ end
173
+ end
94
174
  end
95
175
  end
96
176
  end