aws-sdk 1.39.0 → 1.40.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1944c9e7028cdb44606ba7face978c623e671606
4
- data.tar.gz: 66772a9d7f1682dfad98b9bc21615d74f3acdb9c
3
+ metadata.gz: 9ff845ab34b9f0b173f208041f10c01b8f785d9b
4
+ data.tar.gz: 1be0ec46d195079cdd6719035235dd8c5d7742db
5
5
  SHA512:
6
- metadata.gz: 4ae299a34d8855a9e79b4dfb5dd05201371286b475401f9083965e6ca216784b3e7dfa14dfb7ca38ce37bd9057fb029828d8b9728af622fc4500a8b7950a0368
7
- data.tar.gz: 5390fd465d6c00c1bdd44e662ca363e056acfdaf13e60854516df0bd945a110b6f7d39f5452b7332c19feab502846c1a70465299bd9247f02f2db7f4168169a3
6
+ metadata.gz: cb869d3622bb68072522b7b7a51701d24c4d07c990bde2f267333ea091345fea9dabab662574d48e563bcf93cdfba05790b500f212320127b5d8850732bd6058
7
+ data.tar.gz: 0d6d5420c57603d8e49663c97f279ff0ceb63101d4d6a5b65cb063c366521ac9eff174cb0cfe66821e8b5cfcad8b87d3a04a285443140ab5f177e858ba864cc0
@@ -229,6 +229,10 @@
229
229
  - :list:
230
230
  - :string
231
231
  - :rename: AttributeNames
232
+ MessageAttributeName:
233
+ - :list:
234
+ - :string
235
+ - :rename: MessageAttributeNames
232
236
  MaxNumberOfMessages:
233
237
  - :integer
234
238
  VisibilityTimeout:
@@ -249,6 +253,23 @@
249
253
  :map:
250
254
  - Name
251
255
  - Value
256
+ MessageAttribute:
257
+ :rename: :message_attributes
258
+ :map:
259
+ - Name
260
+ - Value
261
+ :children:
262
+ Value:
263
+ :children:
264
+ BinaryValue:
265
+ :type: :blob
266
+ StringListValue:
267
+ :list: true
268
+ :rename: :string_list_values
269
+ BinaryListValue:
270
+ :list: true
271
+ :rename: :binary_list_values
272
+ :type: :blob
252
273
  - :name: RemovePermission
253
274
  :method: :remove_permission
254
275
  :inputs:
@@ -273,6 +294,31 @@
273
294
  - :required
274
295
  DelaySeconds:
275
296
  - :integer
297
+ MessageAttribute:
298
+ - :map:
299
+ :key:
300
+ - :string
301
+ :value:
302
+ - :structure:
303
+ StringValue:
304
+ - :string
305
+ BinaryValue:
306
+ - :blob
307
+ StringListValue:
308
+ - :list:
309
+ - :string
310
+ - :rename: StringListValues
311
+ BinaryListValue:
312
+ - :list:
313
+ - :blob
314
+ - :rename: BinaryListValues
315
+ DataType:
316
+ - :string
317
+ - :required
318
+ :key_param: Name
319
+ :value_param: Value
320
+ :flattened: true
321
+ - :rename: MessageAttributes
276
322
  :outputs:
277
323
  :children:
278
324
  SendMessageResult:
@@ -294,6 +340,31 @@
294
340
  - :required
295
341
  DelaySeconds:
296
342
  - :integer
343
+ MessageAttribute:
344
+ - :map:
345
+ :key:
346
+ - :string
347
+ :value:
348
+ - :structure:
349
+ StringValue:
350
+ - :string
351
+ BinaryValue:
352
+ - :blob
353
+ StringListValue:
354
+ - :list:
355
+ - :string
356
+ - :rename: StringListValues
357
+ BinaryListValue:
358
+ - :list:
359
+ - :blob
360
+ - :rename: BinaryListValues
361
+ DataType:
362
+ - :string
363
+ - :required
364
+ :key_param: Name
365
+ :value_param: Value
366
+ :flattened: true
367
+ - :rename: MessageAttributes
297
368
  - :required
298
369
  - :rename: Entries
299
370
  :outputs:
@@ -161,6 +161,9 @@ module AWS
161
161
  # * 'LessThanThreshold'
162
162
  # * 'LessThanOrEqualToThreshold'
163
163
  #
