File Coverage

blib/lib/Paws/DynamoDB.pm
Criterion Covered Total %
statement 37 150 24.6
branch 0 12 0.0
condition n/a
subroutine 15 29 51.7
pod 22 27 81.4
total 74 218 33.9


line stmt bran cond sub pod time code
1             package Paws::DynamoDB;
2 1     1   3374 use Moose;
  1     4   2  
  1         8  
  4         3618  
  4         12  
  4         34  
3 30     30 0 169 sub service { 'dynamodb' }
4 5     5 0 36 sub version { '2012-08-10' }
5 5     5 0 135 sub target_prefix { 'DynamoDB_20120810' }
6 5     5 0 18 sub json_version { "1.0" }
7             has max_attempts => (is => 'ro', isa => 'Int', default => 10);
8             has retry => (is => 'ro', isa => 'HashRef', default => sub {
9             { base => '0.05', type => 'exponential', growth_factor => 2 }
10             });
11             has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [
12             sub { defined $_[0]->http_status and $_[0]->http_status == 400 and $_[0]->code eq 'ProvisionedThroughputExceededException' },
13             sub { $_[0]->code eq 'Crc32Error' },
14             ] });
15              
16             with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::JsonCaller', 'Paws::Net::JsonResponse';
17              
18             has '+region_rules' => (default => sub {
19             my $regioninfo;
20             $regioninfo = [
21             {
22             constraints => [
23             [
24             'region',
25             'equals',
26             'local'
27             ]
28             ],
29             properties => {
30             credentialScope => {
31             region => 'us-east-1',
32             service => 'dynamodb'
33             }
34             },
35             uri => 'http://localhost:8000'
36             }
37             ];
38              
39             return $regioninfo;
40             });
41              
42            
43             sub BatchGetItem {
44 2     2 1 1871 my $self = shift;
45 2         18 my $call_object = $self->new_with_coercions('Paws::DynamoDB::BatchGetItem', @_);
46 2         2135 return $self->caller->do_call($self, $call_object);
47             }
48             sub BatchWriteItem {
49 1     1 1 2571 my $self = shift;
50 1         7 my $call_object = $self->new_with_coercions('Paws::DynamoDB::BatchWriteItem', @_);
51 1         716 return $self->caller->do_call($self, $call_object);
52             }
53             sub CreateTable {
54 2     2 1 805 my $self = shift;
55 2         21 my $call_object = $self->new_with_coercions('Paws::DynamoDB::CreateTable', @_);
56 2         3875 return $self->caller->do_call($self, $call_object);
57             }
58             sub DeleteItem {
59 0     0 1 0 my $self = shift;
60 0         0 my $call_object = $self->new_with_coercions('Paws::DynamoDB::DeleteItem', @_);
61 0         0 return $self->caller->do_call($self, $call_object);
62             }
63             sub DeleteTable {
64 2     2 1 615 my $self = shift;
65 2         17 my $call_object = $self->new_with_coercions('Paws::DynamoDB::DeleteTable', @_);
66 2         1107 return $self->caller->do_call($self, $call_object);
67             }
68             sub DescribeLimits {
69 0     0 1 0 my $self = shift;
70 0         0 my $call_object = $self->new_with_coercions('Paws::DynamoDB::DescribeLimits', @_);
71 0         0 return $self->caller->do_call($self, $call_object);
72             }
73             sub DescribeTable {
74 1     1 1 322 my $self = shift;
75 1         10 my $call_object = $self->new_with_coercions('Paws::DynamoDB::DescribeTable', @_);
76 1         534 return $self->caller->do_call($self, $call_object);
77             }
78             sub DescribeTimeToLive {
79 0     0 1 0 my $self = shift;
80 0         0 my $call_object = $self->new_with_coercions('Paws::DynamoDB::DescribeTimeToLive', @_);
81 0         0 return $self->caller->do_call($self, $call_object);
82             }
83             sub GetItem {
84 4     4 1 2962 my $self = shift;
85 4         30 my $call_object = $self->new_with_coercions('Paws::DynamoDB::GetItem', @_);
86 4         6060 return $self->caller->do_call($self, $call_object);
87             }
88             sub ListTables {
89 3     3 1 256 my $self = shift;
90 3         22 my $call_object = $self->new_with_coercions('Paws::DynamoDB::ListTables', @_);
91 3         1323 return $self->caller->do_call($self, $call_object);
92             }
93             sub ListTagsOfResource {
94 0     0 1 0 my $self = shift;
95 0         0 my $call_object = $self->new_with_coercions('Paws::DynamoDB::ListTagsOfResource', @_);
96 0         0 return $self->caller->do_call($self, $call_object);
97             }
98             sub PutItem {
99 2     2 1 1466 my $self = shift;
100 2         18 my $call_object = $self->new_with_coercions('Paws::DynamoDB::PutItem', @_);
101 2         3289 return $self->caller->do_call($self, $call_object);
102             }
103             sub Query {
104 0     0 1 0 my $self = shift;
105 0         0 my $call_object = $self->new_with_coercions('Paws::DynamoDB::Query', @_);
106 0         0 return $self->caller->do_call($self, $call_object);
107             }
108             sub Scan {
109 2     2 1 2137 my $self = shift;
110 2         20 my $call_object = $self->new_with_coercions('Paws::DynamoDB::Scan', @_);
111 2         5069 return $self->caller->do_call($self, $call_object);
112             }
113             sub TagResource {
114 0     0 1   my $self = shift;
115 0           my $call_object = $self->new_with_coercions('Paws::DynamoDB::TagResource', @_);
116 0           return $self->caller->do_call($self, $call_object);
117             }
118             sub UntagResource {
119 0     0 1   my $self = shift;
120 0           my $call_object = $self->new_with_coercions('Paws::DynamoDB::UntagResource', @_);
121 0           return $self->caller->do_call($self, $call_object);
122             }
123             sub UpdateItem {
124 0     0 1   my $self = shift;
125 0           my $call_object = $self->new_with_coercions('Paws::DynamoDB::UpdateItem', @_);
126 0           return $self->caller->do_call($self, $call_object);
127             }
128             sub UpdateTable {
129 0     0 1   my $self = shift;
130 0           my $call_object = $self->new_with_coercions('Paws::DynamoDB::UpdateTable', @_);
131 0           return $self->caller->do_call($self, $call_object);
132             }
133             sub UpdateTimeToLive {
134 0     0 1   my $self = shift;
135 0           my $call_object = $self->new_with_coercions('Paws::DynamoDB::UpdateTimeToLive', @_);
136 0           return $self->caller->do_call($self, $call_object);
137             }
138            
139             sub ListAllTables {
140 0     0 1   my $self = shift;
141              
142 0 0         my $callback = shift @_ if (ref($_[0]) eq 'CODE');
143 0           my $result = $self->ListTables(@_);
144 0           my $next_result = $result;
145              
146 0 0         if (not defined $callback) {
147 0           while ($next_result->LastEvaluatedTableName) {
148 0           $next_result = $self->ListTables(@_, ExclusiveStartTableName => $next_result->LastEvaluatedTableName);
149 0           push @{ $result->TableNames }, @{ $next_result->TableNames };
  0            
  0            
150             }
151 0           return $result;
152             } else {
153 0           while ($result->LastEvaluatedTableName) {
154 0           $callback->($_ => 'TableNames') foreach (@{ $result->TableNames });
  0            
155 0           $result = $self->ListTables(@_, ExclusiveStartTableName => $result->LastEvaluatedTableName);
156             }
157 0           $callback->($_ => 'TableNames') foreach (@{ $result->TableNames });
  0            
158             }
159              
160             return undef
161 0           }
162             sub QueryAll {
163 0     0 1   my $self = shift;
164              
165 0 0         my $callback = shift @_ if (ref($_[0]) eq 'CODE');
166 0           my $result = $self->Query(@_);
167 0           my $next_result = $result;
168              
169 0 0         if (not defined $callback) {
170 0           while ($next_result->LastEvaluatedKey) {
171 0           $next_result = $self->Query(@_, ExclusiveStartKey => $next_result->LastEvaluatedKey);
172 0           push @{ $result->Items }, @{ $next_result->Items };
  0            
  0            
173 0           push @{ $result->Count }, @{ $next_result->Count };
  0            
  0            
174 0           push @{ $result->ScannedCount }, @{ $next_result->ScannedCount };
  0            
  0            
175             }
176 0           return $result;
177             } else {
178 0           while ($result->LastEvaluatedKey) {
179 0           $callback->($_ => 'Items') foreach (@{ $result->Items });
  0            
180 0           $callback->($_ => 'Count') foreach (@{ $result->Count });
  0            
181 0           $callback->($_ => 'ScannedCount') foreach (@{ $result->ScannedCount });
  0            
182 0           $result = $self->Query(@_, ExclusiveStartKey => $result->LastEvaluatedKey);
183             }
184 0           $callback->($_ => 'Items') foreach (@{ $result->Items });
  0            
185 0           $callback->($_ => 'Count') foreach (@{ $result->Count });
  0            
186 0           $callback->($_ => 'ScannedCount') foreach (@{ $result->ScannedCount });
  0            
187             }
188              
189             return undef
190 0           }
191             sub ScanAll {
192 0     0 1   my $self = shift;
193              
194 0 0         my $callback = shift @_ if (ref($_[0]) eq 'CODE');
195 0           my $result = $self->Scan(@_);
196 0           my $next_result = $result;
197              
198 0 0         if (not defined $callback) {
199 0           while ($next_result->LastEvaluatedKey) {
200 0           $next_result = $self->Scan(@_, ExclusiveStartKey => $next_result->LastEvaluatedKey);
201 0           push @{ $result->Items }, @{ $next_result->Items };
  0            
  0            
202 0           push @{ $result->Count }, @{ $next_result->Count };
  0            
  0            
203 0           push @{ $result->ScannedCount }, @{ $next_result->ScannedCount };
  0            
  0            
204             }
205 0           return $result;
206             } else {
207 0           while ($result->LastEvaluatedKey) {
208 0           $callback->($_ => 'Items') foreach (@{ $result->Items });
  0            
209 0           $callback->($_ => 'Count') foreach (@{ $result->Count });
  0            
210 0           $callback->($_ => 'ScannedCount') foreach (@{ $result->ScannedCount });
  0            
211 0           $result = $self->Scan(@_, ExclusiveStartKey => $result->LastEvaluatedKey);
212             }
213 0           $callback->($_ => 'Items') foreach (@{ $result->Items });
  0            
214 0           $callback->($_ => 'Count') foreach (@{ $result->Count });
  0            
215 0           $callback->($_ => 'ScannedCount') foreach (@{ $result->ScannedCount });
  0            
216             }
217              
218             return undef
219 0           }
220              
221              
222 0     0 0   sub operations { qw/BatchGetItem BatchWriteItem CreateTable DeleteItem DeleteTable DescribeLimits DescribeTable DescribeTimeToLive GetItem ListTables ListTagsOfResource PutItem Query Scan TagResource UntagResource UpdateItem UpdateTable UpdateTimeToLive / }
223              
224             1;
225              
226             ### main pod documentation begin ###
227              
228             =head1 NAME
229              
230             Paws::DynamoDB - Perl Interface to AWS Amazon DynamoDB
231              
232             =head1 SYNOPSIS
233              
234             use Paws;
235              
236             my $obj = Paws->service('DynamoDB');
237             my $res = $obj->Method(
238             Arg1 => $val1,
239             Arg2 => [ 'V1', 'V2' ],
240             # if Arg3 is an object, the HashRef will be used as arguments to the constructor
241             # of the arguments type
242             Arg3 => { Att1 => 'Val1' },
243             # if Arg4 is an array of objects, the HashRefs will be passed as arguments to
244             # the constructor of the arguments type
245             Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ],
246             );
247              
248             =head1 DESCRIPTION
249              
250             Amazon DynamoDB
251              
252             Amazon DynamoDB is a fully managed NoSQL database service that provides
253             fast and predictable performance with seamless scalability. DynamoDB
254             lets you offload the administrative burdens of operating and scaling a
255             distributed database, so that you don't have to worry about hardware
256             provisioning, setup and configuration, replication, software patching,
257             or cluster scaling.
258              
259             With DynamoDB, you can create database tables that can store and
260             retrieve any amount of data, and serve any level of request traffic.
261             You can scale up or scale down your tables' throughput capacity without
262             downtime or performance degradation, and use the AWS Management Console
263             to monitor resource utilization and performance metrics.
264              
265             DynamoDB automatically spreads the data and traffic for your tables
266             over a sufficient number of servers to handle your throughput and
267             storage requirements, while maintaining consistent and fast
268             performance. All of your data is stored on solid state disks (SSDs) and
269             automatically replicated across multiple Availability Zones in an AWS
270             region, providing built-in high availability and data durability.
271              
272             =head1 METHODS
273              
274             =head2 BatchGetItem(RequestItems => L<Paws::DynamoDB::BatchGetRequestMap>, [ReturnConsumedCapacity => Str])
275              
276             Each argument is described in detail in: L<Paws::DynamoDB::BatchGetItem>
277              
278             Returns: a L<Paws::DynamoDB::BatchGetItemOutput> instance
279              
280             The C<BatchGetItem> operation returns the attributes of one or more
281             items from one or more tables. You identify requested items by primary
282             key.
283              
284             A single operation can retrieve up to 16 MB of data, which can contain
285             as many as 100 items. C<BatchGetItem> will return a partial result if
286             the response size limit is exceeded, the table's provisioned throughput
287             is exceeded, or an internal processing failure occurs. If a partial
288             result is returned, the operation returns a value for
289             C<UnprocessedKeys>. You can use this value to retry the operation
290             starting with the next item to get.
291              
292             If you request more than 100 items C<BatchGetItem> will return a
293             C<ValidationException> with the message "Too many items requested for
294             the BatchGetItem call".
295              
296             For example, if you ask to retrieve 100 items, but each individual item
297             is 300 KB in size, the system returns 52 items (so as not to exceed the
298             16 MB limit). It also returns an appropriate C<UnprocessedKeys> value
299             so you can get the next page of results. If desired, your application
300             can include its own logic to assemble the pages of results into one
301             data set.
302              
303             If I<none> of the items can be processed due to insufficient
304             provisioned throughput on all of the tables in the request, then
305             C<BatchGetItem> will return a
306             C<ProvisionedThroughputExceededException>. If I<at least one> of the
307             items is successfully processed, then C<BatchGetItem> completes
308             successfully, while returning the keys of the unread items in
309             C<UnprocessedKeys>.
310              
311             If DynamoDB returns any unprocessed items, you should retry the batch
312             operation on those items. However, I<we strongly recommend that you use
313             an exponential backoff algorithm>. If you retry the batch operation
314             immediately, the underlying read or write requests can still fail due
315             to throttling on the individual tables. If you delay the batch
316             operation using exponential backoff, the individual requests in the
317             batch are much more likely to succeed.
318              
319             For more information, see Batch Operations and Error Handling in the
320             I<Amazon DynamoDB Developer Guide>.
321              
322             By default, C<BatchGetItem> performs eventually consistent reads on
323             every table in the request. If you want strongly consistent reads
324             instead, you can set C<ConsistentRead> to C<true> for any or all
325             tables.
326              
327             In order to minimize response latency, C<BatchGetItem> retrieves items
328             in parallel.
329              
330             When designing your application, keep in mind that DynamoDB does not
331             return items in any particular order. To help parse the response by
332             item, include the primary key values for the items in your request in
333             the C<ProjectionExpression> parameter.
334              
335             If a requested item does not exist, it is not returned in the result.
336             Requests for nonexistent items consume the minimum read capacity units
337             according to the type of read. For more information, see Capacity Units
338             Calculations in the I<Amazon DynamoDB Developer Guide>.
339              
340              
341             =head2 BatchWriteItem(RequestItems => L<Paws::DynamoDB::BatchWriteItemRequestMap>, [ReturnConsumedCapacity => Str, ReturnItemCollectionMetrics => Str])
342              
343             Each argument is described in detail in: L<Paws::DynamoDB::BatchWriteItem>
344              
345             Returns: a L<Paws::DynamoDB::BatchWriteItemOutput> instance
346              
347             The C<BatchWriteItem> operation puts or deletes multiple items in one
348             or more tables. A single call to C<BatchWriteItem> can write up to 16
349             MB of data, which can comprise as many as 25 put or delete requests.
350             Individual items to be written can be as large as 400 KB.
351              
352             C<BatchWriteItem> cannot update items. To update items, use the
353             C<UpdateItem> action.
354              
355             The individual C<PutItem> and C<DeleteItem> operations specified in
356             C<BatchWriteItem> are atomic; however C<BatchWriteItem> as a whole is
357             not. If any requested operations fail because the table's provisioned
358             throughput is exceeded or an internal processing failure occurs, the
359             failed operations are returned in the C<UnprocessedItems> response
360             parameter. You can investigate and optionally resend the requests.
361             Typically, you would call C<BatchWriteItem> in a loop. Each iteration
362             would check for unprocessed items and submit a new C<BatchWriteItem>
363             request with those unprocessed items until all items have been
364             processed.
365              
366             Note that if I<none> of the items can be processed due to insufficient
367             provisioned throughput on all of the tables in the request, then
368             C<BatchWriteItem> will return a
369             C<ProvisionedThroughputExceededException>.
370              
371             If DynamoDB returns any unprocessed items, you should retry the batch
372             operation on those items. However, I<we strongly recommend that you use
373             an exponential backoff algorithm>. If you retry the batch operation
374             immediately, the underlying read or write requests can still fail due
375             to throttling on the individual tables. If you delay the batch
376             operation using exponential backoff, the individual requests in the
377             batch are much more likely to succeed.
378              
379             For more information, see Batch Operations and Error Handling in the
380             I<Amazon DynamoDB Developer Guide>.
381              
382             With C<BatchWriteItem>, you can efficiently write or delete large
383             amounts of data, such as from Amazon Elastic MapReduce (EMR), or copy
384             data from another database into DynamoDB. In order to improve
385             performance with these large-scale operations, C<BatchWriteItem> does
386             not behave in the same way as individual C<PutItem> and C<DeleteItem>
387             calls would. For example, you cannot specify conditions on individual
388             put and delete requests, and C<BatchWriteItem> does not return deleted
389             items in the response.
390              
391             If you use a programming language that supports concurrency, you can
392             use threads to write items in parallel. Your application must include
393             the necessary logic to manage the threads. With languages that don't
394             support threading, you must update or delete the specified items one at
395             a time. In both situations, C<BatchWriteItem> performs the specified
396             put and delete operations in parallel, giving you the power of the
397             thread pool approach without having to introduce complexity into your
398             application.
399              
400             Parallel processing reduces latency, but each specified put and delete
401             request consumes the same number of write capacity units whether it is
402             processed in parallel or not. Delete operations on nonexistent items
403             consume one write capacity unit.
404              
405             If one or more of the following is true, DynamoDB rejects the entire
406             batch write operation:
407              
408             =over
409              
410             =item *
411              
412             One or more tables specified in the C<BatchWriteItem> request does not
413             exist.
414              
415             =item *
416              
417             Primary key attributes specified on an item in the request do not match
418             those in the corresponding table's primary key schema.
419              
420             =item *
421              
422             You try to perform multiple operations on the same item in the same
423             C<BatchWriteItem> request. For example, you cannot put and delete the
424             same item in the same C<BatchWriteItem> request.
425              
426             =item *
427              
428             There are more than 25 requests in the batch.
429              
430             =item *
431              
432             Any individual item in a batch exceeds 400 KB.
433              
434             =item *
435              
436             The total request size exceeds 16 MB.
437              
438             =back
439              
440              
441              
442             =head2 CreateTable(AttributeDefinitions => ArrayRef[L<Paws::DynamoDB::AttributeDefinition>], KeySchema => ArrayRef[L<Paws::DynamoDB::KeySchemaElement>], ProvisionedThroughput => L<Paws::DynamoDB::ProvisionedThroughput>, TableName => Str, [GlobalSecondaryIndexes => ArrayRef[L<Paws::DynamoDB::GlobalSecondaryIndex>], LocalSecondaryIndexes => ArrayRef[L<Paws::DynamoDB::LocalSecondaryIndex>], StreamSpecification => L<Paws::DynamoDB::StreamSpecification>])
443              
444             Each argument is described in detail in: L<Paws::DynamoDB::CreateTable>
445              
446             Returns: a L<Paws::DynamoDB::CreateTableOutput> instance
447              
448             The C<CreateTable> operation adds a new table to your account. In an
449             AWS account, table names must be unique within each region. That is,
450             you can have two tables with same name if you create the tables in
451             different regions.
452              
453             C<CreateTable> is an asynchronous operation. Upon receiving a
454             C<CreateTable> request, DynamoDB immediately returns a response with a
455             C<TableStatus> of C<CREATING>. After the table is created, DynamoDB
456             sets the C<TableStatus> to C<ACTIVE>. You can perform read and write
457             operations only on an C<ACTIVE> table.
458              
459             You can optionally define secondary indexes on the new table, as part
460             of the C<CreateTable> operation. If you want to create multiple tables
461             with secondary indexes on them, you must create the tables
462             sequentially. Only one table with secondary indexes can be in the
463             C<CREATING> state at any given time.
464              
465             You can use the C<DescribeTable> action to check the table status.
466              
467              
468             =head2 DeleteItem(Key => L<Paws::DynamoDB::Key>, TableName => Str, [ConditionalOperator => Str, ConditionExpression => Str, Expected => L<Paws::DynamoDB::ExpectedAttributeMap>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, ReturnConsumedCapacity => Str, ReturnItemCollectionMetrics => Str, ReturnValues => Str])
469              
470             Each argument is described in detail in: L<Paws::DynamoDB::DeleteItem>
471              
472             Returns: a L<Paws::DynamoDB::DeleteItemOutput> instance
473              
474             Deletes a single item in a table by primary key. You can perform a
475             conditional delete operation that deletes the item if it exists, or if
476             it has an expected attribute value.
477              
478             In addition to deleting an item, you can also return the item's
479             attribute values in the same operation, using the C<ReturnValues>
480             parameter.
481              
482             Unless you specify conditions, the C<DeleteItem> is an idempotent
483             operation; running it multiple times on the same item or attribute does
484             I<not> result in an error response.
485              
486             Conditional deletes are useful for deleting items only if specific
487             conditions are met. If those conditions are met, DynamoDB performs the
488             delete. Otherwise, the item is not deleted.
489              
490              
491             =head2 DeleteTable(TableName => Str)
492              
493             Each argument is described in detail in: L<Paws::DynamoDB::DeleteTable>
494              
495             Returns: a L<Paws::DynamoDB::DeleteTableOutput> instance
496              
497             The C<DeleteTable> operation deletes a table and all of its items.
498             After a C<DeleteTable> request, the specified table is in the
499             C<DELETING> state until DynamoDB completes the deletion. If the table
500             is in the C<ACTIVE> state, you can delete it. If a table is in
501             C<CREATING> or C<UPDATING> states, then DynamoDB returns a
502             C<ResourceInUseException>. If the specified table does not exist,
503             DynamoDB returns a C<ResourceNotFoundException>. If table is already in
504             the C<DELETING> state, no error is returned.
505              
506             DynamoDB might continue to accept data read and write operations, such
507             as C<GetItem> and C<PutItem>, on a table in the C<DELETING> state until
508             the table deletion is complete.
509              
510             When you delete a table, any indexes on that table are also deleted.
511              
512             If you have DynamoDB Streams enabled on the table, then the
513             corresponding stream on that table goes into the C<DISABLED> state, and
514             the stream is automatically deleted after 24 hours.
515              
516             Use the C<DescribeTable> action to check the status of the table.
517              
518              
519             =head2 DescribeLimits()
520              
521             Each argument is described in detail in: L<Paws::DynamoDB::DescribeLimits>
522              
523             Returns: a L<Paws::DynamoDB::DescribeLimitsOutput> instance
524              
525             Returns the current provisioned-capacity limits for your AWS account in
526             a region, both for the region as a whole and for any one DynamoDB table
527             that you create there.
528              
529             When you establish an AWS account, the account has initial limits on
530             the maximum read capacity units and write capacity units that you can
531             provision across all of your DynamoDB tables in a given region. Also,
532             there are per-table limits that apply when you create a table there.
533             For more information, see Limits page in the I<Amazon DynamoDB
534             Developer Guide>.
535              
536             Although you can increase these limits by filing a case at AWS Support
537             Center, obtaining the increase is not instantaneous. The
538             C<DescribeLimits> action lets you write code to compare the capacity
539             you are currently using to those limits imposed by your account so that
540             you have enough time to apply for an increase before you hit a limit.
541              
542             For example, you could use one of the AWS SDKs to do the following:
543              
544             =over
545              
546             =item 1.
547              
548             Call C<DescribeLimits> for a particular region to obtain your current
549             account limits on provisioned capacity there.
550              
551             =item 2.
552              
553             Create a variable to hold the aggregate read capacity units provisioned
554             for all your tables in that region, and one to hold the aggregate write
555             capacity units. Zero them both.
556              
557             =item 3.
558              
559             Call C<ListTables> to obtain a list of all your DynamoDB tables.
560              
561             =item 4.
562              
563             For each table name listed by C<ListTables>, do the following:
564              
565             =over
566              
567             =item *
568              
569             Call C<DescribeTable> with the table name.
570              
571             =item *
572              
573             Use the data returned by C<DescribeTable> to add the read capacity
574             units and write capacity units provisioned for the table itself to your
575             variables.
576              
577             =item *
578              
579             If the table has one or more global secondary indexes (GSIs), loop over
580             these GSIs and add their provisioned capacity values to your variables
581             as well.
582              
583             =back
584              
585             =item 5.
586              
587             Report the account limits for that region returned by
588             C<DescribeLimits>, along with the total current provisioned capacity
589             levels you have calculated.
590              
591             =back
592              
593             This will let you see whether you are getting close to your
594             account-level limits.
595              
596             The per-table limits apply only when you are creating a new table. They
597             restrict the sum of the provisioned capacity of the new table itself
598             and all its global secondary indexes.
599              
600             For existing tables and their GSIs, DynamoDB will not let you increase
601             provisioned capacity extremely rapidly, but the only upper limit that
602             applies is that the aggregate provisioned capacity over all your tables
603             and GSIs cannot exceed either of the per-account limits.
604              
605             C<DescribeLimits> should only be called periodically. You can expect
606             throttling errors if you call it more than once in a minute.
607              
608             The C<DescribeLimits> Request element has no content.
609              
610              
611             =head2 DescribeTable(TableName => Str)
612              
613             Each argument is described in detail in: L<Paws::DynamoDB::DescribeTable>
614              
615             Returns: a L<Paws::DynamoDB::DescribeTableOutput> instance
616              
617             Returns information about the table, including the current status of
618             the table, when it was created, the primary key schema, and any indexes
619             on the table.
620              
621             If you issue a C<DescribeTable> request immediately after a
622             C<CreateTable> request, DynamoDB might return a
623             C<ResourceNotFoundException>. This is because C<DescribeTable> uses an
624             eventually consistent query, and the metadata for your table might not
625             be available at that moment. Wait for a few seconds, and then try the
626             C<DescribeTable> request again.
627              
628              
629             =head2 DescribeTimeToLive(TableName => Str)
630              
631             Each argument is described in detail in: L<Paws::DynamoDB::DescribeTimeToLive>
632              
633             Returns: a L<Paws::DynamoDB::DescribeTimeToLiveOutput> instance
634              
635             Gives a description of the Time to Live (TTL) status on the specified
636             table.
637              
638              
639             =head2 GetItem(Key => L<Paws::DynamoDB::Key>, TableName => Str, [AttributesToGet => ArrayRef[Str|Undef], ConsistentRead => Bool, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ProjectionExpression => Str, ReturnConsumedCapacity => Str])
640              
641             Each argument is described in detail in: L<Paws::DynamoDB::GetItem>
642              
643             Returns: a L<Paws::DynamoDB::GetItemOutput> instance
644              
645             The C<GetItem> operation returns a set of attributes for the item with
646             the given primary key. If there is no matching item, C<GetItem> does
647             not return any data and there will be no C<Item> element in the
648             response.
649              
650             C<GetItem> provides an eventually consistent read by default. If your
651             application requires a strongly consistent read, set C<ConsistentRead>
652             to C<true>. Although a strongly consistent read might take more time
653             than an eventually consistent read, it always returns the last updated
654             value.
655              
656              
657             =head2 ListTables([ExclusiveStartTableName => Str, Limit => Int])
658              
659             Each argument is described in detail in: L<Paws::DynamoDB::ListTables>
660              
661             Returns: a L<Paws::DynamoDB::ListTablesOutput> instance
662              
663             Returns an array of table names associated with the current account and
664             endpoint. The output from C<ListTables> is paginated, with each page
665             returning a maximum of 100 table names.
666              
667              
668             =head2 ListTagsOfResource(ResourceArn => Str, [NextToken => Str])
669              
670             Each argument is described in detail in: L<Paws::DynamoDB::ListTagsOfResource>
671              
672             Returns: a L<Paws::DynamoDB::ListTagsOfResourceOutput> instance
673              
674             List all tags on an Amazon DynamoDB resource. You can call
675             ListTagsOfResource up to 10 times per second, per account.
676              
677             For an overview on tagging DynamoDB resources, see Tagging for DynamoDB
678             in the I<Amazon DynamoDB Developer Guide>.
679              
680              
681             =head2 PutItem(Item => L<Paws::DynamoDB::PutItemInputAttributeMap>, TableName => Str, [ConditionalOperator => Str, ConditionExpression => Str, Expected => L<Paws::DynamoDB::ExpectedAttributeMap>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, ReturnConsumedCapacity => Str, ReturnItemCollectionMetrics => Str, ReturnValues => Str])
682              
683             Each argument is described in detail in: L<Paws::DynamoDB::PutItem>
684              
685             Returns: a L<Paws::DynamoDB::PutItemOutput> instance
686              
687             Creates a new item, or replaces an old item with a new item. If an item
688             that has the same primary key as the new item already exists in the
689             specified table, the new item completely replaces the existing item.
690             You can perform a conditional put operation (add a new item if one with
691             the specified primary key doesn't exist), or replace an existing item
692             if it has certain attribute values.
693              
694             In addition to putting an item, you can also return the item's
695             attribute values in the same operation, using the C<ReturnValues>
696             parameter.
697              
698             When you add an item, the primary key attribute(s) are the only
699             required attributes. Attribute values cannot be null. String and Binary
700             type attributes must have lengths greater than zero. Set type
701             attributes cannot be empty. Requests with empty values will be rejected
702             with a C<ValidationException> exception.
703              
704             To prevent a new item from replacing an existing item, use a
705             conditional expression that contains the C<attribute_not_exists>
706             function with the name of the attribute being used as the partition key
707             for the table. Since every record must contain that attribute, the
708             C<attribute_not_exists> function will only succeed if no matching item
709             exists.
710              
711             For more information about C<PutItem>, see Working with Items in the
712             I<Amazon DynamoDB Developer Guide>.
713              
714              
715             =head2 Query(TableName => Str, [AttributesToGet => ArrayRef[Str|Undef], ConditionalOperator => Str, ConsistentRead => Bool, ExclusiveStartKey => L<Paws::DynamoDB::Key>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, FilterExpression => Str, IndexName => Str, KeyConditionExpression => Str, KeyConditions => L<Paws::DynamoDB::KeyConditions>, Limit => Int, ProjectionExpression => Str, QueryFilter => L<Paws::DynamoDB::FilterConditionMap>, ReturnConsumedCapacity => Str, ScanIndexForward => Bool, Select => Str])
716              
717             Each argument is described in detail in: L<Paws::DynamoDB::Query>
718              
719             Returns: a L<Paws::DynamoDB::QueryOutput> instance
720              
721             A C<Query> operation uses the primary key of a table or a secondary
722             index to directly access items from that table or index.
723              
724             Use the C<KeyConditionExpression> parameter to provide a specific value
725             for the partition key. The C<Query> operation will return all of the
726             items from the table or index with that partition key value. You can
727             optionally narrow the scope of the C<Query> operation by specifying a
728             sort key value and a comparison operator in C<KeyConditionExpression>.
729             You can use the C<ScanIndexForward> parameter to get results in forward
730             or reverse order, by sort key.
731              
732             Queries that do not return results consume the minimum number of read
733             capacity units for that type of read operation.
734              
735             If the total number of items meeting the query criteria exceeds the
736             result set size limit of 1 MB, the query stops and results are returned
737             to the user with the C<LastEvaluatedKey> element to continue the query
738             in a subsequent operation. Unlike a C<Scan> operation, a C<Query>
739             operation never returns both an empty result set and a
740             C<LastEvaluatedKey> value. C<LastEvaluatedKey> is only provided if you
741             have used the C<Limit> parameter, or if the result set exceeds 1 MB
742             (prior to applying a filter).
743              
744             You can query a table, a local secondary index, or a global secondary
745             index. For a query on a table or on a local secondary index, you can
746             set the C<ConsistentRead> parameter to C<true> and obtain a strongly
747             consistent result. Global secondary indexes support eventually
748             consistent reads only, so do not specify C<ConsistentRead> when
749             querying a global secondary index.
750              
751              
752             =head2 Scan(TableName => Str, [AttributesToGet => ArrayRef[Str|Undef], ConditionalOperator => Str, ConsistentRead => Bool, ExclusiveStartKey => L<Paws::DynamoDB::Key>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, FilterExpression => Str, IndexName => Str, Limit => Int, ProjectionExpression => Str, ReturnConsumedCapacity => Str, ScanFilter => L<Paws::DynamoDB::FilterConditionMap>, Segment => Int, Select => Str, TotalSegments => Int])
753              
754             Each argument is described in detail in: L<Paws::DynamoDB::Scan>
755              
756             Returns: a L<Paws::DynamoDB::ScanOutput> instance
757              
758             The C<Scan> operation returns one or more items and item attributes by
759             accessing every item in a table or a secondary index. To have DynamoDB
760             return fewer items, you can provide a C<FilterExpression> operation.
761              
762             If the total number of scanned items exceeds the maximum data set size
763             limit of 1 MB, the scan stops and results are returned to the user as a
764             C<LastEvaluatedKey> value to continue the scan in a subsequent
765             operation. The results also include the number of items exceeding the
766             limit. A scan can result in no table data meeting the filter criteria.
767              
768             By default, C<Scan> operations proceed sequentially; however, for
769             faster performance on a large table or secondary index, applications
770             can request a parallel C<Scan> operation by providing the C<Segment>
771             and C<TotalSegments> parameters. For more information, see Parallel
772             Scan in the I<Amazon DynamoDB Developer Guide>.
773              
774             By default, C<Scan> uses eventually consistent reads when accessing the
775             data in a table; therefore, the result set might not include the
776             changes to data in the table immediately before the operation began. If
777             you need a consistent copy of the data, as of the time that the Scan
778             begins, you can set the C<ConsistentRead> parameter to C<true>.
779              
780              
781             =head2 TagResource(ResourceArn => Str, Tags => ArrayRef[L<Paws::DynamoDB::Tag>])
782              
783             Each argument is described in detail in: L<Paws::DynamoDB::TagResource>
784              
785             Returns: nothing
786              
787             Associate a set of tags with an Amazon DynamoDB resource. You can then
788             activate these user-defined tags so that they appear on the Billing and
789             Cost Management console for cost allocation tracking. You can call
790             TagResource up to 5 times per second, per account.
791              
792             For an overview on tagging DynamoDB resources, see Tagging for DynamoDB
793             in the I<Amazon DynamoDB Developer Guide>.
794              
795              
796             =head2 UntagResource(ResourceArn => Str, TagKeys => ArrayRef[Str|Undef])
797              
798             Each argument is described in detail in: L<Paws::DynamoDB::UntagResource>
799              
800             Returns: nothing
801              
802             Removes the association of tags from an Amazon DynamoDB resource. You
803             can call UntagResource up to 5 times per second, per account.
804              
805             For an overview on tagging DynamoDB resources, see Tagging for DynamoDB
806             in the I<Amazon DynamoDB Developer Guide>.
807              
808              
809             =head2 UpdateItem(Key => L<Paws::DynamoDB::Key>, TableName => Str, [AttributeUpdates => L<Paws::DynamoDB::AttributeUpdates>, ConditionalOperator => Str, ConditionExpression => Str, Expected => L<Paws::DynamoDB::ExpectedAttributeMap>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, ReturnConsumedCapacity => Str, ReturnItemCollectionMetrics => Str, ReturnValues => Str, UpdateExpression => Str])
810              
811             Each argument is described in detail in: L<Paws::DynamoDB::UpdateItem>
812              
813             Returns: a L<Paws::DynamoDB::UpdateItemOutput> instance
814              
815             Edits an existing item's attributes, or adds a new item to the table if
816             it does not already exist. You can put, delete, or add attribute
817             values. You can also perform a conditional update on an existing item
818             (insert a new attribute name-value pair if it doesn't exist, or replace
819             an existing name-value pair if it has certain expected attribute
820             values).
821              
822             You can also return the item's attribute values in the same
823             C<UpdateItem> operation using the C<ReturnValues> parameter.
824              
825              
826             =head2 UpdateTable(TableName => Str, [AttributeDefinitions => ArrayRef[L<Paws::DynamoDB::AttributeDefinition>], GlobalSecondaryIndexUpdates => ArrayRef[L<Paws::DynamoDB::GlobalSecondaryIndexUpdate>], ProvisionedThroughput => L<Paws::DynamoDB::ProvisionedThroughput>, StreamSpecification => L<Paws::DynamoDB::StreamSpecification>])
827              
828             Each argument is described in detail in: L<Paws::DynamoDB::UpdateTable>
829              
830             Returns: a L<Paws::DynamoDB::UpdateTableOutput> instance
831              
832             Modifies the provisioned throughput settings, global secondary indexes,
833             or DynamoDB Streams settings for a given table.
834              
835             You can only perform one of the following operations at once:
836              
837             =over
838              
839             =item *
840              
841             Modify the provisioned throughput settings of the table.
842              
843             =item *
844              
845             Enable or disable Streams on the table.
846              
847             =item *
848              
849             Remove a global secondary index from the table.
850              
851             =item *
852              
853             Create a new global secondary index on the table. Once the index begins
854             backfilling, you can use C<UpdateTable> to perform other operations.
855              
856             =back
857              
858             C<UpdateTable> is an asynchronous operation; while it is executing, the
859             table status changes from C<ACTIVE> to C<UPDATING>. While it is
860             C<UPDATING>, you cannot issue another C<UpdateTable> request. When the
861             table returns to the C<ACTIVE> state, the C<UpdateTable> operation is
862             complete.
863              
864              
865             =head2 UpdateTimeToLive(TableName => Str, TimeToLiveSpecification => L<Paws::DynamoDB::TimeToLiveSpecification>)
866              
867             Each argument is described in detail in: L<Paws::DynamoDB::UpdateTimeToLive>
868              
869             Returns: a L<Paws::DynamoDB::UpdateTimeToLiveOutput> instance
870              
871             Specify the lifetime of individual table items. The database
872             automatically removes the item at the expiration of the item. The
873             UpdateTimeToLive method will enable or disable TTL for the specified
874             table. A successful C<UpdateTimeToLive> call returns the current
875             C<TimeToLiveSpecification>; it may take up to one hour for the change
876             to fully process.
877              
878             TTL compares the current time in epoch time format to the time stored
879             in the TTL attribute of an item. If the epoch time value stored in the
880             attribute is less than the current time, the item is marked as expired
881             and subsequently deleted.
882              
883             The epoch time format is the number of seconds elapsed since 12:00:00
884             AM January 1st, 1970 UTC.
885              
886             DynamoDB deletes expired items on a best-effort basis to ensure
887             availability of throughput for other data operations.
888              
889             DynamoDB typically deletes expired items within two days of expiration.
890             The exact duration within which an item gets deleted after expiration
891             is specific to the nature of the workload. Items that have expired and
892             not been deleted will still show up in reads, queries, and scans.
893              
894             As items are deleted, they are removed from any Local Secondary Index
895             and Global Secondary Index immediately in the same eventually
896             consistent way as a standard delete operation.
897              
898             For more information, see Time To Live in the Amazon DynamoDB Developer
899             Guide.
900              
901              
902              
903              
904             =head1 PAGINATORS
905              
906             Paginator methods are helpers that repetively call methods that return partial results
907              
908             =head2 ListAllTables(sub { },[ExclusiveStartTableName => Str, Limit => Int])
909              
910             =head2 ListAllTables([ExclusiveStartTableName => Str, Limit => Int])
911              
912              
913             If passed a sub as first parameter, it will call the sub for each element found in :
914              
915             - TableNames, passing the object as the first parameter, and the string 'TableNames' as the second parameter
916              
917             If not, it will return a a L<Paws::DynamoDB::ListTablesOutput> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
918              
919              
920             =head2 QueryAll(sub { },TableName => Str, [AttributesToGet => ArrayRef[Str|Undef], ConditionalOperator => Str, ConsistentRead => Bool, ExclusiveStartKey => L<Paws::DynamoDB::Key>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, FilterExpression => Str, IndexName => Str, KeyConditionExpression => Str, KeyConditions => L<Paws::DynamoDB::KeyConditions>, Limit => Int, ProjectionExpression => Str, QueryFilter => L<Paws::DynamoDB::FilterConditionMap>, ReturnConsumedCapacity => Str, ScanIndexForward => Bool, Select => Str])
921              
922             =head2 QueryAll(TableName => Str, [AttributesToGet => ArrayRef[Str|Undef], ConditionalOperator => Str, ConsistentRead => Bool, ExclusiveStartKey => L<Paws::DynamoDB::Key>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, FilterExpression => Str, IndexName => Str, KeyConditionExpression => Str, KeyConditions => L<Paws::DynamoDB::KeyConditions>, Limit => Int, ProjectionExpression => Str, QueryFilter => L<Paws::DynamoDB::FilterConditionMap>, ReturnConsumedCapacity => Str, ScanIndexForward => Bool, Select => Str])
923              
924              
925             If passed a sub as first parameter, it will call the sub for each element found in :
926              
927             - Items, passing the object as the first parameter, and the string 'Items' as the second parameter
928              
929             - Count, passing the object as the first parameter, and the string 'Count' as the second parameter
930              
931             - ScannedCount, passing the object as the first parameter, and the string 'ScannedCount' as the second parameter
932              
933             If not, it will return a a L<Paws::DynamoDB::QueryOutput> instance with all the C<param>s; andC<param>s; andC<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
934              
935              
936             =head2 ScanAll(sub { },TableName => Str, [AttributesToGet => ArrayRef[Str|Undef], ConditionalOperator => Str, ConsistentRead => Bool, ExclusiveStartKey => L<Paws::DynamoDB::Key>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, FilterExpression => Str, IndexName => Str, Limit => Int, ProjectionExpression => Str, ReturnConsumedCapacity => Str, ScanFilter => L<Paws::DynamoDB::FilterConditionMap>, Segment => Int, Select => Str, TotalSegments => Int])
937              
938             =head2 ScanAll(TableName => Str, [AttributesToGet => ArrayRef[Str|Undef], ConditionalOperator => Str, ConsistentRead => Bool, ExclusiveStartKey => L<Paws::DynamoDB::Key>, ExpressionAttributeNames => L<Paws::DynamoDB::ExpressionAttributeNameMap>, ExpressionAttributeValues => L<Paws::DynamoDB::ExpressionAttributeValueMap>, FilterExpression => Str, IndexName => Str, Limit => Int, ProjectionExpression => Str, ReturnConsumedCapacity => Str, ScanFilter => L<Paws::DynamoDB::FilterConditionMap>, Segment => Int, Select => Str, TotalSegments => Int])
939              
940              
941             If passed a sub as first parameter, it will call the sub for each element found in :
942              
943             - Items, passing the object as the first parameter, and the string 'Items' as the second parameter
944              
945             - Count, passing the object as the first parameter, and the string 'Count' as the second parameter
946              
947             - ScannedCount, passing the object as the first parameter, and the string 'ScannedCount' as the second parameter
948              
949             If not, it will return a a L<Paws::DynamoDB::ScanOutput> instance with all the C<param>s; andC<param>s; andC<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
950              
951              
952              
953              
954              
955             =head1 SEE ALSO
956              
957             This service class forms part of L<Paws>
958              
959             =head1 BUGS and CONTRIBUTIONS
960              
961             The source code is located here: https://github.com/pplu/aws-sdk-perl
962              
963             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
964              
965             =cut
966