aws-sdk-dynamodb 1.1.0 → 1.2.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/lib/aws-sdk-dynamodb.rb +1 -1
- data/lib/aws-sdk-dynamodb/client.rb +1 -1
- data/lib/aws-sdk-dynamodb/table.rb +108 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2468c7fbb6fa0dd6df1289b1da98304e28998130
|
4
|
+
data.tar.gz: f583a56343d7ed3225fab3ff9c530777d04fed0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95fbd56b43c71a079e7c094761b18c2e719506a699920190c94951b629c35bda51374021e8e13509254fb954b2a393e1a93a7e7265f4d58ad442612a6232d317
|
7
|
+
data.tar.gz: 13d4c74fc6b44a4be2b6861592359f8b73920bac6120e7593c4475ff4a41dc58ac0bd71f6be0c2d56f3ce9794bcb213238e7e35bb951a341ca78d58fb2daca53
|
data/lib/aws-sdk-dynamodb.rb
CHANGED
@@ -4176,7 +4176,7 @@ module Aws::DynamoDB
|
|
4176
4176
|
params: params,
|
4177
4177
|
config: config)
|
4178
4178
|
context[:gem_name] = 'aws-sdk-dynamodb'
|
4179
|
-
context[:gem_version] = '1.
|
4179
|
+
context[:gem_version] = '1.2.0'
|
4180
4180
|
Seahorse::Client::Request.new(handlers, context)
|
4181
4181
|
end
|
4182
4182
|
|
@@ -41,7 +41,7 @@ module Aws::DynamoDB
|
|
41
41
|
# * `AttributeType` - The data type for the attribute.
|
42
42
|
# @return [Array<Types::AttributeDefinition>]
|
43
43
|
def attribute_definitions
|
44
|
-
data
|
44
|
+
data[:attribute_definitions]
|
45
45
|
end
|
46
46
|
|
47
47
|
# The primary key structure for the table. Each `KeySchemaElement`
|
@@ -75,7 +75,7 @@ module Aws::DynamoDB
|
|
75
75
|
# [1]: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey
|
76
76
|
# @return [Array<Types::KeySchemaElement>]
|
77
77
|
def key_schema
|
78
|
-
data
|
78
|
+
data[:key_schema]
|
79
79
|
end
|
80
80
|
|
81
81
|
# The current state of the table:
|
@@ -89,7 +89,7 @@ module Aws::DynamoDB
|
|
89
89
|
# * `ACTIVE` - The table is ready for use.
|
90
90
|
# @return [String]
|
91
91
|
def table_status
|
92
|
-
data
|
92
|
+
data[:table_status]
|
93
93
|
end
|
94
94
|
|
95
95
|
# The date and time when the table was created, in [UNIX epoch time][1]
|
@@ -100,7 +100,7 @@ module Aws::DynamoDB
|
|
100
100
|
# [1]: http://www.epochconverter.com/
|
101
101
|
# @return [Time]
|
102
102
|
def creation_date_time
|
103
|
-
data
|
103
|
+
data[:creation_date_time]
|
104
104
|
end
|
105
105
|
|
106
106
|
# The provisioned throughput settings for the table, consisting of read
|
@@ -108,7 +108,7 @@ module Aws::DynamoDB
|
|
108
108
|
# decreases.
|
109
109
|
# @return [Types::ProvisionedThroughputDescription]
|
110
110
|
def provisioned_throughput
|
111
|
-
data
|
111
|
+
data[:provisioned_throughput]
|
112
112
|
end
|
113
113
|
|
114
114
|
# The total size of the specified table, in bytes. DynamoDB updates this
|
@@ -116,7 +116,7 @@ module Aws::DynamoDB
|
|
116
116
|
# reflected in this value.
|
117
117
|
# @return [Integer]
|
118
118
|
def table_size_bytes
|
119
|
-
data
|
119
|
+
data[:table_size_bytes]
|
120
120
|
end
|
121
121
|
|
122
122
|
# The number of items in the specified table. DynamoDB updates this
|
@@ -124,13 +124,13 @@ module Aws::DynamoDB
|
|
124
124
|
# reflected in this value.
|
125
125
|
# @return [Integer]
|
126
126
|
def item_count
|
127
|
-
data
|
127
|
+
data[:item_count]
|
128
128
|
end
|
129
129
|
|
130
130
|
# The Amazon Resource Name (ARN) that uniquely identifies the table.
|
131
131
|
# @return [String]
|
132
132
|
def table_arn
|
133
|
-
data
|
133
|
+
data[:table_arn]
|
134
134
|
end
|
135
135
|
|
136
136
|
# Represents one or more local secondary indexes on the table. Each
|
@@ -182,7 +182,7 @@ module Aws::DynamoDB
|
|
182
182
|
# will be returned.
|
183
183
|
# @return [Array<Types::LocalSecondaryIndexDescription>]
|
184
184
|
def local_secondary_indexes
|
185
|
-
data
|
185
|
+
data[:local_secondary_indexes]
|
186
186
|
end
|
187
187
|
|
188
188
|
# The global secondary indexes, if any, on the table. Each index is
|
@@ -252,13 +252,13 @@ module Aws::DynamoDB
|
|
252
252
|
# will be returned.
|
253
253
|
# @return [Array<Types::GlobalSecondaryIndexDescription>]
|
254
254
|
def global_secondary_indexes
|
255
|
-
data
|
255
|
+
data[:global_secondary_indexes]
|
256
256
|
end
|
257
257
|
|
258
258
|
# The current DynamoDB Streams configuration for the table.
|
259
259
|
# @return [Types::StreamSpecification]
|
260
260
|
def stream_specification
|
261
|
-
data
|
261
|
+
data[:stream_specification]
|
262
262
|
end
|
263
263
|
|
264
264
|
# A timestamp, in ISO 8601 format, for this stream.
|
@@ -275,14 +275,14 @@ module Aws::DynamoDB
|
|
275
275
|
# * the `StreamLabel`.
|
276
276
|
# @return [String]
|
277
277
|
def latest_stream_label
|
278
|
-
data
|
278
|
+
data[:latest_stream_label]
|
279
279
|
end
|
280
280
|
|
281
281
|
# The Amazon Resource Name (ARN) that uniquely identifies the latest
|
282
282
|
# stream for this table.
|
283
283
|
# @return [String]
|
284
284
|
def latest_stream_arn
|
285
|
-
data
|
285
|
+
data[:latest_stream_arn]
|
286
286
|
end
|
287
287
|
|
288
288
|
# @!endgroup
|
@@ -320,6 +320,101 @@ module Aws::DynamoDB
|
|
320
320
|
!!@data
|
321
321
|
end
|
322
322
|
|
323
|
+
# @deprecated Use [Aws::DynamoDB::Client] #wait_until instead
|
324
|
+
#
|
325
|
+
# Waiter polls an API operation until a resource enters a desired
|
326
|
+
# state.
|
327
|
+
#
|
328
|
+
# @note The waiting operation is performed on a copy. The original resource remains unchanged
|
329
|
+
#
|
330
|
+
# ## Basic Usage
|
331
|
+
#
|
332
|
+
# Waiter will polls until it is successful, it fails by
|
333
|
+
# entering a terminal state, or until a maximum number of attempts
|
334
|
+
# are made.
|
335
|
+
#
|
336
|
+
# # polls in a loop until condition is true
|
337
|
+
# resource.wait_until(options) {|resource| condition}
|
338
|
+
#
|
339
|
+
# ## Example
|
340
|
+
#
|
341
|
+
# instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
|
342
|
+
#
|
343
|
+
# ## Configuration
|
344
|
+
#
|
345
|
+
# You can configure the maximum number of polling attempts, and the
|
346
|
+
# delay (in seconds) between each polling attempt. The waiting condition is set
|
347
|
+
# by passing a block to {#wait_until}:
|
348
|
+
#
|
349
|
+
# # poll for ~25 seconds
|
350
|
+
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
351
|
+
#
|
352
|
+
# ## Callbacks
|
353
|
+
#
|
354
|
+
# You can be notified before each polling attempt and before each
|
355
|
+
# delay. If you throw `:success` or `:failure` from these callbacks,
|
356
|
+
# it will terminate the waiter.
|
357
|
+
#
|
358
|
+
# started_at = Time.now
|
359
|
+
# # poll for 1 hour, instead of a number of attempts
|
360
|
+
# proc = Proc.new do |attempts, response|
|
361
|
+
# throw :failure if Time.now - started_at > 3600
|
362
|
+
# end
|
363
|
+
#
|
364
|
+
# # disable max attempts
|
365
|
+
# instance.wait_until(before_wait:proc, max_attempts:nil) {...}
|
366
|
+
#
|
367
|
+
# ## Handling Errors
|
368
|
+
#
|
369
|
+
# When a waiter is successful, it returns the Resource. When a waiter
|
370
|
+
# fails, it raises an error.
|
371
|
+
#
|
372
|
+
# begin
|
373
|
+
# resource.wait_until(...)
|
374
|
+
# rescue Aws::Waiters::Errors::WaiterFailed
|
375
|
+
# # resource did not enter the desired state in time
|
376
|
+
# end
|
377
|
+
#
|
378
|
+
#
|
379
|
+
# @yield param [Resource] resource to be used in the waiting condition
|
380
|
+
#
|
381
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
|
382
|
+
# because the waiter has entered a state that it will not transition
|
383
|
+
# out of, preventing success.
|
384
|
+
#
|
385
|
+
# yet successful.
|
386
|
+
#
|
387
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
|
388
|
+
# while polling for a resource that is not expected.
|
389
|
+
#
|
390
|
+
# @raise [NotImplementedError] Raised when the resource does not
|
391
|
+
#
|
392
|
+
# @option options [Integer] :max_attempts (10) Maximum number of
|
393
|
+
# attempts
|
394
|
+
# @option options [Integer] :delay (10) Delay between each
|
395
|
+
# attempt in seconds
|
396
|
+
# @option options [Proc] :before_attempt (nil) Callback
|
397
|
+
# invoked before each attempt
|
398
|
+
# @option options [Proc] :before_wait (nil) Callback
|
399
|
+
# invoked before each wait
|
400
|
+
# @return [Resource] if the waiter was successful
|
401
|
+
def wait_until(options = {}, &block)
|
402
|
+
self_copy = self.dup
|
403
|
+
attempts = 0
|
404
|
+
options[:max_attempts] = 10 unless options.key?(:max_attempts)
|
405
|
+
options[:delay] ||= 10
|
406
|
+
options[:poller] = Proc.new do
|
407
|
+
attempts += 1
|
408
|
+
if block.call(self_copy)
|
409
|
+
[:success, self_copy]
|
410
|
+
else
|
411
|
+
self_copy.reload unless attempts == options[:max_attempts]
|
412
|
+
:retry
|
413
|
+
end
|
414
|
+
end
|
415
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
416
|
+
end
|
417
|
+
|
323
418
|
# @!group Actions
|
324
419
|
|
325
420
|
# @example Request syntax with placeholder values
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-dynamodb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.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: 2017-09-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|