aws-sdk-core 2.0.0.rc4 → 2.0.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/apis/CloudFront-2013-11-11.json +5502 -0
  3. data/apis/CloudWatch-2010-08-01.json +186 -1
  4. data/apis/DirectConnect-2012-10-25.json +758 -140
  5. data/apis/DynamoDB-2012-08-10.json +860 -2
  6. data/apis/EC2-2013-10-15.json +14698 -0
  7. data/apis/EMR-2009-03-31.json +86 -0
  8. data/apis/ElastiCache-2013-06-15.json +13 -5
  9. data/apis/ElasticBeanstalk-2010-12-01.json +141 -16
  10. data/apis/ElasticLoadBalancing-2012-06-01.json +0 -72
  11. data/apis/IAM-2010-05-08.json +156 -0
  12. data/apis/Kinesis-2013-12-02.json +9 -1
  13. data/apis/OpsWorks-2013-02-18.json +180 -6
  14. data/apis/RDS-2013-02-12.json +2 -1
  15. data/apis/RDS-2013-09-09.json +7963 -0
  16. data/apis/Redshift-2012-12-01.json +3273 -702
  17. data/apis/Route53-2012-12-12.json +2 -2
  18. data/apis/S3-2006-03-01.json +579 -538
  19. data/apis/SNS-2010-03-31.json +14 -0
  20. data/apis/SQS-2012-11-05.json +43 -6
  21. data/apis/STS-2011-06-15.json +81 -0
  22. data/apis/StorageGateway-2013-06-30.json +28 -28
  23. data/apis/source/cloudformation-2010-05-15.json +199 -199
  24. data/apis/source/cloudfront-2013-11-11.json +8828 -0
  25. data/apis/source/cloudfront-2013-11-11.paginators.json +32 -0
  26. data/apis/source/cloudfront-2013-11-11.waiters.json +29 -0
  27. data/apis/source/cloudsearch-2011-02-01.json +16 -23
  28. data/apis/source/datapipeline-2012-10-29.paginators.json +3 -2
  29. data/apis/source/directconnect-2012-10-25.json +1302 -363
  30. data/apis/source/dynamodb-2011-12-05.paginators.json +4 -1
  31. data/apis/source/dynamodb-2011-12-05.waiters.json +27 -0
  32. data/apis/source/dynamodb-2012-08-10.json +1634 -417
  33. data/apis/source/dynamodb-2012-08-10.paginators.json +4 -1
  34. data/apis/source/dynamodb-2012-08-10.waiters.json +25 -0
  35. data/apis/source/ec2-2013-10-15.json +19911 -0
  36. data/apis/source/ec2-2013-10-15.paginators.json +126 -0
  37. data/apis/source/ec2-2013-10-15.waiters.json +146 -0
  38. data/apis/source/elasticache-2013-06-15.json +10 -8
  39. data/apis/source/elasticache-2013-06-15.paginators.json +8 -2
  40. data/apis/source/elasticbeanstalk-2010-12-01.json +186 -32
  41. data/apis/source/elasticloadbalancing-2012-06-01.json +166 -293
  42. data/apis/source/elasticmapreduce-2009-03-31.json +229 -134
  43. data/apis/source/elastictranscoder-2012-09-25.json +1 -1
  44. data/apis/source/glacier-2012-06-01.paginators.json +3 -3
  45. data/apis/source/glacier-2012-06-01.waiters.json +23 -0
  46. data/apis/source/iam-2010-05-08.json +1306 -626
  47. data/apis/source/iam-2010-05-08.paginators.json +3 -0
  48. data/apis/source/kinesis-2013-12-02.json +4 -4
  49. data/apis/source/kinesis-2013-12-02.paginators.json +10 -4
  50. data/apis/source/monitoring-2010-08-01.json +336 -28
  51. data/apis/source/opsworks-2013-02-18.json +385 -102
  52. data/apis/source/rds-2013-01-10.paginators.json +6 -2
  53. data/apis/source/rds-2013-02-12.paginators.json +6 -2
  54. data/apis/source/rds-2013-09-09.json +10658 -0
  55. data/apis/source/rds-2013-09-09.paginators.json +110 -0
  56. data/apis/source/rds-2013-09-09.waiters.json +36 -0
  57. data/apis/source/redshift-2012-12-01.json +4759 -1237
  58. data/apis/source/redshift-2012-12-01.paginators.json +20 -1
  59. data/apis/source/redshift-2012-12-01.waiters.json +43 -0
  60. data/apis/source/route53-2012-12-12.paginators.json +2 -2
  61. data/apis/source/s3-2006-03-01.json +1032 -985
  62. data/apis/source/s3-2006-03-01.paginators.json +14 -3
  63. data/apis/source/s3-2006-03-01.waiters.json +27 -0
  64. data/apis/source/sns-2010-03-31.paginators.json +10 -0
  65. data/apis/source/sqs-2012-11-05.json +153 -101
  66. data/apis/source/storagegateway-2013-06-30.json +403 -442
  67. data/apis/source/storagegateway-2013-06-30.paginators.json +24 -0
  68. data/apis/source/sts-2011-06-15.json +258 -75
  69. data/apis/source/support-2013-04-15.paginators.json +0 -6
  70. data/apis/source/swf-2012-01-25.paginators.json +7 -7
  71. data/features/autoscaling/client.feature +6 -10
  72. data/features/autoscaling/{setup.rb → step_definitions.rb} +1 -1
  73. data/features/cloudformation/client.feature +5 -6
  74. data/features/cloudformation/{setup.rb → step_definitions.rb} +1 -1
  75. data/features/cloudfront/client.feature +5 -9
  76. data/features/cloudfront/{setup.rb → step_definitions.rb} +1 -1
  77. data/features/cloudsearch/client.feature +4 -6
  78. data/features/cloudsearch/{setup.rb → step_definitions.rb} +1 -1
  79. data/features/cloudwatch/client.feature +7 -9
  80. data/features/cloudwatch/{setup.rb → step_definitions.rb} +1 -1
  81. data/features/datapipeline/client.feature +5 -7
  82. data/features/datapipeline/{setup.rb → step_definitions.rb} +1 -1
  83. data/features/directconnect/client.feature +5 -7
  84. data/features/directconnect/{setup.rb → step_definitions.rb} +1 -1
  85. data/features/dynamodb/client.feature +6 -10
  86. data/features/dynamodb/simplified.feature +5 -9
  87. data/features/dynamodb/step_definitions.rb +9 -1
  88. data/features/ec2/client.feature +4 -9
  89. data/features/ec2/step_definitions.rb +3 -16
  90. data/features/elasticache/client.feature +4 -6
  91. data/features/elasticache/{setup.rb → step_definitions.rb} +1 -1
  92. data/features/elasticbeanstalk/client.feature +4 -6
  93. data/features/elasticbeanstalk/{setup.rb → step_definitions.rb} +1 -1
  94. data/features/elasticloadbalancing/client.feature +4 -6
  95. data/features/elasticloadbalancing/{setup.rb → step_definitions.rb} +1 -1
  96. data/features/elastictranscoder/client.feature +4 -6
  97. data/features/elastictranscoder/{setup.rb → step_definitions.rb} +1 -1
  98. data/features/emr/client.feature +4 -6
  99. data/features/emr/{setup.rb → step_definitions.rb} +1 -1
  100. data/features/env.rb +0 -2
  101. data/features/glacier/client.feature +10 -34
  102. data/features/glacier/step_definitions.rb +25 -8
  103. data/features/glacier/upload.feature +27 -0
  104. data/features/iam/client.feature +4 -6
  105. data/features/iam/{setup.rb → step_definitions.rb} +1 -1
  106. data/features/importexport/client.feature +4 -6
  107. data/features/importexport/{setup.rb → step_definitions.rb} +1 -1
  108. data/features/kinesis/client.feature +4 -6
  109. data/features/kinesis/{setup.rb → step_definitions.rb} +1 -1
  110. data/features/opsworks/client.feature +4 -6
  111. data/features/opsworks/{setup.rb → step_definitions.rb} +1 -1
  112. data/features/rds/client.feature +4 -6
  113. data/features/rds/{setup.rb → step_definitions.rb} +1 -1
  114. data/features/redshift/client.feature +4 -6
  115. data/features/redshift/{setup.rb → step_definitions.rb} +1 -1
  116. data/features/route53/client.feature +4 -6
  117. data/features/route53/{setup.rb → step_definitions.rb} +1 -1
  118. data/features/s3/buckets.feature +8 -0
  119. data/features/s3/step_definitions.rb +42 -3
  120. data/features/sdb/client.feature +4 -6
  121. data/features/sdb/{setup.rb → step_definitions.rb} +1 -1
  122. data/features/ses/client.feature +4 -6
  123. data/features/ses/{setup.rb → step_definitions.rb} +1 -1
  124. data/features/sns/client.feature +5 -6
  125. data/features/sns/{setup.rb → step_definitions.rb} +1 -1
  126. data/features/sqs/client.feature +5 -7
  127. data/features/sqs/step_definitions.rb +11 -0
  128. data/features/step_definitions.rb +88 -0
  129. data/features/storagegateway/client.feature +4 -6
  130. data/features/storagegateway/{setup.rb → step_definitions.rb} +1 -1
  131. data/features/sts/client.feature +5 -6
  132. data/features/sts/{setup.rb → step_definitions.rb} +1 -1
  133. data/features/swf/client.feature +5 -9
  134. data/features/swf/{setup.rb → step_definitions.rb} +1 -1
  135. data/lib/aws/api/shape_translator.rb +1 -0
  136. data/lib/aws/errors.rb +35 -11
  137. data/lib/aws/plugins/credentials.rb +11 -5
  138. data/lib/aws/plugins/regional_endpoint.rb +7 -3
  139. data/lib/aws/plugins/s3_regional_endpoint.rb +0 -2
  140. data/lib/aws/request_handler.rb +8 -3
  141. data/lib/aws/signers/s3.rb +14 -18
  142. data/lib/aws/version.rb +1 -1
  143. data/spec/aws/errors_spec.rb +39 -0
  144. data/spec/aws/plugins/credentials_spec.rb +12 -0
  145. data/spec/aws/plugins/region_endpoint_spec.rb +16 -4
  146. data/spec/aws/plugins/retry_errors_spec.rb +26 -26
  147. data/spec/aws/service_spec.rb +1 -1
  148. data/spec/fixtures/operations/route53/change_resource_record_sets.yml +18 -0
  149. data/tasks/test.rake +6 -18
  150. data/vendor/seahorse/lib/seahorse/client/http/headers.rb +20 -0
  151. data/vendor/seahorse/tasks/test.rake +2 -15
  152. metadata +77 -64
  153. data/features/common/step_definitions.rb +0 -63
  154. data/features/dynamodb/setup.rb +0 -8
  155. data/features/ec2/setup.rb +0 -6
  156. data/features/glacier/setup.rb +0 -16
  157. data/features/s3/setup.rb +0 -17
  158. data/features/sqs/setup.rb +0 -10
