aws-sdk 1.27.0 → 1.28.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.
@@ -16,7 +16,13 @@ module AWS
16
16
 
17
17
  # @api private
18
18
  class Request < Core::Http::Request
19
- include Core::Signature::Version2
19
+
20
+ include Core::Signature::Version4
21
+
22
+ def service
23
+ 'monitoring'
24
+ end
25
+
20
26
  end
21
27
 
22
28
  end
@@ -135,7 +135,11 @@ module AWS
135
135
  end
136
136
 
137
137
  def size(payload)
138
- payload.respond_to?(:size) ? payload.size : File.size(payload.path)
138
+ if payload.respond_to?(:path) && payload.path
139
+ File.size(payload.path)
140
+ else
141
+ payload.size
142
+ end
139
143
  end
140
144
 
141
145
  def streaming_param
@@ -133,9 +133,10 @@ module AWS
133
133
 
134
134
  client_opts = {}
135
135
 
136
- [:instance,:network_interface].each do |opt|
136
+ [:instance,:network_interface,:private_ip_address].each do |opt|
137
137
  if value = options[opt]
138
- client_opts[:"#{opt}_id"] = value.is_a?(Resource) ? value.id : value
138
+ key = ( opt.to_s=='instance' || opt.to_s=='network_interface' ? opt.to_s+"_id" : opt.to_s )
139
+ client_opts[:"#{key}"] = value.is_a?(Resource) ? value.id : value
139
140
  end
140
141
  end
141
142
 
@@ -262,6 +262,27 @@ module AWS
262
262
 
263
263
  options[:placement] = placement unless placement.empty?
264
264
 
265
+ network_interface = {}
266
+
267
+ if options[:associate_public_ip_address]
268
+ if subnet_id = subnet_id_option(options)
269
+ network_interface[:subnet_id] = subnet_id
270
+ options.delete(:subnet)
271
+ options.delete(:subnet_id)
272
+ end
273
+ if private_ip_address = options.delete(:private_ip_address)
274
+ network_interface[:private_ip_address] = private_ip_address
275
+ end
276
+ if security_group_ids = options.delete(:security_group_ids)
277
+ network_interface[:groups] = security_group_ids
278
+ end
279
+ network_interface[:associate_public_ip_address] = true
280
+ network_interface[:device_index] = 0
281
+ end
282
+ options.delete(:associate_public_ip_address)
283
+
284
+ options[:network_interfaces] = [network_interface] unless network_interface.empty?
285
+
265
286
  if subnet_id = subnet_id_option(options)
266
287
  options[:subnet_id] = subnet_id
267
288
  end
@@ -17,7 +17,7 @@ module AWS
17
17
  # Client class for Amazon Relational Database Service (RDS).
18
18
  class Client < Core::QueryClient
19
19
 
20
- API_VERSION = '2013-05-15'
20
+ API_VERSION = '2013-09-09'
21
21
 
22
22
  # @api private
23
23
  CACHEABLE_REQUESTS = Set[]
@@ -29,5 +29,12 @@ module AWS
29
29
  define_client_methods('2013-05-15')
30
30
 
31
31
  end
32
+
33
+ class Client::V20130909 < Client
34
+
35
+ define_client_methods('2013-09-09')
36
+
37
+ end
38
+
32
39
  end
33
40
  end
@@ -94,10 +94,10 @@ module AWS
94
94
  data = options[:data]
95
95
 
96
96
  length = case
97
+ when data.respond_to?(:path) && data.path then File.size(data.path)
97
98
  when data.respond_to?(:bytesize) then data.bytesize
98
99
  when data.respond_to?(:size) then data.size
99
100
  when data.respond_to?(:length) then data.length
100
- when data.respond_to?(:path) then File.size(data.path)
101
101
  else nil
102
102
  end
103
103
 
@@ -1223,6 +1223,9 @@ module AWS
1223
1223
  # the Content-Disposition header of the response when
1224
1224
  # performing an HTTP GET on the returned URL.
1225
1225
  #
1226
+ # @option options [String] :acl The value to use for the
1227
+ # x-amz-acl.
1228
+ #
1226
1229
  # @option options [String] :response_content_encoding Sets the
1227
1230
  # Content-Encoding header of the response when performing an
1228
1231
  # HTTP GET on the returned URL.
@@ -1231,6 +1234,7 @@ module AWS
1231
1234
  options = options.dup
1232
1235
  options[:secure] = config.use_ssl? unless options.key?(:secure)