164
+ # @option options [String,required] :namespace The namespace for the
165
+ # alarm's associated metric.
166
+ #
164
167
  # @option options [Integer,required] :evaluation_periods The number
165
168
  # of periods over which data is compared to the specified threshold.
166
169
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1
+ # Copyright 2011-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License"). You
4
4
  # may not use this file except in compliance with the License. A copy of
@@ -168,6 +168,7 @@ module AWS
168
168
  autoload :Endpoints, "#{SRC}/core/endpoints"
169
169
  autoload :IndifferentHash, "#{SRC}/core/indifferent_hash"
170
170
  autoload :Inflection, "#{SRC}/core/inflection"
171
+ autoload :IniParser, "#{SRC}/core/ini_parser"
171
172
  autoload :JSONParser, "#{SRC}/core/json_parser"
172
173
 
173
174
  autoload :JSONClient, "#{SRC}/core/json_client"
@@ -202,6 +202,7 @@ module AWS
202
202
  def new_response(*args, &block)
203
203
  resp = Response.new(*args, &block)
204
204
  resp.config = config
205
+ resp.api_version = self.class::API_VERSION
205
206
  resp
206
207
  end
207
208
 
@@ -118,6 +118,7 @@ module AWS
118
118
  @providers << ENVProvider.new('AWS')
119
119
  @providers << ENVProvider.new('AWS', :access_key_id => 'ACCESS_KEY', :secret_access_key => 'SECRET_KEY', :session_token => 'SESSION_TOKEN')
120
120
  @providers << ENVProvider.new('AMAZON')
121
+ @providers << SharedCredentialFileProvider.new if Dir.home rescue ArgumentError
121
122
  @providers << EC2Provider.new
122
123
  end
123
124
 
@@ -236,7 +237,7 @@ module AWS
236
237
 
237
238
  attr_reader :credential_file
238
239
 
239
- # @param [Sring] credential_file The file path of a credential file
240
+ # @param [String] credential_file The file path of a credential file
240
241
  def initialize(credential_file)
241
242
  @credential_file = credential_file
242
243
  end
@@ -259,6 +260,58 @@ module AWS
259
260
  end
260
261
  end
261
262
 
263
+ class SharedCredentialFileProvider
264
+
265
+ include Provider
266
+
267
+ # @api private
268
+ KEY_MAP = {
269
+ "aws_access_key_id" => :access_key_id,
270
+ "aws_secret_access_key" => :secret_access_key,
271
+ "aws_session_token" => :session_token,
272
+ }
273
+
274
+ # @option [String] :path
275
+ # @option [String] :profile
276
+ def initialize(options = {})
277
+ @path = options[:path] || File.join(Dir.home, '.aws', 'credentials')
278
+ @profile_name = options[:profile_name]
279
+ @profile_name ||= ENV['AWS_PROFILE']
280
+ @profile_name ||= 'default'
281
+ end
282
+
283
+ # @return [String]
284
+ attr_reader :path
285
+
286
+ # @return [String]
287
+ attr_reader :profile_name
288
+
289
+ # (see Provider#get_credentials)
290
+ def get_credentials
291
+ if File.exist?(path) && File.readable?(path)
292
+ load_from_path
293
+ else
294
+ {}
295
+ end
296
+ end
297
+
298
+ private
299
+
300
+ def load_from_path
301
+ profile = load_profile
302
+ KEY_MAP.inject({}) do |credentials, (source, target)|
303
+ credentials[target] = profile[source] if profile.key?(source)
304
+ credentials
305
+ end
306
+ end
307
+
308
+ def load_profile
309
+ ini = IniParser.parse(File.read(path))
310
+ ini[profile_name] || {}
311
+ end
312
+
313
+ end
314
+
262
315
  # This credential provider tries to get credentials from the EC2
263
316
  # metadata service.
264
317
  class EC2Provider
@@ -0,0 +1,42 @@
1
+ # Copyright 2011-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ module AWS
15
+ module Core
16
+
17
+ # @api private
18
+ module IniParser
19
+
20
+ def self.parse(ini)
21
+ current_section = {}
22
+ map = {}
23
+ ini.split(/\r?\n/).each do |line|
24
+ line = line.split(/^|\s;/).first # remove comments
25
+ section = line.match(/^\s*\[([^\[\]]+)\]\s*$/) unless line.nil?
26
+ if section
27
+ current_section = section[1]
28
+ elsif current_section
29
+ item = line.match(/^\s*(.+?)\s*=\s*(.+)\s*$/) unless line.nil?
30
+ if item
31
+ map[current_section] = map[current_section] || {}
32
+ map[current_section][item[1]] = item[2]
33
+ end
34
+ end
35
+ end
36
+ map
37
+ end
38
+
39
+ end
40
+
41
+ end
42
+ end
@@ -70,6 +70,9 @@ module AWS
70
70
  # returned this response.