@@ -1,5 +1,5 @@
1
1
  Before("@elasticbeanstalk") do
2
- @elasticbeanstalk = Aws.elasticbeanstalk
2
+ @elasticbeanstalk = @client = Aws.elasticbeanstalk
3
3
  end
4
4
 
5
5
  After("@elasticbeanstalk") do
@@ -3,14 +3,12 @@
3
3
  Feature: Elastic Load Balancing
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "describe_load_balancers" on "elasticloadbalancing"
7
- Then the response "load_balancer_descriptions" should be an array
6
+ When I call the "DescribeLoadBalancers" API
7
+ Then the response should contain a list of "LoadBalancerDescriptions"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "describe_load_balancers" on "elasticloadbalancing" with:
11
- """
12
- { load_balancer_names: ['fake_load_balancer'] }
13
- """
10
+ When I attempt to call the "DescribeLoadBalancers" API with:
11
+ | LoadBalancerNames | ['fake_load_balancer'] |
14
12
  Then I expect the response error code to be "ValidationError"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@elasticloadbalancing") do
2
- @elasticloadbalancing = Aws.elasticloadbalancing
2
+ @elasticloadbalancing = @client = Aws.elasticloadbalancing
3
3
  end
4
4
 
5
5
  After("@elasticloadbalancing") do