1233
1236
  options[:expires] = expiration_timestamp(options[:expires])
1237
+ options[:acl] = options[:acl].to_s.sub('_', '-') if options[:acl]
1234
1238
 
1235
1239
  req = request_for_signing(options)
1236
1240
  req.http_method = http_method(method)
@@ -1238,6 +1242,7 @@ module AWS
1238
1242
  req.add_param("versionId", options[:version_id]) if options[:version_id]
1239
1243
  req.add_param("Signature", signature(req, options))
1240
1244
  req.add_param("Expires", options[:expires])
1245
+ req.add_param("x-amz-acl", options[:acl]) if options[:acl]
1241
1246
  if config.credential_provider.session_token
1242
1247
  req.add_param(
1243
1248
  "x-amz-security-token",
@@ -1370,7 +1375,9 @@ module AWS
1370
1375
 
1371
1376
  estimated_size = estimated_content_length(options)
1372
1377
 
1373
- [(estimated_size.to_f / max_parts).ceil, min_size].max.to_i
1378
+ part_size = [(estimated_size.to_f / max_parts).ceil, min_size].max.to_i
1379
+ part_size += 16 - (part_size % 16)
1380
+ part_size
1374
1381
 
1375
1382
  end
1376
1383
 
@@ -1401,6 +1408,7 @@ module AWS
1401
1408
  parts << options[:content_md5].to_s
1402
1409
  parts << options[:content_type].to_s
1403
1410
  parts << options[:expires]
1411
+ parts << "x-amz-acl:#{options[:acl]}" if options[:acl]
1404
1412
  if token = config.credential_provider.session_token
1405
1413
  parts << "x-amz-security-token:#{token}"
1406
1414
  end
@@ -97,6 +97,22 @@ module AWS
97
97
  get_attributes['EffectiveDeliveryPolicy']
98
98
  end
99
99
 
100
+ # @return [Boolean] Returns true if the subscriptions has raw message delivery enabled.
101
+ def raw_message_delivery
102
+ raw_value = get_attributes['RawMessageDelivery']
103
+ raw_value.downcase == 'true'
104
+ end
105
+
106
+ # @param [Boolean] raw_delivery Whether to enable or disable raw message delivery.
107
+ def raw_message_delivery= raw_delivery
108
+ value = if raw_delivery
109
+ 'true'
110
+ else
111
+ 'false'
112
+ end
113
+ update_subscription_attribute('RawMessageDelivery', value)
114
+ end
115
+
100
116
  # @note This method requests the entire list of subscriptions
101
117
  # for the topic (if known) or the account (if the topic is not
102
118
  # known). It can be expensive if the number of subscriptions
@@ -125,14 +141,19 @@ module AWS
125
141
  alias_method :==, :eql?
126
142
 
127
143
  protected
128
- def update_delivery_policy policy_json
144
+ def update_subscription_attribute name, value
129
145
  client_opts = {}
130
146
  client_opts[:subscription_arn] = arn
131
- client_opts[:attribute_name] = 'DeliveryPolicy'
132
- client_opts[:attribute_value] = policy_json
147
+ client_opts[:attribute_name] = name
148
+ client_opts[:attribute_value] = value
133
149
  client.set_subscription_attributes(client_opts)
134
150
  end
135
151
 
152
+ protected
153
+ def update_delivery_policy policy_json
154
+ update_subscription_attribute('DeliveryPolicy', policy_json)
155
+ end
156
+
136
157
  protected
137
158
  def get_attributes
138
159
  client.get_subscription_attributes(:subscription_arn => arn).attributes
@@ -13,5 +13,5 @@
13
13
 
14
14
  module AWS
15
15
  # Current version of the AWS SDK for Ruby
16
- VERSION = '1.27.0'
16
+ VERSION = '1.28.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.27.0
4
+ version: 1.28.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: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuidtools
@@ -611,6 +611,7 @@ files:
611
611
  - lib/aws/api_config/ImportExport-2010-06-01.yml
612
612
  - lib/aws/api_config/OpsWorks-2013-02-18.yml
613
613
  - lib/aws/api_config/RDS-2013-05-15.yml
614
+ - lib/aws/api_config/RDS-2013-09-09.yml
614
615
  - lib/aws/api_config/Redshift-2012-12-01.yml
615
616
  - lib/aws/api_config/Route53-2012-12-12.yml
616
617
  - lib/aws/api_config/SimpleDB-2009-04-15.yml