71
71
  attr_accessor :request_type
72
72
 
73
+ # @return [String] The API version of the request/client.
74
+ attr_accessor :api_version
75
+
73
76
  # @return [Hash] Returns the hash of options passed to the client
74
77
  # request method that generated this response.
75
78
  attr_accessor :request_options
@@ -141,6 +144,7 @@ module AWS
141
144
  # @api private
142
145
  def cache_key
143
146
  [
147
+ api_version,
144
148
  http_request.access_key_id,
145
149
  http_request.host,
146
150
  request_type,
@@ -72,8 +72,7 @@ module AWS
72
72
 
73
73
  # @yield [image] Each image in the collection.
74
74
  # @return [nil]
75
- def each &block
76
- opts = {}
75
+ def each(opts = {}, &block)
77
76
  opts[:owners] = @owners.map { |id| id.to_s } unless @owners.empty?
78
77
  opts[:executable_users] = @executable_users.map { |id| id.to_s } unless
79
78
  @executable_users.empty?
@@ -132,11 +132,10 @@ module AWS
132
132
  # # enumerate jobs that are more than an hour old
133
133
  # emr.job_flows.created_before(Time.now - 3600).each{|job| ... }
134
134
  #
135
- # @param [Time,DateTime,Date] time
135
+ # @param [Time,DateTime,Date,Integer] time
136
136
  # @return [JobFlowCollection]
137
137
  def created_before time
138
- time = time.iso8601 if time.respond_to?(:iso8601)
139
- filter(:created_before, time)
138
+ filter(:created_before, time.to_i)
140
139
  end
141
140
 
142
141
  # Returns a new collection that will only enumerate job flows that
@@ -145,11 +144,10 @@ module AWS
145
144
  # # enumerate jobs that are at most 1 hour old
146
145
  # emr.job_flows.created_after(Time.now - 3600).each{|job| ... }
147
146
  #
148
- # @param [Time,DateTime,Date] time
147
+ # @param [Time,DateTime,Date,Integer] time
149
148
  # @return [JobFlowCollection]
150
149
  def created_after time
151
- time = time.iso8601 if time.respond_to?(:iso8601)
152
- filter(:created_after, time)
150
+ filter(:created_after, time.to_i)
153
151
  end
154
152
 
155
153
  # @param [String,Symbol] name
@@ -54,16 +54,12 @@ module AWS
54
54
  request.headers['host'] = request.host
55
55
  signed_headers = 'Host'
56
56
 
57
- # must be sent along with the PUT request headers
58
57
  if options[:acl]
59
- request.headers['X-Amz-Acl'] = options[:acl].to_s.gsub(/_/, '-')
60
- signed_headers << ';X-Amz-Acl'
58
+ request.add_param("X-Amz-Acl", options[:acl].to_s.gsub(/_/, '-'))
61
59
  end
62
60
 
63
- # must be sent along with the PUT request headers
64
61
  if options[:content_md5]
65
- request.headers['Content-MD5'] = options[:content_md5]
66
- signed_headers << ';Content-MD5'
62
+ request.add_param("Content-MD5", options[:content_md5])
67
63
  end
68
64
 
69
65
  request_params = Core::Signers::S3::QUERY_PARAMS.map do |p|
@@ -13,5 +13,5 @@
13
13
 
14
14
  module AWS
15
15
  # Current version of the AWS SDK for Ruby
16
- VERSION = '1.39.0'
16
+ VERSION = '1.40.0'
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.39.0
4
+ version: 1.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-24 00:00:00.000000000 Z
11
+ date: 2014-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -132,6 +132,7 @@ files:
132
132
  - lib/aws/core/http/response.rb
133
133
  - lib/aws/core/indifferent_hash.rb
134
134
  - lib/aws/core/inflection.rb
135
+ - lib/aws/core/ini_parser.rb
135
136
  - lib/aws/core/json_client.rb
136
137
  - lib/aws/core/json_parser.rb
137
138
  - lib/aws/core/json_request_builder.rb