@@ -3,14 +3,12 @@
3
3
  Feature: Amazon Elastic Transcoder
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_presets" on "elastictranscoder"
7
- Then the response "presets" should be an array
6
+ When I call the "ListPresets" API
7
+ Then the response should contain a list of "Presets"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "read_job" on "elastictranscoder" with:
11
- """
12
- { id: 'fake_job' }
13
- """
10
+ When I attempt to call the "ReadJob" API with:
11
+ | Id | fake_job |
14
12
  Then I expect the response error code to be "ValidationException"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@elastictranscoder") do
2
- @elastictranscoder = Aws.elastictranscoder
2
+ @elastictranscoder = @client = Aws.elastictranscoder
3
3
  end
4
4
 
5
5
  After("@elastictranscoder") do
@@ -3,14 +3,12 @@
3
3
  Feature: Amazon EMR
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "describe_job_flows" on "emr"
7
- Then the response "job_flows" should be an array
6
+ When I call the "DescribeJobFlows" API
7
+ Then the response should contain a list of "JobFlows"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "describe_job_flows" on "emr" with:
11
- """
12
- { job_flow_ids: ['fake_job_flow'] }
13
- """
10
+ When I attempt to call the "DescribeJobFlows" API with:
11
+ | JobFlowIds | ['fake_job_flow'] |
14
12
  Then I expect the response error code to be "ValidationException"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@emr") do
