fog-aws 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fog/aws.rb +205 -28
  3. data/lib/fog/aws/auto_scaling.rb +0 -2
  4. data/lib/fog/aws/beanstalk.rb +0 -2
  5. data/lib/fog/aws/cdn.rb +0 -2
  6. data/lib/fog/aws/cloud_formation.rb +0 -2
  7. data/lib/fog/aws/cloud_watch.rb +0 -2
  8. data/lib/fog/aws/compute.rb +0 -2
  9. data/lib/fog/aws/credential_fetcher.rb +0 -2
  10. data/lib/fog/aws/data_pipeline.rb +0 -2
  11. data/lib/fog/aws/dns.rb +0 -2
  12. data/lib/fog/aws/dynamodb.rb +0 -2
  13. data/lib/fog/aws/elasticache.rb +0 -2
  14. data/lib/fog/aws/elb.rb +0 -2
  15. data/lib/fog/aws/emr.rb +0 -2
  16. data/lib/fog/aws/errors.rb +14 -0
  17. data/lib/fog/aws/federation.rb +0 -2
  18. data/lib/fog/aws/glacier.rb +0 -2
  19. data/lib/fog/aws/iam.rb +0 -2
  20. data/lib/fog/aws/mock.rb +170 -0
  21. data/lib/fog/aws/models/auto_scaling/activity.rb +0 -2
  22. data/lib/fog/aws/models/auto_scaling/configuration.rb +0 -2
  23. data/lib/fog/aws/models/auto_scaling/group.rb +0 -2
  24. data/lib/fog/aws/models/auto_scaling/instance.rb +0 -2
  25. data/lib/fog/aws/models/auto_scaling/policy.rb +0 -2
  26. data/lib/fog/aws/models/beanstalk/application.rb +0 -2
  27. data/lib/fog/aws/models/beanstalk/applications.rb +0 -1
  28. data/lib/fog/aws/models/beanstalk/environment.rb +0 -2
  29. data/lib/fog/aws/models/beanstalk/environments.rb +0 -1
  30. data/lib/fog/aws/models/beanstalk/event.rb +0 -2
  31. data/lib/fog/aws/models/beanstalk/events.rb +0 -1
  32. data/lib/fog/aws/models/beanstalk/template.rb +0 -2
  33. data/lib/fog/aws/models/beanstalk/templates.rb +0 -1
  34. data/lib/fog/aws/models/beanstalk/version.rb +0 -2
  35. data/lib/fog/aws/models/beanstalk/versions.rb +0 -1
  36. data/lib/fog/aws/models/cdn/distribution.rb +0 -1
  37. data/lib/fog/aws/models/cdn/distribution_helper.rb +0 -2
  38. data/lib/fog/aws/models/cdn/distributions.rb +0 -1
  39. data/lib/fog/aws/models/cdn/distributions_helper.rb +0 -2
  40. data/lib/fog/aws/models/cdn/invalidation.rb +0 -2
  41. data/lib/fog/aws/models/cdn/invalidations.rb +0 -1
  42. data/lib/fog/aws/models/cdn/streaming_distribution.rb +0 -1
  43. data/lib/fog/aws/models/cdn/streaming_distributions.rb +0 -1
  44. data/lib/fog/aws/models/cloud_watch/alarm.rb +0 -2
  45. data/lib/fog/aws/models/cloud_watch/alarm_data.rb +0 -1
  46. data/lib/fog/aws/models/cloud_watch/alarm_datum.rb +0 -2
  47. data/lib/fog/aws/models/cloud_watch/alarm_histories.rb +0 -1
  48. data/lib/fog/aws/models/cloud_watch/alarm_history.rb +0 -2
  49. data/lib/fog/aws/models/cloud_watch/alarms.rb +0 -1
  50. data/lib/fog/aws/models/cloud_watch/metric.rb +0 -2
  51. data/lib/fog/aws/models/cloud_watch/metric_statistic.rb +0 -2
  52. data/lib/fog/aws/models/cloud_watch/metric_statistics.rb +0 -1
  53. data/lib/fog/aws/models/cloud_watch/metrics.rb +0 -1
  54. data/lib/fog/aws/models/compute/address.rb +0 -2
  55. data/lib/fog/aws/models/compute/addresses.rb +0 -1
  56. data/lib/fog/aws/models/compute/dhcp_option.rb +0 -2
  57. data/lib/fog/aws/models/compute/dhcp_options.rb +0 -1
  58. data/lib/fog/aws/models/compute/flavor.rb +0 -2
  59. data/lib/fog/aws/models/compute/flavors.rb +0 -1
  60. data/lib/fog/aws/models/compute/image.rb +0 -2
  61. data/lib/fog/aws/models/compute/images.rb +0 -1
  62. data/lib/fog/aws/models/compute/internet_gateway.rb +0 -2
  63. data/lib/fog/aws/models/compute/internet_gateways.rb +0 -1
  64. data/lib/fog/aws/models/compute/key_pair.rb +0 -2
  65. data/lib/fog/aws/models/compute/key_pairs.rb +0 -1
  66. data/lib/fog/aws/models/compute/network_acl.rb +0 -2
  67. data/lib/fog/aws/models/compute/network_acls.rb +0 -1
  68. data/lib/fog/aws/models/compute/network_interface.rb +0 -2
  69. data/lib/fog/aws/models/compute/network_interfaces.rb +0 -1
  70. data/lib/fog/aws/models/compute/route_table.rb +0 -2
  71. data/lib/fog/aws/models/compute/route_tables.rb +0 -1
  72. data/lib/fog/aws/models/compute/security_group.rb +0 -2
  73. data/lib/fog/aws/models/compute/security_groups.rb +0 -1
  74. data/lib/fog/aws/models/compute/servers.rb +1 -2
  75. data/lib/fog/aws/models/compute/snapshot.rb +0 -2
  76. data/lib/fog/aws/models/compute/snapshots.rb +0 -1
  77. data/lib/fog/aws/models/compute/spot_requests.rb +0 -1
  78. data/lib/fog/aws/models/compute/subnet.rb +0 -2
  79. data/lib/fog/aws/models/compute/subnets.rb +0 -1
  80. data/lib/fog/aws/models/compute/tag.rb +0 -2
  81. data/lib/fog/aws/models/compute/tags.rb +0 -1
  82. data/lib/fog/aws/models/compute/volume.rb +0 -2
  83. data/lib/fog/aws/models/compute/volumes.rb +0 -1
  84. data/lib/fog/aws/models/compute/vpc.rb +0 -2
  85. data/lib/fog/aws/models/compute/vpcs.rb +0 -1
  86. data/lib/fog/aws/models/data_pipeline/pipeline.rb +0 -2
  87. data/lib/fog/aws/models/data_pipeline/pipelines.rb +0 -1
  88. data/lib/fog/aws/models/dns/record.rb +0 -2
  89. data/lib/fog/aws/models/dns/records.rb +0 -1
  90. data/lib/fog/aws/models/dns/zone.rb +0 -1
  91. data/lib/fog/aws/models/dns/zones.rb +0 -1
  92. data/lib/fog/aws/models/elasticache/cluster.rb +0 -2
  93. data/lib/fog/aws/models/elasticache/clusters.rb +0 -1
  94. data/lib/fog/aws/models/elasticache/parameter_group.rb +0 -2
  95. data/lib/fog/aws/models/elasticache/parameter_groups.rb +0 -1
  96. data/lib/fog/aws/models/elasticache/security_group.rb +0 -2
  97. data/lib/fog/aws/models/elasticache/security_groups.rb +0 -1
  98. data/lib/fog/aws/models/elasticache/subnet_group.rb +0 -2
  99. data/lib/fog/aws/models/elasticache/subnet_groups.rb +0 -1
  100. data/lib/fog/aws/models/elb/backend_server_description.rb +0 -1
  101. data/lib/fog/aws/models/elb/listener.rb +0 -1
  102. data/lib/fog/aws/models/elb/load_balancer.rb +0 -1
  103. data/lib/fog/aws/models/elb/policy.rb +0 -1
  104. data/lib/fog/aws/models/glacier/archive.rb +0 -2
  105. data/lib/fog/aws/models/glacier/archives.rb +0 -1
  106. data/lib/fog/aws/models/glacier/job.rb +0 -2
  107. data/lib/fog/aws/models/glacier/jobs.rb +0 -1
  108. data/lib/fog/aws/models/glacier/vault.rb +0 -1
  109. data/lib/fog/aws/models/glacier/vaults.rb +0 -1
  110. data/lib/fog/aws/models/iam/access_key.rb +0 -2
  111. data/lib/fog/aws/models/iam/access_keys.rb +0 -1
  112. data/lib/fog/aws/models/iam/policies.rb +0 -1
  113. data/lib/fog/aws/models/iam/policy.rb +0 -2
  114. data/lib/fog/aws/models/iam/role.rb +0 -2
  115. data/lib/fog/aws/models/iam/roles.rb +0 -1
  116. data/lib/fog/aws/models/iam/user.rb +0 -2
  117. data/lib/fog/aws/models/iam/users.rb +0 -1
  118. data/lib/fog/aws/models/rds/event_subscription.rb +0 -2
  119. data/lib/fog/aws/models/rds/event_subscriptions.rb +0 -1
  120. data/lib/fog/aws/models/rds/instance_option.rb +0 -2
  121. data/lib/fog/aws/models/rds/instance_options.rb +0 -1
  122. data/lib/fog/aws/models/rds/log_file.rb +0 -2
  123. data/lib/fog/aws/models/rds/log_files.rb +0 -1
  124. data/lib/fog/aws/models/rds/parameter.rb +0 -2
  125. data/lib/fog/aws/models/rds/parameter_group.rb +0 -2
  126. data/lib/fog/aws/models/rds/parameter_groups.rb +0 -1
  127. data/lib/fog/aws/models/rds/parameters.rb +0 -1
  128. data/lib/fog/aws/models/rds/security_group.rb +0 -3
  129. data/lib/fog/aws/models/rds/security_groups.rb +0 -1
  130. data/lib/fog/aws/models/rds/server.rb +0 -2
  131. data/lib/fog/aws/models/rds/servers.rb +0 -1
  132. data/lib/fog/aws/models/rds/snapshot.rb +0 -2
  133. data/lib/fog/aws/models/rds/snapshots.rb +0 -1
  134. data/lib/fog/aws/models/rds/subnet_group.rb +0 -2
  135. data/lib/fog/aws/models/rds/subnet_groups.rb +0 -1
  136. data/lib/fog/aws/models/sns/subscriptions.rb +0 -1
  137. data/lib/fog/aws/models/sns/topic.rb +0 -2
  138. data/lib/fog/aws/models/sns/topics.rb +0 -1
  139. data/lib/fog/aws/models/storage/directories.rb +0 -1
  140. data/lib/fog/aws/models/storage/directory.rb +0 -1
  141. data/lib/fog/aws/models/storage/file.rb +8 -5
  142. data/lib/fog/aws/models/storage/files.rb +0 -1
  143. data/lib/fog/aws/models/storage/version.rb +0 -2
  144. data/lib/fog/aws/models/storage/versions.rb +0 -1
  145. data/lib/fog/aws/parsers/compute/associate_route_table.rb +0 -0
  146. data/lib/fog/aws/parsers/compute/create_route_table.rb +0 -0
  147. data/lib/fog/aws/parsers/compute/describe_route_tables.rb +0 -0
  148. data/lib/fog/aws/parsers/compute/describe_spot_price_history.rb +1 -1
  149. data/lib/fog/aws/rds.rb +16 -2
  150. data/lib/fog/aws/redshift.rb +0 -2
  151. data/lib/fog/aws/requests/compute/associate_route_table.rb +0 -0
  152. data/lib/fog/aws/requests/compute/create_route.rb +0 -0
  153. data/lib/fog/aws/requests/compute/create_route_table.rb +0 -0
  154. data/lib/fog/aws/requests/compute/delete_route.rb +0 -0
  155. data/lib/fog/aws/requests/compute/delete_route_table.rb +0 -0
  156. data/lib/fog/aws/requests/compute/describe_availability_zones.rb +3 -0
  157. data/lib/fog/aws/requests/compute/describe_route_tables.rb +0 -0
  158. data/lib/fog/aws/requests/compute/describe_spot_price_history.rb +27 -1
  159. data/lib/fog/aws/requests/compute/disassociate_route_table.rb +0 -0
  160. data/lib/fog/aws/requests/compute/replace_route.rb +0 -0
  161. data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +3 -2
  162. data/lib/fog/aws/requests/rds/create_db_snapshot.rb +1 -0
  163. data/lib/fog/aws/requests/rds/delete_db_instance.rb +20 -14
  164. data/lib/fog/aws/requests/rds/describe_db_engine_versions.rb +8 -1
  165. data/lib/fog/aws/requests/rds/describe_db_instances.rb +2 -3
  166. data/lib/fog/aws/requests/storage/post_object_hidden_fields.rb +9 -3
  167. data/lib/fog/aws/ses.rb +0 -2
  168. data/lib/fog/aws/signaturev4.rb +2 -3
  169. data/lib/fog/aws/simpledb.rb +0 -2
  170. data/lib/fog/aws/sns.rb +0 -2
  171. data/lib/fog/aws/sqs.rb +0 -2
  172. data/lib/fog/aws/storage.rb +27 -17
  173. data/lib/fog/aws/sts.rb +0 -2
  174. data/lib/fog/aws/version.rb +1 -1
  175. data/tests/models/rds/server_tests.rb +4 -3
  176. data/tests/requests/compute/spot_price_history_tests.rb +2 -1
  177. data/tests/requests/dns/change_resource_record_sets_tests.rb +10 -0
  178. data/tests/requests/rds/db_engine_versions.rb +7 -0
  179. data/tests/requests/rds/helper.rb +14 -0
  180. metadata +6 -5
  181. data/lib/fog/aws/core.rb +0 -344
  182. data/lib/fog/aws/parsers/.DS_Store +0 -0
  183. data/lib/fog/aws/requests/.DS_Store +0 -0
