aws-sdk-core 2.6.9 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/apis/acm/2015-12-08/api-2.json +34 -3
- data/apis/acm/2015-12-08/paginators-1.json +2 -2
- data/apis/apigateway/2015-07-09/api-2.json +625 -17
- data/apis/application-autoscaling/2016-02-06/api-2.json +5 -2
- data/apis/appstream/2016-12-01/api-2.json +820 -0
- data/apis/appstream/2016-12-01/examples-1.json +5 -0
- data/apis/appstream/2016-12-01/waiters-2.json +55 -0
- data/apis/autoscaling/2011-01-01/api-2.json +1 -0
- data/apis/autoscaling/2011-01-01/resources-1.json +12 -1
- data/apis/batch/2016-08-10/api-2.json +885 -0
- data/apis/batch/2016-08-10/examples-1.json +589 -0
- data/apis/budgets/2016-10-20/api-2.json +696 -0
- data/apis/budgets/2016-10-20/examples-1.json +5 -0
- data/apis/cloudformation/2010-05-15/api-2.json +126 -11
- data/apis/cloudformation/2010-05-15/examples-1.json +153 -0
- data/apis/cloudformation/2010-05-15/resources-1.json +10 -1
- data/apis/cloudformation/2010-05-15/waiters-2.json +18 -96
- data/apis/cloudfront/2016-01-28/api-2.json +1 -0
- data/apis/cloudfront/2016-08-01/api-2.json +1 -0
- data/apis/cloudfront/2016-08-20/api-2.json +1 -0
- data/apis/cloudfront/2016-09-07/api-2.json +1 -0
- data/apis/cloudfront/2016-09-29/api-2.json +2599 -0
- data/apis/cloudfront/2016-09-29/examples-1.json +5 -0
- data/apis/cloudfront/2016-09-29/paginators-1.json +32 -0
- data/apis/cloudfront/2016-09-29/waiters-2.json +47 -0
- data/apis/cloudfront/2016-11-25/api-2.json +2665 -0
- data/apis/cloudfront/2016-11-25/examples-1.json +5 -0
- data/apis/cloudfront/2016-11-25/paginators-1.json +32 -0
- data/apis/cloudfront/2016-11-25/waiters-2.json +47 -0
- data/apis/cloudhsm/2014-05-30/api-2.json +2 -1
- data/apis/cloudsearch/2013-01-01/api-2.json +2 -1
- data/apis/cloudsearchdomain/2013-01-01/api-2.json +2 -1
- data/apis/cloudtrail/2013-11-01/api-2.json +109 -3
- data/apis/cloudtrail/2013-11-01/paginators-1.json +6 -0
- data/apis/codebuild/2016-10-06/api-2.json +702 -0
- data/apis/codebuild/2016-10-06/examples-1.json +5 -0
- data/apis/codecommit/2015-04-13/api-2.json +2 -1
- data/apis/codedeploy/2014-10-06/api-2.json +35 -6
- data/apis/codepipeline/2015-07-09/api-2.json +3 -2
- data/apis/cognito-identity/2014-06-30/api-2.json +84 -5
- data/apis/cognito-idp/2016-04-18/api-2.json +368 -5
- data/apis/cognito-sync/2014-06-30/api-2.json +2 -1
- data/apis/config/2014-11-12/api-2.json +40 -9
- data/apis/config/2014-11-12/paginators-1.json +2 -2
- data/apis/cur/2017-01-06/api-2.json +226 -0
- data/apis/cur/2017-01-06/examples-1.json +5 -0
- data/apis/cur/2017-01-06/paginators-1.json +9 -0
- data/apis/datapipeline/2012-10-29/api-2.json +2 -1
- data/apis/devicefarm/2015-06-23/api-2.json +2 -1
- data/apis/directconnect/2012-10-25/api-2.json +257 -10
- data/apis/discovery/2015-11-01/api-2.json +316 -5
- data/apis/dms/2016-01-01/api-2.json +45 -9
- data/apis/ds/2015-04-16/api-2.json +144 -1
- data/apis/dynamodb/2011-12-05/api-2.json +802 -0
- data/apis/dynamodb/2011-12-05/examples-1.json +5 -0
- data/apis/dynamodb/2011-12-05/paginators-1.json +26 -0
- data/apis/dynamodb/2011-12-05/waiters-2.json +35 -0
- data/apis/dynamodb/2012-08-10/api-2.json +115 -1
- data/apis/dynamodb/2012-08-10/examples-1.json +623 -0
- data/apis/dynamodb/2012-08-10/paginators-1.json +4 -4
- data/apis/ec2/2015-10-01/api-2.json +1 -0
- data/apis/ec2/2016-04-01/api-2.json +1 -0
- data/apis/ec2/2016-09-15/api-2.json +1 -0
- data/apis/ec2/2016-11-15/api-2.json +15037 -0
- data/apis/ec2/2016-11-15/examples-1.json +3740 -0
- data/apis/ec2/2016-11-15/paginators-1.json +138 -0
- data/apis/ec2/2016-11-15/resources-1.json +2582 -0
- data/apis/ec2/2016-11-15/waiters-2.json +593 -0
- data/apis/ecr/2015-09-21/api-2.json +17 -3
- data/apis/ecr/2015-09-21/paginators-1.json +12 -6
- data/apis/ecs/2014-11-13/api-2.json +183 -9
- data/apis/elasticache/2015-02-02/api-2.json +5 -2
- data/apis/elasticache/2015-02-02/examples-1.json +2963 -0
- data/apis/elasticbeanstalk/2010-12-01/api-2.json +123 -6
- data/apis/elasticfilesystem/2015-02-01/api-2.json +2 -1
- data/apis/elasticfilesystem/2015-02-01/examples-1.json +217 -0
- data/apis/elasticloadbalancing/2012-06-01/api-2.json +1 -0
- data/apis/elasticloadbalancingv2/2015-12-01/api-2.json +1 -0
- data/apis/elasticmapreduce/2009-03-31/api-2.json +322 -5
- data/apis/elastictranscoder/2012-09-25/api-2.json +44 -13
- data/apis/elastictranscoder/2012-09-25/examples-1.json +5 -0
- data/apis/email/2010-12-01/api-2.json +425 -4
- data/apis/es/2015-01-01/api-2.json +1 -0
- data/apis/events/2015-10-07/api-2.json +1 -0
- data/apis/firehose/2015-08-04/api-2.json +151 -4
- data/apis/firehose/2015-08-04/examples-1.json +5 -0
- data/apis/gamelift/2015-10-01/api-2.json +59 -1
- data/apis/glacier/2012-06-01/api-2.json +369 -779
- data/apis/glacier/2012-06-01/examples-1.json +806 -0
- data/apis/glacier/2012-06-01/paginators-1.json +5 -5
- data/apis/health/2016-08-04/api-2.json +547 -0
- data/apis/health/2016-08-04/examples-1.json +5 -0
- data/apis/health/2016-08-04/paginators-1.json +31 -0
- data/apis/iam/2010-05-08/api-2.json +209 -0
- data/apis/iam/2010-05-08/examples-1.json +1186 -0
- data/apis/importexport/2010-06-01/api-2.json +1 -0
- data/apis/inspector/2016-02-16/api-2.json +2 -1
- data/apis/inspector/2016-02-16/examples-1.json +1135 -0
- data/apis/iot-data/2015-05-28/api-2.json +1 -0
- data/apis/iot/2015-05-28/api-2.json +16 -0
- data/apis/kinesis/2013-12-02/api-2.json +80 -12
- data/apis/kinesisanalytics/2015-08-14/api-2.json +7 -2
- data/apis/kms/2014-11-01/api-2.json +2 -1
- data/apis/kms/2014-11-01/examples-1.json +810 -0
- data/apis/lambda/2014-11-11/api-2.json +1 -0
- data/apis/lambda/2015-03-31/api-2.json +162 -9
- data/apis/lambda/2015-03-31/examples-1.json +609 -0
- data/apis/lightsail/2016-11-28/api-2.json +2137 -0
- data/apis/lightsail/2016-11-28/examples-1.json +5 -0
- data/apis/logs/2014-03-28/api-2.json +113 -6
- data/apis/machinelearning/2014-12-12/api-2.json +1 -0
- data/apis/marketplacecommerceanalytics/2015-07-01/api-2.json +5 -2
- data/apis/meteringmarketplace/2016-01-14/api-2.json +136 -0
- data/apis/monitoring/2010-08-01/api-2.json +27 -6
- data/apis/opsworks/2013-02-18/api-2.json +1 -0
- data/apis/opsworkscm/2016-11-01/api-2.json +712 -0
- data/apis/opsworkscm/2016-11-01/examples-1.json +5 -0
- data/apis/pinpoint/2016-12-01/api-2.json +2753 -0
- data/apis/pinpoint/2016-12-01/examples-1.json +5 -0
- data/apis/polly/2016-06-10/api-2.json +504 -0
- data/apis/polly/2016-06-10/examples-1.json +171 -0
- data/apis/rds/2013-01-10/api-2.json +2902 -0
- data/apis/rds/2013-01-10/examples-1.json +5 -0
- data/apis/rds/2013-01-10/paginators-1.json +97 -0
- data/apis/rds/2013-02-12/api-2.json +3058 -0
- data/apis/rds/2013-02-12/examples-1.json +5 -0
- data/apis/rds/2013-02-12/paginators-1.json +110 -0
- data/apis/rds/2013-09-09/api-2.json +3159 -0
- data/apis/rds/2013-09-09/examples-1.json +5 -0
- data/apis/rds/2013-09-09/paginators-1.json +110 -0
- data/apis/rds/2013-09-09/waiters-2.json +97 -0
- data/apis/rds/2014-09-01/api-2.json +3272 -0
- data/apis/rds/2014-09-01/examples-1.json +5 -0
- data/apis/rds/2014-09-01/paginators-1.json +4 -0
- data/apis/rds/2014-10-31/api-2.json +121 -6
- data/apis/rds/2014-10-31/examples-1.json +0 -444
- data/apis/rds/2014-10-31/paginators-1.json +18 -18
- data/apis/rds/2014-10-31/resources-1.json +1 -1
- data/apis/redshift/2012-12-01/api-2.json +1 -0
- data/apis/rekognition/2016-06-27/api-2.json +836 -0
- data/apis/rekognition/2016-06-27/examples-1.json +651 -0
- data/apis/rekognition/2016-06-27/paginators-1.json +16 -0
- data/apis/route53/2013-04-01/api-2.json +186 -219
- data/apis/route53/2013-04-01/paginators-1.json +9 -9
- data/apis/route53domains/2014-05-15/api-2.json +1 -0
- data/apis/s3/2006-03-01/api-2.json +843 -23
- data/apis/sdb/2009-04-15/api-2.json +1 -0
- data/apis/servicecatalog/2015-12-10/api-2.json +1214 -29
- data/apis/shield/2016-06-02/api-2.json +494 -0
- data/apis/shield/2016-06-02/examples-1.json +5 -0
- data/apis/sms/2016-10-24/api-2.json +612 -0
- data/apis/sms/2016-10-24/examples-1.json +5 -0
- data/apis/sms/2016-10-24/paginators-1.json +28 -0
- data/apis/snowball/2016-06-30/api-2.json +283 -11
- data/apis/snowball/2016-06-30/examples-1.json +437 -0
- data/apis/sns/2010-03-31/api-2.json +1 -0
- data/apis/sqs/2012-11-05/api-2.json +74 -38
- data/apis/sqs/2012-11-05/examples-1.json +0 -613
- data/apis/sqs/2012-11-05/resources-1.json +232 -0
- data/apis/ssm/2014-11-06/api-2.json +4036 -536
- data/apis/states/2016-11-23/api-2.json +1021 -0
- data/apis/states/2016-11-23/examples-1.json +5 -0
- data/apis/states/2016-11-23/paginators-1.json +28 -0
- data/apis/storagegateway/2013-06-30/api-2.json +269 -6
- data/apis/storagegateway/2013-06-30/examples-1.json +1376 -0
- data/apis/streams.dynamodb/2012-08-10/api-2.json +2 -1
- data/apis/streams.dynamodb/2012-08-10/examples-1.json +207 -0
- data/apis/sts/2011-06-15/api-2.json +1 -0
- data/apis/sts/2011-06-15/examples-1.json +201 -0
- data/apis/support/2013-04-15/api-2.json +1 -0
- data/apis/swf/2012-01-25/api-2.json +1 -0
- data/apis/waf-regional/2016-11-28/api-2.json +2090 -0
- data/apis/waf-regional/2016-11-28/examples-1.json +1017 -0
- data/apis/waf/2015-08-24/api-2.json +3 -1
- data/apis/waf/2015-08-24/examples-1.json +1012 -0
- data/apis/workspaces/2015-04-08/api-2.json +1 -0
- data/apis/xray/2016-04-12/api-2.json +491 -0
- data/apis/xray/2016-04-12/examples-1.json +5 -0
- data/endpoints.json +781 -392
- data/lib/aws-sdk-core.rb +20 -0
- data/lib/aws-sdk-core/api/customizations.rb +16 -0
- data/lib/aws-sdk-core/api/docs/builder.rb +2 -1
- data/lib/aws-sdk-core/api/docs/client_type_documenter.rb +9 -0
- data/lib/aws-sdk-core/api/docs/crosslink.rb +43 -0
- data/lib/aws-sdk-core/api/docs/operation_documenter.rb +11 -2
- data/lib/aws-sdk-core/appstream.rb +6 -0
- data/lib/aws-sdk-core/batch.rb +5 -0
- data/lib/aws-sdk-core/budgets.rb +5 -0
- data/lib/aws-sdk-core/client.rb +1 -0
- data/lib/aws-sdk-core/client_waiters.rb +5 -5
- data/lib/aws-sdk-core/cloudfront.rb +5 -5
- data/lib/aws-sdk-core/cloudfront/url_signer.rb +1 -1
- data/lib/aws-sdk-core/codebuild.rb +5 -0
- data/lib/aws-sdk-core/costandusagereportservice.rb +6 -0
- data/lib/aws-sdk-core/credential_provider_chain.rb +3 -3
- data/lib/aws-sdk-core/cur.rb +6 -0
- data/lib/aws-sdk-core/ec2.rb +6 -6
- data/lib/aws-sdk-core/elastictranscoder.rb +1 -0
- data/lib/aws-sdk-core/firehose.rb +1 -0
- data/lib/aws-sdk-core/glacier.rb +1 -0
- data/lib/aws-sdk-core/health.rb +6 -0
- data/lib/aws-sdk-core/lightsail.rb +5 -0
- data/lib/aws-sdk-core/opsworkscm.rb +5 -0
- data/lib/aws-sdk-core/partitions/region.rb +0 -12
- data/lib/aws-sdk-core/partitions/service.rb +1 -11
- data/lib/aws-sdk-core/pinpoint.rb +5 -0
- data/lib/aws-sdk-core/plugins/ec2_copy_encrypted_snapshot.rb +24 -55
- data/lib/aws-sdk-core/plugins/idempotency_token.rb +37 -0
- data/lib/aws-sdk-core/plugins/rds_cross_region_copying.rb +64 -0
- data/lib/aws-sdk-core/plugins/request_signer.rb +4 -0
- data/lib/aws-sdk-core/plugins/retry_errors.rb +1 -0
- data/lib/aws-sdk-core/plugins/s3_bucket_dns.rb +1 -1
- data/lib/aws-sdk-core/plugins/sqs_md5s.rb +1 -1
- data/lib/aws-sdk-core/polly.rb +13 -0
- data/lib/aws-sdk-core/polly/presigner.rb +70 -0
- data/lib/aws-sdk-core/rekognition.rb +6 -0
- data/lib/aws-sdk-core/rest/request/endpoint.rb +11 -66
- data/lib/aws-sdk-core/rest/request/querystring_builder.rb +90 -0
- data/lib/aws-sdk-core/shield.rb +5 -0
- data/lib/aws-sdk-core/signers/v4.rb +2 -1
- data/lib/aws-sdk-core/sms.rb +6 -0
- data/lib/aws-sdk-core/sqs.rb +1 -0
- data/lib/aws-sdk-core/states.rb +6 -0
- data/lib/aws-sdk-core/version.rb +1 -1
- data/lib/aws-sdk-core/wafregional.rb +5 -0
- data/lib/aws-sdk-core/xray.rb +5 -0
- data/lib/seahorse/client/net_http/connection_pool.rb +11 -7
- data/lib/seahorse/client/net_http/handler.rb +5 -2
- data/lib/seahorse/client/plugin_list.rb +3 -1
- data/lib/seahorse/client/response.rb +9 -20
- data/service-models.json +66 -2
- metadata +110 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'aws-sigv4'
|
|
2
|
+
|
|
1
3
|
module Aws
|
|
2
4
|
module Plugins
|
|
3
5
|
|
|
@@ -16,66 +18,33 @@ module Aws
|
|
|
16
18
|
def call(context)
|
|
17
19
|
params = context.params
|
|
18
20
|
params[:destination_region] = context.config.region
|
|
19
|
-
params[:presigned_url] = presigned_url(context
|
|
21
|
+
params[:presigned_url] = presigned_url(context, params)
|
|
20
22
|
@handler.call(context)
|
|
21
23
|
end
|
|
22
24
|
|
|
23
25
|
private
|
|
24
26
|
|
|
25
|
-
def presigned_url(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
region: params[:source_region]
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
#
|
|
47
|
-
# * The HTTP method is changed from POST to GET
|
|
48
|
-
# * The url-encoded body is moved to the querystring
|
|
49
|
-
#
|
|
50
|
-
# @api private
|
|
51
|
-
class PresignHandler < Seahorse::Client::Handler
|
|
52
|
-
|
|
53
|
-
def call(context)
|
|
54
|
-
convert_post_2_get(context)
|
|
55
|
-
Seahorse::Client::Response.new(
|
|
56
|
-
context: context,
|
|
57
|
-
data: presigned_url(context.http_request, context.config))
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
private
|
|
61
|
-
|
|
62
|
-
def convert_post_2_get(context)
|
|
63
|
-
context.http_request.http_method = 'GET'
|
|
64
|
-
context.http_request.endpoint = new_endpoint(context)
|
|
65
|
-
context.http_request.body = ''
|
|
66
|
-
context.http_request.headers.delete('Content-Type')
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
def new_endpoint(context)
|
|
70
|
-
body = context.http_request.body_contents
|
|
71
|
-
endpoint = context.http_request.endpoint
|
|
72
|
-
endpoint.query = body
|
|
73
|
-
endpoint
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
def presigned_url(http_request, config)
|
|
77
|
-
signer = Signers::V4.new(config.credentials, 'ec2', config.region)
|
|
78
|
-
signer.presigned_url(http_request, expires_in: 3600)
|
|
27
|
+
def presigned_url(context, params)
|
|
28
|
+
param_list = Aws::Query::ParamList.new
|
|
29
|
+
param_list.set('Action', 'CopySnapshot')
|
|
30
|
+
param_list.set('DestinationRegion', context.config.region)
|
|
31
|
+
param_list.set('Version', context.config.api.metadata['apiVersion'])
|
|
32
|
+
Aws::Query::EC2ParamBuilder.new(param_list).apply(context.operation.input, params)
|
|
33
|
+
|
|
34
|
+
signer = Aws::Sigv4::Signer.new(
|
|
35
|
+
service: 'ec2',
|
|
36
|
+
region: params[:source_region],
|
|
37
|
+
credentials_provider: context.config.credentials
|
|
38
|
+
)
|
|
39
|
+
url = Aws::EndpointProvider.resolve(signer.region, 'ec2')
|
|
40
|
+
url += "?#{param_list.to_s}"
|
|
41
|
+
|
|
42
|
+
signer.presign_url(
|
|
43
|
+
http_method: 'GET',
|
|
44
|
+
url: url,
|
|
45
|
+
body: '',
|
|
46
|
+
expires_in: 3600
|
|
47
|
+
).to_s
|
|
79
48
|
end
|
|
80
49
|
|
|
81
50
|
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'securerandom'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Plugins
|
|
5
|
+
|
|
6
|
+
# Provides support for auto filling operation parameters
|
|
7
|
+
# that enabled with `idempotencyToken` trait with random UUID v4
|
|
8
|
+
# when no value is provided
|
|
9
|
+
class IdempotencyToken < Seahorse::Client::Plugin
|
|
10
|
+
|
|
11
|
+
# @api private
|
|
12
|
+
class Handler < Seahorse::Client::Handler
|
|
13
|
+
|
|
14
|
+
# @param [RequestContext] context
|
|
15
|
+
# @param [Response]
|
|
16
|
+
def call(context)
|
|
17
|
+
auto_fill(context.params, context.operation.input)
|
|
18
|
+
@handler.call(context)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def auto_fill(params, ref)
|
|
24
|
+
ref.shape.members.each do |name, member_ref|
|
|
25
|
+
if member_ref['idempotencyToken']
|
|
26
|
+
params[name] ||= SecureRandom.uuid
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
handler(Handler, step: :initialize)
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
require 'aws-sigv4'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Plugins
|
|
5
|
+
|
|
6
|
+
# This plugin populates the `:pre_signed_url` request param for the
|
|
7
|
+
# CopyDBSnapshot API.
|
|
8
|
+
#
|
|
9
|
+
# This parameter is required by RDS when copying an encrypted snapshot
|
|
10
|
+
# across regions. This plugin will be skipped if the `:pre_signed_url`
|
|
11
|
+
# parameter is provided by the user.
|
|
12
|
+
#
|
|
13
|
+
# @seahorse.client.option [String] :source_region The region which you are
|
|
14
|
+
# copying an encrypted snapshot from. This parameter must be present to
|
|
15
|
+
# have the plugin compute a presigned URL on your behalf.
|
|
16
|
+
class RDSCrossRegionCopying < Seahorse::Client::Plugin
|
|
17
|
+
|
|
18
|
+
# @api private
|
|
19
|
+
class Handler < Seahorse::Client::Handler
|
|
20
|
+
|
|
21
|
+
def call(context)
|
|
22
|
+
params = context.params
|
|
23
|
+
if params[:source_region] && !params[:pre_signed_url]
|
|
24
|
+
params[:pre_signed_url] = presigned_url(context, params)
|
|
25
|
+
params[:destination_region] = context.config.region
|
|
26
|
+
end
|
|
27
|
+
@handler.call(context)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
def presigned_url(context, params)
|
|
32
|
+
# :source_region is not modeled in the api
|
|
33
|
+
source_region = params.delete(:source_region)
|
|
34
|
+
param_list = Aws::Query::ParamList.new
|
|
35
|
+
param_list.set('Action', context.operation.name)
|
|
36
|
+
param_list.set('DestinationRegion', context.config.region)
|
|
37
|
+
param_list.set('Version', context.config.api.metadata['apiVersion'])
|
|
38
|
+
Aws::Query::ParamBuilder.new(param_list).apply(
|
|
39
|
+
context.operation.input,
|
|
40
|
+
params
|
|
41
|
+
)
|
|
42
|
+
signer = Aws::Sigv4::Signer.new(
|
|
43
|
+
service: 'rds',
|
|
44
|
+
region: source_region,
|
|
45
|
+
credentials_provider: context.config.credentials
|
|
46
|
+
)
|
|
47
|
+
url = Aws::EndpointProvider.resolve(signer.region, 'rds')
|
|
48
|
+
url += "?#{param_list.to_s}"
|
|
49
|
+
signer.presign_url(
|
|
50
|
+
http_method: 'GET',
|
|
51
|
+
url: url,
|
|
52
|
+
body: '',
|
|
53
|
+
expires_in: 3600
|
|
54
|
+
).to_s
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
handler(
|
|
58
|
+
Handler,
|
|
59
|
+
step: :initialize,
|
|
60
|
+
operations: [:copy_db_snapshot]
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -37,6 +37,10 @@ module Aws
|
|
|
37
37
|
CredentialProviderChain.new(config).resolve
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
option(:instance_profile_credentials_retries, 0)
|
|
41
|
+
|
|
42
|
+
option(:instance_profile_credentials_timeout, 1)
|
|
43
|
+
|
|
40
44
|
# Intentionally not documented - this should go away when all
|
|
41
45
|
# services support signature version 4 in every region.
|
|
42
46
|
option(:signature_version) do |cfg|
|
|
@@ -39,7 +39,7 @@ module Aws
|
|
|
39
39
|
if
|
|
40
40
|
bucket_name &&
|
|
41
41
|
S3BucketDns.dns_compatible?(bucket_name, https?(endpoint)) &&
|
|
42
|
-
context.operation_name != 'get_bucket_location'
|
|
42
|
+
context.operation_name.to_s != 'get_bucket_location'
|
|
43
43
|
then
|
|
44
44
|
move_bucket_to_subdomain(bucket_name, endpoint)
|
|
45
45
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Aws.add_service(:Polly, {
|
|
2
|
+
api: "#{Aws::API_DIR}/polly/2016-06-10/api-2.json",
|
|
3
|
+
docs: "#{Aws::API_DIR}/polly/2016-06-10/docs-2.json",
|
|
4
|
+
examples: "#{Aws::API_DIR}/polly/2016-06-10/examples-1.json",
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
module Aws
|
|
8
|
+
module Polly
|
|
9
|
+
|
|
10
|
+
autoload :Presigner, 'aws-sdk-core/polly/presigner'
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
require 'aws-sigv4'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Polly
|
|
5
|
+
|
|
6
|
+
# Allows you to create presigned URLs for `synthesize_speech`
|
|
7
|
+
#
|
|
8
|
+
# Example Use:
|
|
9
|
+
#
|
|
10
|
+
# signer = Aws::Polly::Presigner.new
|
|
11
|
+
# url = signer.synthesize_speech_presigned_url(
|
|
12
|
+
# output_format: 'mp3',
|
|
13
|
+
# text: 'Hello World',
|
|
14
|
+
# voice_id: 'Ewa'
|
|
15
|
+
# )
|
|
16
|
+
#
|
|
17
|
+
class Presigner
|
|
18
|
+
|
|
19
|
+
# @option options [required, Credentials] :credentials
|
|
20
|
+
# You need provide an object that responds to `#credentials`
|
|
21
|
+
# returning another object that responds to `#access_key_id`, `#secret_access_key`,
|
|
22
|
+
# and `#session_token`.
|
|
23
|
+
#
|
|
24
|
+
# For example, you could provide an instance of following classes:
|
|
25
|
+
# * `Aws::Credentials`
|
|
26
|
+
# * `Aws::SharedCredentials`
|
|
27
|
+
# * `Aws::InstanceProfileCredentials`
|
|
28
|
+
# * `Aws::AssumeRoleCredentials`
|
|
29
|
+
# * `Aws::ECSCredentials`
|
|
30
|
+
#
|
|
31
|
+
# @option options [required, string] :region
|
|
32
|
+
# The region name, e.g. 'us-west-2'
|
|
33
|
+
def initialize(options = {})
|
|
34
|
+
@credentials = options.fetch(:credentials)
|
|
35
|
+
@region = options.fetch(:region)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# @param [Hash] params parameter inputs for synthesize_speech operation
|
|
39
|
+
def synthesize_speech_presigned_url(params = {})
|
|
40
|
+
input_shape = Client.api.operation(:synthesize_speech).input.shape
|
|
41
|
+
sign_but_dont_send(input_shape, params)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
def sign_but_dont_send(input_shape, params)
|
|
47
|
+
parts = []
|
|
48
|
+
input_shape.members.each do |name, ref|
|
|
49
|
+
parts << [ ref, params[name] ] unless params[name].nil?
|
|
50
|
+
end
|
|
51
|
+
query = Aws::Rest::Request::QuerystringBuilder.new.build(parts)
|
|
52
|
+
|
|
53
|
+
signer = Aws::Sigv4::Signer.new(
|
|
54
|
+
service: 'polly',
|
|
55
|
+
region: @region,
|
|
56
|
+
credentials_provider: @credentials
|
|
57
|
+
)
|
|
58
|
+
url = Aws::EndpointProvider.resolve(signer.region, 'polly')
|
|
59
|
+
url += "/v1/speech?#{query}"
|
|
60
|
+
pre_signed_url = signer.presign_url(
|
|
61
|
+
http_method: 'GET',
|
|
62
|
+
url: url,
|
|
63
|
+
body: '',
|
|
64
|
+
expires_in: 900
|
|
65
|
+
).to_s
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Aws.add_service(:Rekognition, {
|
|
2
|
+
api: "#{Aws::API_DIR}/rekognition/2016-06-27/api-2.json",
|
|
3
|
+
docs: "#{Aws::API_DIR}/rekognition/2016-06-27/docs-2.json",
|
|
4
|
+
examples: "#{Aws::API_DIR}/rekognition/2016-06-27/examples-1.json",
|
|
5
|
+
paginators: "#{Aws::API_DIR}/rekognition/2016-06-27/paginators-1.json",
|
|
6
|
+
})
|
|
@@ -5,15 +5,13 @@ module Aws
|
|
|
5
5
|
module Request
|
|
6
6
|
class Endpoint
|
|
7
7
|
|
|
8
|
-
include Seahorse::Model::Shapes
|
|
9
|
-
|
|
10
8
|
# @param [Seahorse::Model::Shapes::ShapeRef] rules
|
|
11
9
|
# @param [String] request_uri_pattern
|
|
12
10
|
def initialize(rules, request_uri_pattern)
|
|
13
11
|
@rules = rules
|
|
14
12
|
request_uri_pattern.split('?').tap do |path_part, query_part|
|
|
15
13
|
@path_pattern = path_part
|
|
16
|
-
@
|
|
14
|
+
@query_prefix = query_part
|
|
17
15
|
end
|
|
18
16
|
end
|
|
19
17
|
|
|
@@ -31,7 +29,7 @@ module Aws
|
|
|
31
29
|
|
|
32
30
|
def apply_path_params(uri, params)
|
|
33
31
|
path = uri.path.sub(/\/$/, '') + @path_pattern.split('?')[0]
|
|
34
|
-
uri.path = path.gsub(/{
|
|
32
|
+
uri.path = path.gsub(/{.+?}/) do |placeholder|
|
|
35
33
|
param_value_for_placeholder(placeholder, params)
|
|
36
34
|
end
|
|
37
35
|
end
|
|
@@ -50,70 +48,17 @@ module Aws
|
|
|
50
48
|
end
|
|
51
49
|
|
|
52
50
|
def apply_querystring_params(uri, params)
|
|
53
|
-
|
|
54
|
-
parts
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
case member.shape
|
|
58
|
-
|
|
59
|
-
# supported scalar types
|
|
60
|
-
when StringShape, BooleanShape, FloatShape, IntegerShape, StringShape
|
|
61
|
-
param_name = member.location_name
|
|
62
|
-
param_value = params[member_name]
|
|
63
|
-
parts << "#{param_name}=#{escape(param_value.to_s)}"
|
|
64
|
-
|
|
65
|
-
# map of strings or map of string-list
|
|
66
|
-
when MapShape
|
|
67
|
-
if StringShape === member.shape.value.shape
|
|
68
|
-
parts += query_map_of_string(params[member_name])
|
|
69
|
-
elsif ListShape === member.shape.value.shape
|
|
70
|
-
parts += query_map_of_string_list(params[member_name])
|
|
71
|
-
else
|
|
72
|
-
msg = "only map of string and string list supported"
|
|
73
|
-
raise NotImplementedError, msg
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
when ListShape
|
|
77
|
-
if StringShape === member.shape.member.shape
|
|
78
|
-
parts += list_of_strings(member.location_name, params[member_name])
|
|
79
|
-
else
|
|
80
|
-
msg = "Only list of strings supported, got "
|
|
81
|
-
msg << member.shape.member.shape.class.name
|
|
82
|
-
raise NotImplementedError, msg
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
# unsupported querystring shape
|
|
86
|
-
else
|
|
87
|
-
raise NotImplementedError
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
uri.query = parts.empty? ? nil : parts.join('&')
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def query_map_of_string(hash)
|
|
96
|
-
list = []
|
|
97
|
-
hash.each_pair do |key, value|
|
|
98
|
-
list << "#{escape(key)}=#{escape(value)}"
|
|
99
|
-
end
|
|
100
|
-
list
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
def query_map_of_string_list(hash)
|
|
104
|
-
list = []
|
|
105
|
-
hash.each_pair do |key, values|
|
|
106
|
-
values.each do |value|
|
|
107
|
-
list << "#{escape(key)}=#{escape(value)}"
|
|
51
|
+
# collect params that are supposed to be part of the query string
|
|
52
|
+
parts = @rules.shape.members.inject([]) do |parts, (member_name, member_ref)|
|
|
53
|
+
if member_ref.location == 'querystring' && !params[member_name].nil?
|
|
54
|
+
parts << [member_ref, params[member_name]]
|
|
108
55
|
end
|
|
56
|
+
parts
|
|
109
57
|
end
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
values.map do |value|
|
|
115
|
-
"#{name}=#{escape(value)}"
|
|
116
|
-
end
|
|
58
|
+
querystring = QuerystringBuilder.new.build(parts)
|
|
59
|
+
querystring = [@query_prefix, querystring == '' ? nil : querystring].compact.join('&')
|
|
60
|
+
querystring = nil if querystring == ''
|
|
61
|
+
uri.query = querystring
|
|
117
62
|
end
|
|
118
63
|
|
|
119
64
|
def escape(string)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
module Aws
|
|
2
|
+
module Rest
|
|
3
|
+
module Request
|
|
4
|
+
class QuerystringBuilder
|
|
5
|
+
|
|
6
|
+
include Seahorse::Model::Shapes
|
|
7
|
+
|
|
8
|
+
# Provide shape references and param values:
|
|
9
|
+
#
|
|
10
|
+
# [
|
|
11
|
+
# [shape_ref1, 123],
|
|
12
|
+
# [shape_ref2, "text"]
|
|
13
|
+
# ]
|
|
14
|
+
#
|
|
15
|
+
# Returns a querystring:
|
|
16
|
+
#
|
|
17
|
+
# "Count=123&Words=text"
|
|
18
|
+
#
|
|
19
|
+
# @param [Array<Array<Seahorse::Model::ShapeRef, Object>>] params An array of
|
|
20
|
+
# model shape references and request parameter value pairs.
|
|
21
|
+
#
|
|
22
|
+
# @return [String] Returns a built querystring
|
|
23
|
+
def build(params)
|
|
24
|
+
params.map do |(shape_ref, param_value)|
|
|
25
|
+
build_part(shape_ref, param_value)
|
|
26
|
+
end.join('&')
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
def build_part(shape_ref, param_value)
|
|
32
|
+
case shape_ref.shape
|
|
33
|
+
# supported scalar types
|
|
34
|
+
when StringShape, BooleanShape, FloatShape, IntegerShape, StringShape
|
|
35
|
+
param_name = shape_ref.location_name
|
|
36
|
+
"#{param_name}=#{escape(param_value.to_s)}"
|
|
37
|
+
when MapShape
|
|
38
|
+
if StringShape === shape_ref.shape.value.shape
|
|
39
|
+
query_map_of_string(param_value)
|
|
40
|
+
elsif ListShape === shape_ref.shape.value.shape
|
|
41
|
+
query_map_of_string_list(param_value)
|
|
42
|
+
else
|
|
43
|
+
msg = "only map of string and string list supported"
|
|
44
|
+
raise NotImplementedError, msg
|
|
45
|
+
end
|
|
46
|
+
when ListShape
|
|
47
|
+
if StringShape === shape_ref.shape.member.shape
|
|
48
|
+
list_of_strings(shape_ref.location_name, param_value)
|
|
49
|
+
else
|
|
50
|
+
msg = "Only list of strings supported, got "
|
|
51
|
+
msg << shape_ref.shape.member.shape.class.name
|
|
52
|
+
raise NotImplementedError, msg
|
|
53
|
+
end
|
|
54
|
+
else
|
|
55
|
+
raise NotImplementedError
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def query_map_of_string(hash)
|
|
60
|
+
list = []
|
|
61
|
+
hash.each_pair do |key, value|
|
|
62
|
+
list << "#{escape(key)}=#{escape(value)}"
|
|
63
|
+
end
|
|
64
|
+
list
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def query_map_of_string_list(hash)
|
|
68
|
+
list = []
|
|
69
|
+
hash.each_pair do |key, values|
|
|
70
|
+
values.each do |value|
|
|
71
|
+
list << "#{escape(key)}=#{escape(value)}"
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
list
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def list_of_strings(name, values)
|
|
78
|
+
values.map do |value|
|
|
79
|
+
"#{name}=#{escape(value)}"
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def escape(string)
|
|
84
|
+
Seahorse::Util.uri_escape(string)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|