2
- @emr = Aws.emr
2
+ @emr = @client = Aws.emr
3
3
  end
4
4
 
5
5
  After("@emr") do
@@ -21,5 +21,3 @@ else
21
21
  puts msg
22
22
  exit(0)
23
23
  end
24
-
25
- Aws.config[:raise_response_errors] = false
@@ -1,41 +1,17 @@
1
1
  # language: en
2
- @glacier
2
+ @glacier @client
3
3
  Feature: Amazon Glacier
4
4
 
5
- Scenario: Listing vaults
6
- When I call "list_vaults" on "glacier" with:
7
- """
8
- { account_id: '-' }
9
- """
10
- Then the response data should include "vault_list"
11
- And the response "vault_list" should be an array
12
-
13
- @upload
14
- Scenario: Uploading an archive from a string
15
- When I upload an archive with the contents "Hello World!"
16
- Then I should be able to delete the archive
17
-
18
- @upload @slow
19
- Scenario: Uploading and deleting an archive
20
- When I upload an archive from a 5.5MB large file
21
- Then I should be able to delete the archive
22
-
23
- @multipart @upload @slow
24
- Scenario: Using multipart upload interface
25
- When I multipart-upload a 15.5MB file in 1048576 byte chunks
26
- Then I should be able to delete the archive
27
-
28
- # There was an issue where the client would fail attempting to compute
29
- # a checksum of an empty body, this step ensures that the checksum
30
- # computation does not hang.
31
- @upload
32
- Scenario: Attempting to upload an empty archive
33
- When I upload an archive with the contents ""
34
- Then a "InvalidParameterValueException" error should be raised
5
+ Scenario: Making a basic request
6
+ When I call the "ListVaults" API with:
7
+ | AccountId | - |
8
+ Then the response should contain a "VaultList"
35
9
 
36
10
  Scenario: Error handling
37
- When I call "list_vaults" on "glacier" with:
11
+ When I attempt to call the "ListVaults" API with:
12
+ | AccountId | abcmnoxyz |
13
+ Then I expect the response error code to be "AccessDeniedException"
14
+ And I expect the response error message to include:
38
15
  """
39
- { account_id: 'abcmnoxyz' }
16
+ Access denied
40
17
  """
41
- Then a "AccessDeniedException" error should be raised
@@ -1,8 +1,15 @@
1
+ Before("@glacier") do
2
+ @glacier = @client = Aws.glacier
3
+ end
4
+
5
+ After("@glacier") do
6
+ end
7
+
1
8
  def upload_glacier_archive(contents)