@@ -8,6 +8,14 @@ module Fog
8
8
  #
9
9
  # ==== Parameters
10
10
  # * filters<~Hash> - List of filters to limit results with
11
+ # * filters and/or the following
12
+ # * 'AvailabilityZone'<~String> - availability zone of offering
13
+ # * 'InstanceType'<~Array> - instance types of offering
14
+ # * 'ProductDescription'<~Array> - basic product descriptions
15
+ # * 'StartTime'<~Time> - The date and time, up to the past 90 days, from which to start retrieving the price history data
16
+ # * 'EndTime'<~Time> - The date and time, up to the current date, from which to stop retrieving the price history data
17
+ # * 'MaxResults'<~Integer> - The maximum number of results to return for the request in a single page
18
+ # * 'NextToken'<~String> - The token to retrieve the next page of results
11
19
  #
12
20
  # ==== Returns
13
21
  # * response<~Excon::Response>:
@@ -19,10 +27,28 @@ module Fog
19
27
  # * 'productDescription'<~String> - general description of AMI
20
28
  # * 'spotPrice'<~Float> - maximum price to launch one or more instances
21
29
  # * 'timestamp'<~Time> - date and time of request creation
30
+ # * 'nextToken'<~String> - token to retrieve the next page of results
22
31
  #
