aws-sdk-core 2.0.48 → 2.1.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/autoscaling/2011-01-01/api-2.json +636 -33
- data/apis/cloudhsm/2014-05-30/api-2.json +3 -6
- data/apis/ec2/2014-10-01/api-2.json +10267 -0
- data/apis/ec2/2014-10-01/paginators-1.json +125 -0
- data/apis/ec2/2014-10-01/resources-1.json +2289 -0
- data/apis/ec2/2014-10-01/waiters-2.json +453 -0
- data/apis/ec2/2015-03-01/api-2.json +11245 -0
- data/apis/ec2/2015-03-01/paginators-1.json +125 -0
- data/apis/ec2/2015-03-01/resources-1.json +2479 -0
- data/apis/ec2/2015-03-01/waiters-2.json +458 -0
- data/apis/ec2/2015-04-15/api-2.json +182 -2
- data/apis/ecs/2014-11-13/api-2.json +316 -7
- data/apis/ecs/2014-11-13/paginators-1.json +40 -0
- data/apis/ecs/2014-11-13/waiters-2.json +93 -0
- data/apis/redshift/2012-12-01/waiters-2.json +19 -0
- data/apis/s3/2006-03-01/api-2.json +1 -2
- data/apis/sqs/2012-11-05/api-2.json +5 -6
- data/ca-bundle.crt +3554 -0
- data/lib/aws-sdk-core.rb +127 -44
- data/lib/aws-sdk-core/api/builder.rb +95 -0
- data/lib/aws-sdk-core/api/customizations.rb +152 -0
- data/lib/aws-sdk-core/api/docs/builder.rb +220 -0
- data/lib/aws-sdk-core/api/docs/client_type_documenter.rb +109 -0
- data/lib/aws-sdk-core/api/docs/docstring_provider.rb +66 -0
- data/lib/aws-sdk-core/api/docs/operation_documenter.rb +107 -0
- data/lib/aws-sdk-core/api/docs/param_formatter.rb +163 -0
- data/lib/aws-sdk-core/api/docs/request_syntax_example.rb +22 -0
- data/lib/aws-sdk-core/api/docs/response_structure_example.rb +91 -0
- data/lib/aws-sdk-core/api/docs/utils.rb +133 -0
- data/lib/aws-sdk-core/api/shape_map.rb +140 -0
- data/lib/aws-sdk-core/assume_role_credentials.rb +9 -6
- data/lib/aws-sdk-core/client.rb +9 -6
- data/lib/aws-sdk-core/client_stubs.rb +127 -133
- data/lib/aws-sdk-core/client_waiters.rb +1 -1
- data/lib/aws-sdk-core/credential_provider.rb +44 -0
- data/lib/aws-sdk-core/credential_provider_chain.rb +3 -2
- data/lib/aws-sdk-core/credentials.rb +5 -0
- data/lib/aws-sdk-core/deprecations.rb +69 -0
- data/lib/aws-sdk-core/dynamodb.rb +12 -0
- data/lib/aws-sdk-core/eager_loader.rb +31 -0
- data/lib/aws-sdk-core/ecs.rb +2 -0
- data/lib/aws-sdk-core/empty_structure.rb +1 -82
- data/lib/aws-sdk-core/endpoint_provider.rb +1 -1
- data/lib/aws-sdk-core/instance_profile_credentials.rb +9 -10
- data/lib/aws-sdk-core/json.rb +56 -0
- data/lib/aws-sdk-core/json/builder.rb +33 -34
- data/lib/aws-sdk-core/json/error_handler.rb +2 -2
- data/lib/aws-sdk-core/json/handler.rb +67 -0
- data/lib/aws-sdk-core/json/json_engine.rb +15 -0
- data/lib/aws-sdk-core/json/oj_engine.rb +15 -0
- data/lib/aws-sdk-core/json/parser.rb +30 -38
- data/lib/aws-sdk-core/pageable_response.rb +9 -12
- data/lib/aws-sdk-core/pager.rb +69 -0
- data/lib/aws-sdk-core/param_converter.rb +203 -0
- data/lib/aws-sdk-core/param_validator.rb +148 -0
- data/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb +21 -18
- data/lib/aws-sdk-core/plugins/glacier_account_id.rb +9 -1
- data/lib/aws-sdk-core/plugins/glacier_checksums.rb +2 -3
- data/lib/aws-sdk-core/plugins/param_converter.rb +27 -0
- data/lib/aws-sdk-core/plugins/param_validator.rb +28 -0
- data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +3 -7
- data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +1 -2
- data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +1 -1
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +1 -1
- data/lib/aws-sdk-core/plugins/request_signer.rb +5 -5
- data/lib/aws-sdk-core/plugins/response_paging.rb +20 -11
- data/lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb +1 -1
- data/lib/aws-sdk-core/plugins/s3_request_signer.rb +1 -2
- data/lib/aws-sdk-core/plugins/stub_responses.rb +25 -27
- data/lib/aws-sdk-core/query/ec2_param_builder.rb +29 -34
- data/lib/aws-sdk-core/query/handler.rb +32 -18
- data/lib/aws-sdk-core/query/param_builder.rb +45 -53
- data/lib/aws-sdk-core/refreshing_credentials.rb +3 -15
- data/lib/aws-sdk-core/rest/handler.rb +22 -0
- data/lib/aws-sdk-core/rest/request/body.rb +58 -0
- data/lib/aws-sdk-core/rest/request/builder.rb +50 -0
- data/lib/aws-sdk-core/rest/request/endpoint.rb +70 -0
- data/lib/aws-sdk-core/rest/request/headers.rb +48 -0
- data/lib/aws-sdk-core/rest/response/body.rb +43 -0
- data/lib/aws-sdk-core/rest/response/headers.rb +60 -0
- data/lib/aws-sdk-core/rest/response/parser.rb +47 -0
- data/lib/aws-sdk-core/rest/response/status_code.rb +24 -0
- data/lib/aws-sdk-core/shared_credentials.rb +11 -6
- data/lib/aws-sdk-core/signers/base.rb +1 -1
- data/lib/aws-sdk-core/signers/s3.rb +2 -3
- data/lib/aws-sdk-core/signers/v2.rb +7 -4
- data/lib/aws-sdk-core/signers/v4.rb +11 -22
- data/lib/aws-sdk-core/structure.rb +26 -145
- data/lib/aws-sdk-core/stubbing/data_applicator.rb +46 -0
- data/lib/aws-sdk-core/stubbing/empty_stub.rb +53 -0
- data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +49 -0
- data/lib/aws-sdk-core/stubbing/protocols/json.rb +40 -0
- data/lib/aws-sdk-core/stubbing/protocols/query.rb +40 -0
- data/lib/aws-sdk-core/stubbing/protocols/rest.rb +67 -0
- data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +25 -0
- data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +38 -0
- data/lib/aws-sdk-core/stubbing/stub_data.rb +34 -0
- data/lib/aws-sdk-core/version.rb +1 -1
- data/lib/aws-sdk-core/xml/builder.rb +58 -52
- data/lib/aws-sdk-core/xml/default_map.rb +10 -0
- data/lib/aws-sdk-core/xml/doc_builder.rb +86 -0
- data/lib/aws-sdk-core/xml/error_handler.rb +7 -2
- data/lib/aws-sdk-core/xml/parser.rb +4 -4
- data/lib/aws-sdk-core/xml/parser/frame.rb +75 -70
- data/lib/aws-sdk-core/xml/parser/stack.rb +4 -4
- data/lib/seahorse.rb +0 -11
- data/lib/seahorse/client/base.rb +3 -12
- data/lib/seahorse/client/http/request.rb +9 -5
- data/lib/seahorse/client/plugins/endpoint.rb +5 -56
- data/lib/seahorse/client/plugins/restful_bindings.rb +38 -31
- data/lib/seahorse/client/request_context.rb +2 -2
- data/lib/seahorse/client/response.rb +6 -5
- data/lib/seahorse/model/api.rb +18 -61
- data/lib/seahorse/model/operation.rb +24 -54
- data/lib/seahorse/model/shapes.rb +120 -364
- data/lib/seahorse/util.rb +2 -6
- metadata +56 -109
- data/apis/autoscaling/2011-01-01/docs-2.json +0 -1246
- data/apis/cloudformation/2010-05-15/docs-2.json +0 -725
- data/apis/cloudfront/2014-11-06/docs-2.json +0 -1125
- data/apis/cloudhsm/2014-05-30/docs-2.json +0 -472
- data/apis/cloudsearch/2013-01-01/docs-2.json +0 -865
- data/apis/cloudsearchdomain/2013-01-01/docs-2.json +0 -311
- data/apis/cloudtrail/2013-11-01/docs-2.json +0 -328
- data/apis/codedeploy/2014-10-06/docs-2.json +0 -1261
- data/apis/cognito-identity/2014-06-30/docs-2.json +0 -506
- data/apis/cognito-sync/2014-06-30/docs-2.json +0 -582
- data/apis/config/2014-10-17/docs-2.json +0 -513
- data/apis/config/2014-11-12/docs-2.json +0 -514
- data/apis/datapipeline/2012-10-29/docs-2.json +0 -607
- data/apis/directconnect/2012-10-25/docs-2.json +0 -494
- data/apis/ds/2015-04-16/docs-2.json +0 -753
- data/apis/dynamodb/2011-12-05/api-2.json +0 -949
- data/apis/dynamodb/2011-12-05/docs-2.json +0 -606
- data/apis/dynamodb/2011-12-05/paginators-1.json +0 -26
- data/apis/dynamodb/2011-12-05/waiters-2.json +0 -35
- data/apis/dynamodb/2012-08-10/docs-2.json +0 -977
- data/apis/ec2/2015-04-15/docs-2.json +0 -5368
- data/apis/ecs/2014-11-13/docs-2.json +0 -791
- data/apis/elasticache/2015-02-02/docs-2.json +0 -1390
- data/apis/elasticbeanstalk/2010-12-01/docs-2.json +0 -1114
- data/apis/elasticfilesystem/2015-02-01/docs-2.json +0 -414
- data/apis/elasticloadbalancing/2012-06-01/docs-2.json +0 -1078
- data/apis/elasticmapreduce/2009-03-31/docs-2.json +0 -969
- data/apis/elastictranscoder/2012-09-25/docs-2.json +0 -1152
- data/apis/email/2010-12-01/docs-2.json +0 -441
- data/apis/glacier/2012-06-01/docs-2.json +0 -575
- data/apis/iam/2010-05-08/docs-2.json +0 -2138
- data/apis/importexport/2010-06-01/docs-2.json +0 -432
- data/apis/kinesis/2013-12-02/docs-2.json +0 -424
- data/apis/kms/2014-11-01/docs-2.json +0 -628
- data/apis/lambda/2014-11-11/docs-2.json +0 -303
- data/apis/lambda/2015-03-31/docs-2.json +0 -490
- data/apis/logs/2014-03-28/docs-2.json +0 -599
- data/apis/machinelearning/2014-12-12/docs-2.json +0 -1034
- data/apis/monitoring/2010-08-01/docs-2.json +0 -514
- data/apis/opsworks/2013-02-18/docs-2.json +0 -1592
- data/apis/rds/2014-10-31/docs-2.json +0 -2074
- data/apis/redshift/2012-12-01/docs-2.json +0 -1890
- data/apis/route53/2013-04-01/docs-2.json +0 -1159
- data/apis/route53domains/2014-05-15/docs-2.json +0 -620
- data/apis/s3/2006-03-01/docs-2.json +0 -2213
- data/apis/sdb/2009-04-15/docs-2.json +0 -339
- data/apis/sns/2010-03-31/docs-2.json +0 -564
- data/apis/sqs/2012-11-05/docs-2.json +0 -503
- data/apis/ssm/2014-11-06/docs-2.json +0 -440
- data/apis/storagegateway/2013-06-30/docs-2.json +0 -1331
- data/apis/sts/2011-06-15/docs-2.json +0 -351
- data/apis/support/2013-04-15/docs-2.json +0 -680
- data/apis/swf/2012-01-25/docs-2.json +0 -1569
- data/apis/workspaces/2015-04-08/docs-2.json +0 -457
- data/lib/aws-sdk-core/api/customizer.rb +0 -75
- data/lib/aws-sdk-core/api/docstrings.rb +0 -38
- data/lib/aws-sdk-core/api/documenter.rb +0 -241
- data/lib/aws-sdk-core/api/operation_documenter.rb +0 -173
- data/lib/aws-sdk-core/api/operation_example.rb +0 -133
- data/lib/aws-sdk-core/api/service_customizations.rb +0 -140
- data/lib/aws-sdk-core/client_paging.rb +0 -31
- data/lib/aws-sdk-core/json/rest_handler.rb +0 -20
- data/lib/aws-sdk-core/json/rpc_body_handler.rb +0 -38
- data/lib/aws-sdk-core/json/rpc_headers_handler.rb +0 -34
- data/lib/aws-sdk-core/json/simple_body_handler.rb +0 -34
- data/lib/aws-sdk-core/paging/null_pager.rb +0 -20
- data/lib/aws-sdk-core/paging/null_provider.rb +0 -13
- data/lib/aws-sdk-core/paging/pager.rb +0 -70
- data/lib/aws-sdk-core/paging/provider.rb +0 -22
- data/lib/aws-sdk-core/rest_body_handler.rb +0 -111
- data/lib/aws-sdk-core/signers/handler.rb +0 -18
- data/lib/aws-sdk-core/xml/rest_handler.rb +0 -20
- data/lib/seahorse/client/param_converter.rb +0 -207
- data/lib/seahorse/client/param_validator.rb +0 -139
- data/lib/seahorse/client/plugins/json_simple.rb +0 -33
- data/lib/seahorse/client/plugins/param_conversion.rb +0 -29
- data/lib/seahorse/client/plugins/param_validation.rb +0 -30
- data/lib/seahorse/client/xml/builder.rb +0 -91
- data/lib/seahorse/model/shape_map.rb +0 -47
data/lib/aws-sdk-core.rb
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
require 'jmespath'
|
|
2
|
-
require 'multi_json'
|
|
3
2
|
require 'seahorse'
|
|
4
3
|
|
|
5
4
|
Seahorse::Util.irregular_inflections({
|
|
@@ -79,17 +78,22 @@ module Aws
|
|
|
79
78
|
|
|
80
79
|
autoload :AssumeRoleCredentials, 'aws-sdk-core/assume_role_credentials'
|
|
81
80
|
autoload :Client, 'aws-sdk-core/client'
|
|
82
|
-
autoload :ClientPaging, 'aws-sdk-core/client_paging'
|
|
83
81
|
autoload :ClientStubs, 'aws-sdk-core/client_stubs'
|
|
84
82
|
autoload :ClientWaiters, 'aws-sdk-core/client_waiters'
|
|
83
|
+
autoload :CredentialProvider, 'aws-sdk-core/credential_provider'
|
|
85
84
|
autoload :CredentialProviderChain, 'aws-sdk-core/credential_provider_chain'
|
|
86
85
|
autoload :Credentials, 'aws-sdk-core/credentials'
|
|
86
|
+
autoload :Deprecations, 'aws-sdk-core/deprecations'
|
|
87
|
+
autoload :EagerLoader, 'aws-sdk-core/eager_loader'
|
|
87
88
|
autoload :EmptyStructure, 'aws-sdk-core/empty_structure'
|
|
88
89
|
autoload :EndpointProvider, 'aws-sdk-core/endpoint_provider'
|
|
89
90
|
autoload :Errors, 'aws-sdk-core/errors'
|
|
90
91
|
autoload :InstanceProfileCredentials, 'aws-sdk-core/instance_profile_credentials'
|
|
92
|
+
autoload :Json, 'aws-sdk-core/json'
|
|
91
93
|
autoload :PageableResponse, 'aws-sdk-core/pageable_response'
|
|
92
|
-
autoload :
|
|
94
|
+
autoload :Pager, 'aws-sdk-core/pager'
|
|
95
|
+
autoload :ParamConverter, 'aws-sdk-core/param_converter'
|
|
96
|
+
autoload :ParamValidator, 'aws-sdk-core/param_validator'
|
|
93
97
|
autoload :RefreshingCredentials, 'aws-sdk-core/refreshing_credentials'
|
|
94
98
|
autoload :Service, 'aws-sdk-core/service'
|
|
95
99
|
autoload :SharedCredentials, 'aws-sdk-core/shared_credentials'
|
|
@@ -99,33 +103,20 @@ module Aws
|
|
|
99
103
|
|
|
100
104
|
# @api private
|
|
101
105
|
module Api
|
|
102
|
-
autoload :
|
|
103
|
-
autoload :
|
|
104
|
-
autoload :
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
autoload :Parser, 'aws-sdk-core/json/parser'
|
|
117
|
-
autoload :RestHandler, 'aws-sdk-core/json/rest_handler'
|
|
118
|
-
autoload :RpcBodyHandler, 'aws-sdk-core/json/rpc_body_handler'
|
|
119
|
-
autoload :RpcHeadersHandler, 'aws-sdk-core/json/rpc_headers_handler'
|
|
120
|
-
autoload :SimpleBodyHandler, 'aws-sdk-core/json/simple_body_handler'
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
# @api private
|
|
124
|
-
module Paging
|
|
125
|
-
autoload :NullPager, 'aws-sdk-core/paging/null_pager'
|
|
126
|
-
autoload :NullProvider, 'aws-sdk-core/paging/null_provider'
|
|
127
|
-
autoload :Pager, 'aws-sdk-core/paging/pager'
|
|
128
|
-
autoload :Provider, 'aws-sdk-core/paging/provider'
|
|
106
|
+
autoload :Builder, 'aws-sdk-core/api/builder'
|
|
107
|
+
autoload :Customizations, 'aws-sdk-core/api/customizations'
|
|
108
|
+
autoload :ShapeMap, 'aws-sdk-core/api/shape_map'
|
|
109
|
+
module Docs
|
|
110
|
+
autoload :Builder, 'aws-sdk-core/api/docs/builder'
|
|
111
|
+
autoload :ClientTypeDocumenter, 'aws-sdk-core/api/docs/client_type_documenter'
|
|
112
|
+
autoload :DocstringProvider, 'aws-sdk-core/api/docs/docstring_provider'
|
|
113
|
+
autoload :NullDocstringProvider, 'aws-sdk-core/api/docs/docstring_provider'
|
|
114
|
+
autoload :OperationDocumenter, 'aws-sdk-core/api/docs/operation_documenter'
|
|
115
|
+
autoload :ParamFormatter, 'aws-sdk-core/api/docs/param_formatter'
|
|
116
|
+
autoload :RequestSyntaxExample, 'aws-sdk-core/api/docs/request_syntax_example'
|
|
117
|
+
autoload :ResponseStructureExample, 'aws-sdk-core/api/docs/response_structure_example'
|
|
118
|
+
autoload :Utils, 'aws-sdk-core/api/docs/utils'
|
|
119
|
+
end
|
|
129
120
|
end
|
|
130
121
|
|
|
131
122
|
module Plugins
|
|
@@ -139,6 +130,8 @@ module Aws
|
|
|
139
130
|
autoload :GlacierChecksums, 'aws-sdk-core/plugins/glacier_checksums'
|
|
140
131
|
autoload :GlobalConfiguration, 'aws-sdk-core/plugins/global_configuration'
|
|
141
132
|
autoload :MachineLearningPredictEndpoint, 'aws-sdk-core/plugins/machine_learning_predict_endpoint'
|
|
133
|
+
autoload :ParamConverter, 'aws-sdk-core/plugins/param_converter'
|
|
134
|
+
autoload :ParamValidator, 'aws-sdk-core/plugins/param_validator'
|
|
142
135
|
autoload :RegionalEndpoint, 'aws-sdk-core/plugins/regional_endpoint'
|
|
143
136
|
autoload :ResponsePaging, 'aws-sdk-core/plugins/response_paging'
|
|
144
137
|
autoload :RequestSigner, 'aws-sdk-core/plugins/request_signer'
|
|
@@ -178,6 +171,23 @@ module Aws
|
|
|
178
171
|
autoload :ParamList, 'aws-sdk-core/query/param_list'
|
|
179
172
|
end
|
|
180
173
|
|
|
174
|
+
# @api private
|
|
175
|
+
module Rest
|
|
176
|
+
autoload :Handler, 'aws-sdk-core/rest/handler'
|
|
177
|
+
module Request
|
|
178
|
+
autoload :Body, 'aws-sdk-core/rest/request/body'
|
|
179
|
+
autoload :Builder, 'aws-sdk-core/rest/request/builder'
|
|
180
|
+
autoload :Endpoint, 'aws-sdk-core/rest/request/endpoint'
|
|
181
|
+
autoload :Headers, 'aws-sdk-core/rest/request/headers'
|
|
182
|
+
end
|
|
183
|
+
module Response
|
|
184
|
+
autoload :Body, 'aws-sdk-core/rest/response/body'
|
|
185
|
+
autoload :Headers, 'aws-sdk-core/rest/response/headers'
|
|
186
|
+
autoload :Parser, 'aws-sdk-core/rest/response/parser'
|
|
187
|
+
autoload :StatusCode, 'aws-sdk-core/rest/response/status_code'
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
181
191
|
# @api private
|
|
182
192
|
module Signers
|
|
183
193
|
autoload :Base, 'aws-sdk-core/signers/base'
|
|
@@ -188,6 +198,21 @@ module Aws
|
|
|
188
198
|
autoload :V4, 'aws-sdk-core/signers/v4'
|
|
189
199
|
end
|
|
190
200
|
|
|
201
|
+
# @api private
|
|
202
|
+
module Stubbing
|
|
203
|
+
autoload :EmptyStub, 'aws-sdk-core/stubbing/empty_stub'
|
|
204
|
+
autoload :StubData, 'aws-sdk-core/stubbing/stub_data'
|
|
205
|
+
autoload :DataApplicator, 'aws-sdk-core/stubbing/data_applicator'
|
|
206
|
+
module Protocols
|
|
207
|
+
autoload :EC2, 'aws-sdk-core/stubbing/protocols/ec2'
|
|
208
|
+
autoload :Json, 'aws-sdk-core/stubbing/protocols/json'
|
|
209
|
+
autoload :Query, 'aws-sdk-core/stubbing/protocols/query'
|
|
210
|
+
autoload :Rest, 'aws-sdk-core/stubbing/protocols/rest'
|
|
211
|
+
autoload :RestJson, 'aws-sdk-core/stubbing/protocols/rest_json'
|
|
212
|
+
autoload :RestXml, 'aws-sdk-core/stubbing/protocols/rest_xml'
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
191
216
|
module Waiters
|
|
192
217
|
autoload :Poller, 'aws-sdk-core/waiters/poller'
|
|
193
218
|
autoload :Errors, 'aws-sdk-core/waiters/errors'
|
|
@@ -200,9 +225,10 @@ module Aws
|
|
|
200
225
|
module Xml
|
|
201
226
|
autoload :Builder, 'aws-sdk-core/xml/builder'
|
|
202
227
|
autoload :DefaultList, 'aws-sdk-core/xml/default_list'
|
|
228
|
+
autoload :DefaultMap, 'aws-sdk-core/xml/default_map'
|
|
229
|
+
autoload :DocBuilder, 'aws-sdk-core/xml/doc_builder'
|
|
203
230
|
autoload :ErrorHandler, 'aws-sdk-core/xml/error_handler'
|
|
204
231
|
autoload :Parser, 'aws-sdk-core/xml/parser'
|
|
205
|
-
autoload :RestHandler, 'aws-sdk-core/xml/rest_handler'
|
|
206
232
|
end
|
|
207
233
|
|
|
208
234
|
class << self
|
|
@@ -220,6 +246,55 @@ module Aws
|
|
|
220
246
|
end
|
|
221
247
|
end
|
|
222
248
|
|
|
249
|
+
# The SDK ships with a ca certificate bundle to use when verifying SSL
|
|
250
|
+
# peer certificates. By default, this cert bundle is *NOT* used. The
|
|
251
|
+
# SDK will rely on the default cert available to OpenSSL. This ensures
|
|
252
|
+
# the cert provided by your OS is used.
|
|
253
|
+
#
|
|
254
|
+
# For cases where the default cert is unavailable, e.g. Windows, you
|
|
255
|
+
# can call this method.
|
|
256
|
+
#
|
|
257
|
+
# Aws.use_bundled_cert!
|
|
258
|
+
#
|
|
259
|
+
# @return [String] Returns the path to the bundled cert.
|
|
260
|
+
def use_bundled_cert!
|
|
261
|
+
config.delete(:ssl_ca_directory)
|
|
262
|
+
config.delete(:ssl_ca_store)
|
|
263
|
+
config[:ssl_ca_bundle] = File.expand_path(File.join(
|
|
264
|
+
File.dirname(__FILE__),
|
|
265
|
+
'..',
|
|
266
|
+
'ca-bundle.crt'
|
|
267
|
+
))
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Loads modules that are normally loaded with Ruby's `autoload`.
|
|
271
|
+
# This can avoid thread-safety issues that some Ruby versions have
|
|
272
|
+
# with `autoload`.
|
|
273
|
+
#
|
|
274
|
+
# # loads ALL services
|
|
275
|
+
# Aws.eager_autoload!
|
|
276
|
+
#
|
|
277
|
+
# Loading all services can be slow. You can specify what services you
|
|
278
|
+
# want to load with the `:services` option. All services not named
|
|
279
|
+
# will continue to autoload as normal.
|
|
280
|
+
#
|
|
281
|
+
# Aws.eager_auotload(services: %w(S3 EC2))
|
|
282
|
+
#
|
|
283
|
+
# @return [void]
|
|
284
|
+
def eager_autoload!(options = {})
|
|
285
|
+
eager_loader = EagerLoader.new
|
|
286
|
+
eager_loader.load(JMESPath)
|
|
287
|
+
eager_loader.load(Seahorse)
|
|
288
|
+
(options[:services] || SERVICE_MODULE_NAMES).each do |svc_name|
|
|
289
|
+
begin
|
|
290
|
+
eager_loader.load(Aws.const_get(svc_name))
|
|
291
|
+
rescue NameError
|
|
292
|
+
raise ArgumentError, "invalid service Aws::#{svc_name}"
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
eager_loader
|
|
296
|
+
end
|
|
297
|
+
|
|
223
298
|
# Yields to the given block for each service that has already been
|
|
224
299
|
# defined via {add_service}. Also yields to the given block for
|
|
225
300
|
# each new service added after the callback is registered.
|
|
@@ -232,11 +307,6 @@ module Aws
|
|
|
232
307
|
@service_added_callbacks << callback
|
|
233
308
|
end
|
|
234
309
|
|
|
235
|
-
# @api private
|
|
236
|
-
def load_json(path)
|
|
237
|
-
Seahorse::Util.load_json(path)
|
|
238
|
-
end
|
|
239
|
-
|
|
240
310
|
# Registers a new service.
|
|
241
311
|
#
|
|
242
312
|
# Aws.add_service('SvcName',
|
|
@@ -251,7 +321,7 @@ module Aws
|
|
|
251
321
|
# @param [String] svc_name The name of the service. This will also be
|
|
252
322
|
# the namespace under {Aws}. This must be a valid constant name.
|
|
253
323
|
# @option options[String,Pathname,Hash,Seahorse::Model::Api,nil] :api
|
|
254
|
-
# @option options[String,Pathname,Hash,
|
|
324
|
+
# @option options[String,Pathname,Hash,nil] :paginators
|
|
255
325
|
# @option options[String,Pathname,Hash,Waiters::Provider,nil] :waiters
|
|
256
326
|
# @option options[String,Pathname,Hash,Resources::Definition,nil] :resources
|
|
257
327
|
# @return [Module<Service>] Returns the new service module.
|
|
@@ -265,13 +335,6 @@ module Aws
|
|
|
265
335
|
svc_module
|
|
266
336
|
end
|
|
267
337
|
|
|
268
|
-
# @api private
|
|
269
|
-
def load_all_services
|
|
270
|
-
SERVICE_MODULE_NAMES.each do |const_name|
|
|
271
|
-
const_get(const_name)
|
|
272
|
-
end
|
|
273
|
-
end
|
|
274
|
-
|
|
275
338
|
end
|
|
276
339
|
|
|
277
340
|
# build service client classes
|
|
@@ -280,4 +343,24 @@ module Aws
|
|
|
280
343
|
svc_module.const_set(:Errors, Module.new { extend Errors::DynamicErrors })
|
|
281
344
|
end
|
|
282
345
|
|
|
346
|
+
# define a struct class for each client data type
|
|
347
|
+
service_added do |name, svc_module, options|
|
|
348
|
+
svc_module.const_set(:Types, Module.new)
|
|
349
|
+
svc_module::Client.api.metadata['shapes'].each_structure do |shape|
|
|
350
|
+
svc_module::Types.const_set(shape.name, shape[:struct_class])
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# enable response paging
|
|
355
|
+
service_added do |name, svc_module, options|
|
|
356
|
+
if paginators = options[:paginators]
|
|
357
|
+
paginators = Json.load_file(paginators) unless Hash === paginators
|
|
358
|
+
svc_module::Client.api.operations.each do |_, operation|
|
|
359
|
+
if rules = paginators['pagination'][operation.name]
|
|
360
|
+
operation[:pager] = Pager.new(rules)
|
|
361
|
+
end
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
|
|
283
366
|
end
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
require 'set'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Api
|
|
5
|
+
class Builder
|
|
6
|
+
class << self
|
|
7
|
+
|
|
8
|
+
def build(definition, options = {})
|
|
9
|
+
if Seahorse::Model::Api === definition
|
|
10
|
+
definition
|
|
11
|
+
else
|
|
12
|
+
Builder.new.build(customize(load_definition(definition)), options)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def load_definition(definition)
|
|
19
|
+
case definition
|
|
20
|
+
when nil then {}
|
|
21
|
+
when Hash then definition
|
|
22
|
+
when String, Pathname then Json.load_file(definition)
|
|
23
|
+
else raise ArgumentError, "invalid api definition #{definition}"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def customize(definition)
|
|
28
|
+
Customizations.apply_api_customizations(definition)
|
|
29
|
+
definition
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# @param [Hash] definition
|
|
35
|
+
# @return [Seahorse::Model::Api]
|
|
36
|
+
def build(definition, options = {})
|
|
37
|
+
docs = build_docstring_provider(options)
|
|
38
|
+
api = build_api(definition)
|
|
39
|
+
shapes = build_shape_map(definition, api, docs)
|
|
40
|
+
build_operations(definition, api, shapes, docs)
|
|
41
|
+
api
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
def build_docstring_provider(options)
|
|
47
|
+
if options[:docs] && ENV['DOCSTRINGS']
|
|
48
|
+
Docs::DocstringProvider.new(Json.load_file(options[:docs]))
|
|
49
|
+
else
|
|
50
|
+
Docs::NullDocstringProvider.new
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def build_api(definition)
|
|
55
|
+
api = Seahorse::Model::Api.new
|
|
56
|
+
api.metadata = definition['metadata'] || {}
|
|
57
|
+
api.version = api.metadata['apiVersion']
|
|
58
|
+
api
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def build_shape_map(definition, api, docs)
|
|
62
|
+
shapes = definition['shapes'] || {}
|
|
63
|
+
api.metadata['shapes'] = ShapeMap.new(shapes, docs: docs)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def build_operations(definitions, api, shapes, docs)
|
|
67
|
+
(definitions['operations'] || {}).each do |name, definition|
|
|
68
|
+
operation = build_operation(name, definition, shapes, docs)
|
|
69
|
+
api.add_operation(underscore(name), operation)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def build_operation(name, definition, shapes, docs)
|
|
74
|
+
http = definition['http'] || {}
|
|
75
|
+
op = Seahorse::Model::Operation.new
|
|
76
|
+
op.name = name
|
|
77
|
+
op.http_method = http['method']
|
|
78
|
+
op.http_request_uri = http['requestUri'] || '/'
|
|
79
|
+
op.documentation = docs.operation_docs(name)
|
|
80
|
+
op.deprecated = !!definition['deprecated']
|
|
81
|
+
op.input = shapes.shape_ref(definition['input'])
|
|
82
|
+
op.output = shapes.shape_ref(definition['output'])
|
|
83
|
+
(definition['errors'] || []).each do |error|
|
|
84
|
+
op.errors << shapes.shape_ref(error)
|
|
85
|
+
end
|
|
86
|
+
op
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def underscore(str)
|
|
90
|
+
Seahorse::Util.underscore(str).to_sym
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
module Aws
|
|
2
|
+
module Api
|
|
3
|
+
module Customizations
|
|
4
|
+
|
|
5
|
+
@apis = {}
|
|
6
|
+
@plugins = {}
|
|
7
|
+
|
|
8
|
+
class << self
|
|
9
|
+
|
|
10
|
+
def api(prefix, &block)
|
|
11
|
+
@apis[prefix] = block
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def plugins(prefix, options)
|
|
15
|
+
@plugins[prefix] = {
|
|
16
|
+
add: options[:add] || [],
|
|
17
|
+
remove: options[:remove] || [],
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def apply_api_customizations(api)
|
|
22
|
+
metadata = api['metadata'] || {}
|
|
23
|
+
prefix = metadata['endpointPrefix']
|
|
24
|
+
@apis[prefix].call(api) if @apis[prefix]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def apply_plugins(client_class)
|
|
28
|
+
protocol = client_class.api.metadata['protocol']
|
|
29
|
+
plugin = case protocol
|
|
30
|
+
when 'ec2' then Aws::Plugins::Protocols::EC2
|
|
31
|
+
when 'query' then Aws::Plugins::Protocols::Query
|
|
32
|
+
when 'json' then Aws::Plugins::Protocols::JsonRpc
|
|
33
|
+
when 'rest-json' then Aws::Plugins::Protocols::RestJson
|
|
34
|
+
when 'rest-xml' then Aws::Plugins::Protocols::RestXml
|
|
35
|
+
end
|
|
36
|
+
client_class.add_plugin(plugin) if plugin
|
|
37
|
+
prefix = client_class.api.metadata['endpointPrefix']
|
|
38
|
+
if @plugins[prefix]
|
|
39
|
+
@plugins[prefix][:add].each { |p| client_class.add_plugin(p) }
|
|
40
|
+
@plugins[prefix][:remove].each { |p| client_class.remove_plugin(p) }
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
api('cloudfront') do |api|
|
|
47
|
+
|
|
48
|
+
api['shapes'].each do |_, shape|
|
|
49
|
+
if shape['members'] && shape['members']['MaxItems']
|
|
50
|
+
shape['members']['MaxItems']['shape'] = 'integer'
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
api['operations'].keys.each do |name|
|
|
55
|
+
symbolized = name.sub(/\d{4}_\d{2}_\d{2}$/, '')
|
|
56
|
+
api['operations'][symbolized] = api['operations'].delete(name)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
plugins('cloudsearchdomain',
|
|
62
|
+
add: %w(Aws::Plugins::CSDConditionalSigning),
|
|
63
|
+
remove: %w(Aws::Plugins::RegionalEndpoint),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
plugins('dynamodb', add: %w(
|
|
67
|
+
Aws::Plugins::DynamoDBExtendedRetries
|
|
68
|
+
Aws::Plugins::DynamoDBSimpleAttributes
|
|
69
|
+
Aws::Plugins::DynamoDBCRC32Validation
|
|
70
|
+
))
|
|
71
|
+
|
|
72
|
+
plugins('ec2', add: %w(
|
|
73
|
+
Aws::Plugins::EC2CopyEncryptedSnapshot
|
|
74
|
+
))
|
|
75
|
+
|
|
76
|
+
api('glacier') do |api|
|
|
77
|
+
api['shapes']['Date'] = { 'type' => 'timestamp' }
|
|
78
|
+
api['shapes'].each do |_, shape|
|
|
79
|
+
if shape['members']
|
|
80
|
+
shape['members'].each do |name, ref|
|
|
81
|
+
case name
|
|
82
|
+
when /date/i then ref['shape'] = 'Date'
|
|
83
|
+
when 'limit' then ref['shape'] = 'Size'
|
|
84
|
+
when 'partSize' then ref['shape'] = 'Size'
|
|
85
|
+
when 'archiveSize' then ref['shape'] = 'Size'
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
plugins('glacier', add: %w(
|
|
93
|
+
Aws::Plugins::GlacierAccountId
|
|
94
|
+
Aws::Plugins::GlacierApiVersion
|
|
95
|
+
Aws::Plugins::GlacierChecksums
|
|
96
|
+
))
|
|
97
|
+
|
|
98
|
+
api('importexport') do |api|
|
|
99
|
+
api['operations'].each do |_, operation|
|
|
100
|
+
operation['http']['requestUri'] = '/'
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
api('lambda') do |api|
|
|
105
|
+
api['shapes']['Timestamp']['type'] = 'timestamp'
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
plugins('machinelearning', add: %w(
|
|
109
|
+
Aws::Plugins::MachineLearningPredictEndpoint
|
|
110
|
+
))
|
|
111
|
+
|
|
112
|
+
api('route53') do |api|
|
|
113
|
+
api['shapes']['PageMaxItems']['type'] = 'integer'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
plugins('route53', add: %w(
|
|
117
|
+
Aws::Plugins::Route53IdFix
|
|
118
|
+
))
|
|
119
|
+
|
|
120
|
+
api('s3') do |api|
|
|
121
|
+
api['metadata'].delete('signatureVersion')
|
|
122
|
+
api['operations']['GetBucketLocation'].delete('output')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
plugins('s3', add: %w(
|
|
126
|
+
Aws::Plugins::S3BucketDns
|
|
127
|
+
Aws::Plugins::S3Expect100Continue
|
|
128
|
+
Aws::Plugins::S3CompleteMultipartUploadFix
|
|
129
|
+
Aws::Plugins::S3GetBucketLocationFix
|
|
130
|
+
Aws::Plugins::S3LocationConstraint
|
|
131
|
+
Aws::Plugins::S3Md5s
|
|
132
|
+
Aws::Plugins::S3Redirects
|
|
133
|
+
Aws::Plugins::S3SseCpk
|
|
134
|
+
Aws::Plugins::S3UrlEncodedKeys
|
|
135
|
+
Aws::Plugins::S3RequestSigner
|
|
136
|
+
))
|
|
137
|
+
|
|
138
|
+
api('sqs') do |api|
|
|
139
|
+
api['metadata']['errorPrefix'] = 'AWS.SimpleQueueService.'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
plugins('sqs', add: %w(
|
|
143
|
+
Aws::Plugins::SQSQueueUrls
|
|
144
|
+
))
|
|
145
|
+
|
|
146
|
+
plugins('swf', add: %w(
|
|
147
|
+
Aws::Plugins::SWFReadTimeouts
|
|
148
|
+
))
|
|
149
|
+
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|