2
- resp = call_request('glacier', 'upload_archive', {
9
+ resp = @glacier.upload_archive(
3
10
  vault_name: @vault_name,
4
- body: contents,
5
- })
11
+ body: contents
12
+ )
6
13
  @archive_id = resp.data.archive_id if resp.data
7
14
  end
8
15
 
@@ -17,8 +24,21 @@ def bytes(megabytes)
17
24
  megabytes.to_f * 1024 * 1024
18
25
  end
19
26
 
27
+ Given(/^I have a vault ready to receive uploads$/) do
28
+ # ensure we have a suitable vault for testing with
29
+ @vault_name = 'aws-sdk-core-integration-test-vault'
30
+ begin
31
+ @glacier.describe_vault(vault_name: @vault_name, account_id: '-')
32
+ rescue Aws::Glacier::Errors::ResourceNotFoundException
33
+ @glacier.create_vault(vault_name: @vault_name, account_id: '-')
34
+ end
35
+ end
36
+
20
37
  When(/^I upload an archive with the contents "(.*?)"$/) do |contents|
21
- upload_glacier_archive(contents)
38
+ begin
39
+ upload_glacier_archive(contents)
40
+ rescue => @error
41
+ end
22
42
  end
23
43
 
24
44
  When(/^I upload an archive from a ([0-9\.]+)MB large file$/) do |size_in_mb|
@@ -69,8 +89,5 @@ When(/^I multipart\-upload a ([0-9\.]+)MB file in ([0-9\.]+) byte chunks$/) do |
69
89
  end
70
90
 
71
91
  Then(/^I should be able to delete the archive$/) do
72
- call_request('glacier', 'delete_archive', {
73
- vault_name: @vault_name,
74
- archive_id: @archive_id,
75
- })
92
+ @glacier.delete_archive(vault_name: @vault_name, archive_id: @archive_id)
76
93
  end
@@ -0,0 +1,27 @@
1
+ # language: en
2
+ @glacier @upload
3
+ Feature: Amazon Glacier
4
+
5
+ Background:
6
+ Given I have a vault ready to receive uploads
7
+
8
+ Scenario: Uploading an archive from a string
9
+ When I upload an archive with the contents "Hello World!"
10
+ Then I should be able to delete the archive
11
+
12
+ @slow
13
+ Scenario: Uploading and deleting an archive
14
+ When I upload an archive from a 5.5MB large file
15
+ Then I should be able to delete the archive
16
+
17
+ @multipart @slow
18
+ Scenario: Using multipart upload interface
19
+ When I multipart-upload a 15.5MB file in 1048576 byte chunks
20
+ Then I should be able to delete the archive
21
+
22
+ # There was an issue where the client would fail attempting to compute
23
+ # a checksum of an empty body, this step ensures that the checksum
24
+ # computation does not hang.
25
+ Scenario: Attempting to upload an empty archive
26
+ When I upload an archive with the contents ""
27
+ Then I expect the response error code to be "InvalidParameterValueException"
@@ -3,14 +3,12 @@
3
3
  Feature: AWS Identity and Access Management
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_users" on "iam"
7
- Then the response "users" should be an array
6
+ When I call the "ListUsers" API
7
+ Then the response should contain a list of "Users"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "get_user" on "iam" with:
11
- """
12
- { user_name: 'fake_user' }
13
- """
10
+ When I attempt to call the "GetUser" API with:
11
+ | UserName | fake_user |
14
12
  Then I expect the response error code to be "NoSuchEntity"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@iam") do
2
- @iam = Aws.iam
2
+ @iam = @client = Aws.iam
3
3
  end
4
4
 
5
5
  After("@iam") do
@@ -3,14 +3,12 @@
3
3
  Feature: AWS Import/Export
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_jobs" on "importexport"
7
- Then the response "jobs" should be an array
6
+ When I call the "ListJobs" API
7
+ Then the response should contain a list of "Jobs"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "get_status" on "importexport" with:
11
- """
12
- { job_id: 'fake_job' }
13
- """
10
+ When I attempt to call the "GetStatus" API with:
11
+ | JobId | fake_job |
14
12
  Then I expect the response error code to be "InvalidJobIdException"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@importexport") do