23
32
  # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSpotPriceHistory.html]
24
33
  def describe_spot_price_history(filters = {})
25
- params = Fog::AWS.indexed_filters(filters)
34
+ params = {}
35
+
36
+ for key in %w(AvailabilityZone StartTime EndTime MaxResults NextToken)
37
+ if filters.is_a?(Hash) && filters.key?(key)
38
+ params[key] = filters.delete(key)
39
+ end
40
+ end
41
+
42
+ if instance_types = filters.delete('InstanceType')
43
+ params.merge!(Fog::AWS.indexed_param('InstanceType', [*instance_types]))
44
+ end
45
+
46
+ if product_descriptions = filters.delete('ProductDescription')
47
+ params.merge!(Fog::AWS.indexed_param('ProductDescription', [*product_descriptions]))
48
+ end
49
+
50
+ params.merge!(Fog::AWS.indexed_filters(filters))
51
+
26
52
  request({
27
53
  'Action' => 'DescribeSpotPriceHistory',
28
54
  :idempotent => true,
@@ -222,9 +222,9 @@ module Fog
222
222
  end
223
223
 
224
224
  def self.hosted_zone_for_alias_target(dns_name)
225
- elb_hosted_zone_mapping.select { |k, _|
225
+ Hash[elb_hosted_zone_mapping.select { |k, _|
226
226
  dns_name =~ /\A.+\.#{k}\.elb\.amazonaws\.com\.?\z/
227
- }.last
227
+ }].values.last
228
228
  end
229
229
 
230
230
  def self.elb_hosted_zone_mapping
@@ -233,6 +233,7 @@ module Fog
233
233
  "ap-southeast-1" => "Z1WI8VXHPB1R38",
234
234
  "ap-southeast-2" => "Z2999QAZ9SRTIC",
235
235
  "eu-west-1" => "Z3NF1Z3NOM5OY2",
236
+ "eu-central-1" => "Z215JYRZR1TBD5",
236
237
  "sa-east-1" => "Z2ES78Y61JGQKS",
237
238
  "us-east-1" => "Z3DZXE0Q79N41H",
238
239
  "us-west-1" => "Z1M58G0W56PQJA",
@@ -30,6 +30,7 @@ module Fog
30
30
  end
31
31
 
32
32
  server_data = data[:servers][identifier]
33
+
33
34
  unless server_data
34
35
  raise Fog::AWS::RDS::NotFound.new("DBInstance #{identifier} not found")
35
36
  end
@@ -18,10 +18,10 @@ module Fog
18
18
  params = {}
19
19
  params['FinalDBSnapshotIdentifier'] = snapshot_identifier if snapshot_identifier
20
20
  request({
21
- 'Action' => 'DeleteDBInstance',
21
+ 'Action' => 'DeleteDBInstance',
22
22
  'DBInstanceIdentifier' => identifier,
23
- 'SkipFinalSnapshot' => skip_snapshot,
24
- :parser => Fog::Parsers::AWS::RDS::DeleteDBInstance.new
23
+ 'SkipFinalSnapshot' => skip_snapshot,
24
+ :parser => Fog::Parsers::AWS::RDS::DeleteDBInstance.new
25
25
  }.merge(params))
26
26
  end
27
27
  end
@@ -30,20 +30,26 @@ module Fog
30
30
  def delete_db_instance(identifier, snapshot_identifier, skip_snapshot = false)
31
31
  response = Excon::Response.new
32
32
 
33
+
34
+ server_set = self.data[:servers][identifier] ||
35
+ raise(Fog::AWS::RDS::NotFound.new("DBInstance #{identifier} not found"))
36
+
33
37
  unless skip_snapshot
34
- create_db_snapshot(identifier, snapshot_identifier)
38
+ if server_set["ReadReplicaSourceDBInstanceIdentifier"]
39
+ raise Fog::AWS::RDS::Error.new("InvalidParameterCombination => FinalDBSnapshotIdentifier can not be specified when deleting a replica instance")
40
+ else
41
+ create_db_snapshot(identifier, snapshot_identifier)
42
+ end
35
43
  end
36
44
 
37
- if server_set = self.data[:servers].delete(identifier)
38
- response.status = 200
39
- response.body = {
40
- "ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id },
41
- "DeleteDBInstanceResult" => { "DBInstance" => server_set }
42
- }
43
- response
44
- else
45
- raise Fog::AWS::RDS::NotFound.new("DBInstance #{identifier} not found")
46
- end
45
+ self.data[:servers].delete(identifier)
46
+
47
+ response.status = 200
48
+ response.body = {
49
+ "ResponseMetadata" => { "RequestId" => Fog::AWS::Mock.request_id },
50
+ "DeleteDBInstanceResult" => { "DBInstance" => server_set }
51
+ }
52
+ response
47
53
  end
48
54
  end
49
55
  end
@@ -22,7 +22,14 @@ module Fog
22
22
 
23
23
  class Mock
24
24
  def describe_db_engine_versions(opts={})
25
- Fog::Mock.not_implemented
25
+ response = Excon::Response.new
26
+
27
+ response.status = 200
28
+ response.body = {
29
+ "ResponseMetadata" => { "RequestId" => Fog::AWS::Mock.request_id },
30
+ "DescribeDBEngineVersionsResult" => { "DBEngineVersions" => self.data[:db_engine_versions] }
31
+ }
32
+ response
26
33
  end
27
34
  end
28
35
  end
@@ -33,8 +33,8 @@ module Fog
33
33
  response = Excon::Response.new
34
34
  server_set = []
35
35
  if identifier
36
- if server = self.data[:servers][identifier]
37
- server_set << server
36
+ if specified_server = self.data[:servers][identifier]
37
+ server_set << specified_server
38
38
  else
39
39
  raise Fog::AWS::RDS::NotFound.new("DBInstance #{identifier} not found")
40
40
  end
@@ -46,7 +46,6 @@ module Fog
46
46
  case server["DBInstanceStatus"]
47
47
  when "creating"
48
48
  if Time.now - server['InstanceCreateTime'] >= Fog::Mock.delay * 2
49
- region = "us-east-1"
50
49
  server["DBInstanceStatus"] = "available"
51
50
  server["AvailabilityZone"] ||= region + 'a'
52
51
  server["Endpoint"] = {"Port"=>3306,
@@ -1,7 +1,7 @@
1
1
  module Fog
2
2
  module Storage
3
3
  class AWS
4
- class Real
4
+ module PostObjectHiddenFields
5
5
  # Get a hash of hidden fields for form uploading to S3, in the form {:field_name => :field_value}
6
6
  # Form should look like: <form action="http://#{bucket_name}.s3.amazonaws.com/" method="post" enctype="multipart/form-data">
7
7
  # These hidden fields should then appear, followed by a field named 'file' which is either a textarea or file input.
@@ -42,13 +42,19 @@ module Fog
42
42
  options['X-Amz-Date'] = date.to_iso8601_basic
43
43
  options['X-Amz-Algorithm'] = Fog::AWS::SignatureV4::ALGORITHM
44
44
  if @aws_session_token
45
- options['X-Amz-Security-Token'] = @aws_session_token
45
+ options['X-Amz-Security-Token'] = @aws_session_token
46
46
  end
47
47
  options['X-Amz-Signature'] = @signer.derived_hmac(date).sign(options['policy']).unpack('H*').first
48
48
  end
49
- options
49
+ options
50
50
  end
51
51
  end
52
+ class Real
53
+ include PostObjectHiddenFields
54
+ end
55
+ class Mock
56
+ include PostObjectHiddenFields
57
+ end
52
58
  end
53
59
  end
54
60
  end
@@ -1,5 +1,3 @@
1
- require 'fog/aws/core'
2
-
3
1
  module Fog
4
2
  module AWS
5
3
  class SES < Fog::Service
@@ -1,10 +1,10 @@
1
- require 'fog/aws/core'
2
-
3
1
  # See http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html
2
+
4
3
  module Fog
5
4
  module AWS
6
5
  class SignatureV4
7
6
  ALGORITHM = 'AWS4-HMAC-SHA256'
7
+
8
8
  def initialize(aws_access_key_id, secret_key, region, service)
9
9
  @region = region
10
10
  @service = service
@@ -115,7 +115,6 @@ DATA
115
115
  def signed_headers(headers)
116
116
  headers.keys.map {|key| key.to_s.downcase}.sort.join(';')
117
117
  end
118
-
119
118
  end
120
119
  end
121
120
  end
@@ -1,5 +1,3 @@
1
- require 'fog/aws/core'
2
-
3
1
  module Fog
4
2
  module AWS
5
3
  class SimpleDB < Fog::Service
@@ -1,5 +1,3 @@
1
- require 'fog/aws/core'
2
-
3
1
  module Fog
4
2
  module AWS
5
3
  class SNS < Fog::Service
@@ -1,5 +1,3 @@
1
- require 'fog/aws/core'
2
-
3
1
  module Fog
4
2
  module AWS
5
3
  class SQS < Fog::Service
@@ -1,5 +1,3 @@
1
- require 'fog/aws/core'
2
-
3
1
  module Fog
4
2
  module Storage
5
3
  class AWS < Fog::Service
@@ -256,21 +254,25 @@ module Fog
256
254
  if params[:bucket_name]
257
255
  bucket_name = params[:bucket_name]
258
256
 
259
- path_style = params.fetch(:path_style, @path_style)
260
- if !path_style
261
- if COMPLIANT_BUCKET_NAMES !~ bucket_name
262
- Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
263
- path_style = true
264
- elsif scheme == 'https' && !path_style && bucket_name =~ /\./
265
- Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
266
- path_style = true
257
+ if params[:bucket_cname]
258
+ host = bucket_name
259
+ else
260
+ path_style = params.fetch(:path_style, @path_style)
261
+ if !path_style
262
+ if COMPLIANT_BUCKET_NAMES !~ bucket_name
263
+ Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
264
+ path_style = true
265
+ elsif scheme == 'https' && !path_style && bucket_name =~ /\./
266
+ Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
267
+ path_style = true
268
+ end
267
269
  end
268
- end
269
270
 
270
- if path_style
271
- path = bucket_to_path bucket_name, path
272
- else
273
- host = [bucket_name, host].join('.')
271
+ if path_style
272
+ path = bucket_to_path bucket_name, path
273
+ else
274
+ host = [bucket_name, host].join('.')
275
+ end
274
276
  end
275
277
  end
276
278
 
@@ -532,6 +534,7 @@ module Fog
532
534
  date = Fog::Time.now
533
535
 
534
536
  params = params.dup
537
+ stringify_query_keys(params)
535
538
  params[:headers] = (params[:headers] || {}).dup
536
539
 
537
540
  params[:headers]['x-amz-security-token'] = @aws_session_token if @aws_session_token
@@ -556,9 +559,12 @@ module Fog
556
559
  params[:headers]['x-amz-content-sha256'] = 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD'
557
560
  params[:headers]['x-amz-decoded-content-length'] = params[:headers].delete 'Content-Length'
558
561
 
559
- encoding = "aws-chunked"
562
+ if params[:headers]['Content-Encoding']
563
+ encoding = "aws-chunked, #{params[:headers]['Content-Encoding']}"
564
+ else
565
+ encoding = "aws-chunked, identity"
566
+ end
560
567
 
561
- encoding += ", #{params[:headers]['Content-Encoding']}" if params[:headers]['Content-Encoding']
562
568
  params[:headers]['Content-Encoding'] = encoding
563
569
  else
564
570
  params[:headers]['x-amz-content-sha256'] ||= Digest::SHA256.hexdigest(params[:body] || '')
@@ -729,6 +735,10 @@ DATA
729
735
  signed_string = @hmac.sign(string_to_sign)
730
736
  Base64.encode64(signed_string).chomp!
731
737
  end
738
+
739
+ def stringify_query_keys(params)
740
+ params[:query] = Hash[params[:query].map { |k,v| [k.to_s, v] }] if params[:query]
741
+ end
732
742
  end
733
743
  end
734
744
  end
@@ -1,5 +1,3 @@
1
- require 'fog/aws/core'
2
-
3
1
  module Fog
4
2
  module AWS
5
3
  class STS < Fog::Service
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -1,7 +1,4 @@
1
1
  Shindo.tests("AWS::RDS | server", ['aws', 'rds']) do
2
- # Disabled due to https://github.com/fog/fog/1546
3
- pending
4
-
5
2
  model_tests(Fog::AWS[:rds].servers, rds_default_server_params) do
6
3
  # We'll need this later; create it early to avoid waiting
7
4
  @instance_with_final_snapshot = Fog::AWS[:rds].servers.create(rds_default_server_params.merge(:id => uniq_id("fog-snapshot-test"), :backup_retention_period => 1))
@@ -89,6 +86,10 @@ Shindo.tests("AWS::RDS | server", ['aws', 'rds']) do
89
86
  returns(@instance_with_final_snapshot.id) { replica.read_replica_source }
90
87
 
91
88
  replica.wait_for { ready? }
89
+
90
+ # FinalDBSnapshotIdentifier can not be specified when deleting a replica instance
91
+ raises(Fog::AWS::RDS::Error) { replica.destroy("foobar") }
92
+
92
93
  replica.destroy
93
94
  end
94
95
 
@@ -8,7 +8,8 @@ Shindo.tests('Fog::Compute[:aws] | spot price history requests', ['aws']) do
8
8
  'productDescription' => String,
9
9
  'timestamp' => Time
10
10
  }],
11
- 'requestId' => String
11
+ 'requestId' => String,
12
+ 'nextToken' => Fog::Nullable::String
12
13
  }
13
14
 
14
15
  tests('success') do
@@ -0,0 +1,10 @@
1
+ Shindo.tests('Fog::DNS[:aws] | change_resource_record_sets', ['aws', 'dns']) do
2
+ @r53_connection = Fog::DNS[:aws]
3
+
4
+ tests('success') do
5
+ test('#elb_hosted_zone_mapping from DNS name') do
6
+ zone_id = Fog::DNS::AWS.hosted_zone_for_alias_target('arbitrary-sub-domain.eu-west-1.elb.amazonaws.com')
7
+ zone_id == Fog::DNS::AWS.elb_hosted_zone_mapping['eu-west-1']
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ Shindo.tests('AWS::RDS | describe db engine versions', ['aws', 'rds']) do
2
+ tests('success') do
3
+ tests("#describe_db_engine_versions").formats(AWS::RDS::Formats::DB_ENGINE_VERSIONS_LIST) do
4
+ Fog::AWS[:rds].describe_db_engine_versions.body
5
+ end
6
+ end
7
+ end
@@ -291,6 +291,20 @@ class AWS
291
291
  'EventSubscriptionsList' => [EVENT_SUBSCRIPTION]
292
292
  }
293
293
  }
294
+
295
+ DB_ENGINE_VERSION = {
296
+ 'Engine' => String,
297
+ 'DBParameterGroupFamily' => String,
298
+ 'DBEngineDescription' => String,
299
+ 'EngineVersion' => String,
300
+ 'DBEngineVersionDescription' => String
301
+ }
302
+
303
+ DB_ENGINE_VERSIONS_LIST = BASIC.merge(
304
+ 'DescribeDBEngineVersionsResult' => {
305
+ 'DBEngineVersions' => [DB_ENGINE_VERSION]
306
+ }
307
+ )
294
308
  end