2
- @importexport = Aws.importexport
2
+ @importexport = @client = Aws.importexport
3
3
  end
4
4
 
5
5
  After("@importexport") do
@@ -3,14 +3,12 @@
3
3
  Feature: AWS Kinesis
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_streams" on "kinesis"
7
- Then the response "stream_names" should be an array
6
+ When I call the "ListStreams" API
7
+ Then the response should contain a list of "StreamNames"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "describe_stream" on "kinesis" with:
11
- """
12
- { stream_name: 'bogus-stream-name' }
13
- """
10
+ When I attempt to call the "DescribeStream" API with:
11
+ | StreamName | bogus-stream-name |
14
12
  Then I expect the response error code to be "ResourceNotFoundException"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@kinesis") do
2
- @kinesis = Aws.kinesis
2
+ @kinesis = @client = Aws.kinesis
3
3
  end
4
4
 
5
5
  After("@kinesis") do
@@ -3,14 +3,12 @@
3
3
  Feature: AWS OpsWorks
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "describe_stacks" on "opsworks"
7
- Then the response "stacks" should be an array
6
+ When I call the "DescribeStacks" API
7
+ Then the response should contain a list of "Stacks"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "describe_layers" on "opsworks" with:
11
- """
12
- { stack_id: 'fake_stack' }
13
- """
10
+ When I attempt to call the "DescribeLayers" API with:
11
+ | StackId | fake_stack |
14
12
  Then I expect the response error code to be "ResourceNotFoundException"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@opsworks") do
2
- @opsworks = Aws.opsworks
2
+ @opsworks = @client = Aws.opsworks
3
3
  end
4
4
 
5
5
  After("@opsworks") do
@@ -3,14 +3,12 @@
3
3
  Feature: Amazon RDS
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "describe_db_engine_versions" on "rds"
7
- Then the response "db_engine_versions" should be an array
6
+ When I call the "DescribeDbEngineVersions" API
7
+ Then the response should contain a list of "DbEngineVersions"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "describe_db_instances" on "rds" with:
11
- """
12
- { db_instance_identifier: 'fake-id' }
13
- """
10
+ When I attempt to call the "DescribeDbInstances" API with:
11
+ | DbInstanceIdentifier | fake-id |
14
12
  Then I expect the response error code to be "DBInstanceNotFound"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@rds") do
2
- @rds = Aws.rds
2
+ @rds = @client = Aws.rds
3
3
  end
4
4
 
5
5
  After("@rds") do
@@ -3,14 +3,12 @@
3
3
  Feature: Amazon Redshift
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "describe_cluster_versions" on "redshift"
7
- Then the response "cluster_versions" should be an array
6
+ When I call the "DescribeClusterVersions" API
7
+ Then the response should contain a list of "ClusterVersions"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "describe_clusters" on "redshift" with:
11
- """
12
- { cluster_identifier: 'fake-cluster' }
13
- """
10
+ When I attempt to call the "DescribeClusters" API with:
11
+ | ClusterIdentifier | fake-cluster |
14
12
  Then I expect the response error code to be "ClusterNotFound"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@redshift") do
2
- @redshift = Aws.redshift
2
+ @redshift = @client = Aws.redshift
3
3
  end
4
4
 
5
5
  After("@redshift") do
@@ -3,14 +3,12 @@
3
3
  Feature: Amazon Route 53
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_hosted_zones" on "route53"
7
- Then the response "hosted_zones" should be an array
6
+ When I call the "ListHostedZones" API
7
+ Then the response should contain a list of "HostedZones"
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "get_hosted_zone" on "route53" with:
11
- """
12
- { id: 'fake-zone' }
13
- """
10
+ When I attempt to call the "GetHostedZone" API with:
11
+ | Id | fake-zone |
14
12
  Then I expect the response error code to be "NoSuchHostedZone"
15
13
  And I expect the response error message to include:
16
14
  """
@@ -1,5 +1,5 @@
1
1
  Before("@route53") do
2
- @route53 = Aws.route53
2
+ @route53 = @client = Aws.route53
3
3
  end
4
4
 
5
5
  After("@route53") do
@@ -30,3 +30,11 @@ Feature: S3 Buckets
30
30
  Given I am using the S3 "http://s3.amazonaws.com" endpoint
31
31
  When I create a bucket with a DNS compatible name that contains a dot
32
32
  Then I should be able to delete the bucket
33
+
34
+ @force_path_style
35
+ Scenario: Operating on a bucket/object using path style
36
+ Given I force path style requests
37
+ And I create a DNS compatible bucket
38
+ When I put "abc" to the key "object-key"
39
+ Then the bucket name should be in the request path
40
+ And the bucket name should not be in the request host
@@ -1,3 +1,21 @@
1
+ Before("@s3") do
2
+ @s3 = @client = Aws.s3
3
+ @created_buckets = []
4
+ end
5
+
6
+ After("@s3") do
7
+ @created_buckets.each do |bucket|
8
+ loop do
9
+ objects = @s3.list_object_versions(bucket: bucket).data.versions.map do |v|
10
+ { key: v.key, version_id: v.version_id }
11
+ end
12
+ break if objects.empty?
13
+ @s3.delete_objects(bucket: bucket, delete: { objects: objects })
14
+ end
15
+ @s3.delete_bucket(bucket: bucket)
16
+ end
17
+ end
18
+
1
19
  def create_bucket(options = {})
2
20
  @bucket_name = "aws-sdk-test-#{Time.now.to_i}-#{rand(1000)}"
3
21
  options[:bucket] = @bucket_name
@@ -10,6 +28,10 @@ def create_bucket(options = {})
10
28
  @created_buckets << @bucket_name
11
29
  end
12
30
 
31
+ When(/^I force path style requests$/) do
32
+ @s3 = Aws.s3(force_path_style:true)
33
+ end
34
+
13
35
  Given(/^I am using the S3 "(.*?)" region$/) do |region|
14
36
  @s3 = Aws.s3(region: region)
15
37
  end
@@ -18,6 +40,10 @@ When(/^I create a bucket$/) do
18
40
  create_bucket
19
41
  end
20
42
 
43
+ Given(/^I create a DNS compatible bucket$/) do
44
+ create_bucket
45
+ end
46
+
21
47
  When(/^I create a bucket with the location constraint "(.*?)"$/) do |loc|
22
48
  create_bucket(create_bucket_configuration: {
23
49
  location_constraint: loc
@@ -40,8 +66,11 @@ end
40
66
 
41
67
  Then(/^the bucket should not exist$/) do
42
68
  eventually do
43
- resp = @s3.get_bucket_location(bucket: @bucket_name)
44
- expect(resp.error).to be_kind_of(Aws::S3::Errors::NoSuchBucket)
69
+ begin
70
+ @s3.get_bucket_location(bucket: @bucket_name)
71
+ rescue => @error
72
+ end
73
+ expect(@error).to be_kind_of(Aws::S3::Errors::NoSuchBucket)
45
74
  end
46
75
  end
47
76
 
@@ -50,7 +79,7 @@ When(/^I put nothing to the key "(.*?)"$/) do |key|
50
79
  end
51
80
 
52
81
  When(/^I put "(.*?)" to the key "(.*?)"$/) do |data, key|
53
- @s3.put_object(bucket: @bucket_name, key: key, body: data)
82
+ @response = @s3.put_object(bucket: @bucket_name, key: key, body: data)
54
83
  end
55
84
 
56
85
  When(/^I put the test png to the key "(.*?)"$/) do |key|
@@ -92,3 +121,13 @@ end
92
121
  Then(/^I should be able to delete the bucket$/) do
93
122
  @s3.delete_bucket(bucket: @bucket_name)
94
123
  end
124
+
125
+ Then(/^the bucket name should be in the request path$/) do
126
+ endpoint = @response.context.http_request.endpoint
127
+ expect(endpoint.path).to include(@bucket_name)
128
+ end
129
+
130
+ Then(/^the bucket name should not be in the request host$/) do
131
+ endpoint = @response.context.http_request.endpoint
132
+ expect(endpoint.host).not_to include(@bucket_name)
133
+ end