295
309
  end
296
310
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-25 00:00:00.000000000 Z
12
+ date: 2015-04-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -137,7 +137,6 @@ files:
137
137
  - lib/fog/aws/cloud_formation.rb
138
138
  - lib/fog/aws/cloud_watch.rb
139
139
  - lib/fog/aws/compute.rb
140
- - lib/fog/aws/core.rb
141
140
  - lib/fog/aws/credential_fetcher.rb
142
141
  - lib/fog/aws/data_pipeline.rb
143
142
  - lib/fog/aws/dns.rb
@@ -146,9 +145,11 @@ files:
146
145
  - lib/fog/aws/elb.rb
147
146
  - lib/fog/aws/elb/policy_types.rb
148
147
  - lib/fog/aws/emr.rb
148
+ - lib/fog/aws/errors.rb
149
149
  - lib/fog/aws/federation.rb
150
150
  - lib/fog/aws/glacier.rb
151
151
  - lib/fog/aws/iam.rb
152
+ - lib/fog/aws/mock.rb
152
153
  - lib/fog/aws/models/auto_scaling/activities.rb
153
154
  - lib/fog/aws/models/auto_scaling/activity.rb
154
155
  - lib/fog/aws/models/auto_scaling/configuration.rb
@@ -285,7 +286,6 @@ files:
285
286
  - lib/fog/aws/models/storage/files.rb
286
287
  - lib/fog/aws/models/storage/version.rb
287
288
  - lib/fog/aws/models/storage/versions.rb
288
- - lib/fog/aws/parsers/.DS_Store
289
289
  - lib/fog/aws/parsers/auto_scaling/basic.rb
290
290
  - lib/fog/aws/parsers/auto_scaling/describe_adjustment_types.rb
291
291
  - lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_groups.rb
@@ -634,7 +634,6 @@ files:
634
634
  - lib/fog/aws/rds.rb
635
635
  - lib/fog/aws/redshift.rb
636
636
  - lib/fog/aws/region_methods.rb
637
- - lib/fog/aws/requests/.DS_Store
638
637
  - lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb
639
638
  - lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb
640
639
  - lib/fog/aws/requests/auto_scaling/create_or_update_tags.rb
@@ -1345,6 +1344,7 @@ files:
1345
1344
  - tests/requests/compute/vpc_tests.rb
1346
1345
  - tests/requests/data_pipeline/helper.rb
1347
1346
  - tests/requests/data_pipeline/pipeline_tests.rb
1347
+ - tests/requests/dns/change_resource_record_sets_tests.rb
1348
1348
  - tests/requests/dns/dns_tests.rb
1349
1349
  - tests/requests/dns/health_check_tests.rb
1350
1350
  - tests/requests/dns/helper.rb
@@ -1382,6 +1382,7 @@ files:
1382
1382
  - tests/requests/iam/server_certificate_tests.rb
1383
1383
  - tests/requests/iam/user_policy_tests.rb
1384
1384
  - tests/requests/iam/user_tests.rb
1385
+ - tests/requests/rds/db_engine_versions.rb
1385
1386
  - tests/requests/rds/describe_events.rb
1386
1387
  - tests/requests/rds/event_subscription_tests.rb
1387
1388
  - tests/requests/rds/helper.rb