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   3697 use Moose;
  1     4   4  
  1         10  
  4         3655  
  4         10  
  4         32  
3 30     30 0 157 sub service { 'dynamodb' }
4 5     5 0 41 sub version { '2012-08-10' }
5 5     5 0 192 sub target_prefix { 'DynamoDB_20120810' }
6 5     5 0 20 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 1463 my $self = shift;
45 2         18 my $call_object = $self->new_with_coercions('Paws::DynamoDB::BatchGetItem', @_);
46 2         1339 return $self->caller->do_call($self, $call_object);
47             }
48             sub BatchWriteItem {
49 1     1 1 2663 my $self = shift;
50 1         7 my $call_object = $self->new_with_coercions('Paws::DynamoDB::BatchWriteItem', @_);
51 1         737 return $self->caller->do_call($self, $call_object);
52             }
53             sub CreateTable {
54 2     2 1 837 my $self = shift;
55 2         13 my $call_object = $self->new_with_coercions('Paws::DynamoDB::CreateTable', @_);
56 2         3372 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 740 my $self = shift;
65 2         19 my $call_object = $self->new_with_coercions('Paws::DynamoDB::DeleteTable', @_);
66 2         1354 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 338 my $self = shift;
75 1         9 my $call_object = $self->new_with_coercions('Paws::DynamoDB::DescribeTable', @_);
76 1         553 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 2634 my $self = shift;
85 4         29 my $call_object = $self->new_with_coercions('Paws::DynamoDB::GetItem', @_);
86 4         5682 return $self->caller->do_call($self, $call_object);
87             }
88             sub ListTables {
89 3     3 1 258 my $self = shift;
90 3         20 my $call_object = $self->new_with_coercions('Paws::DynamoDB::ListTables', @_);
91 3         1567 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 1567 my $self = shift;
100 2         17 my $call_object = $self->new_with_coercions('Paws::DynamoDB::PutItem', @_);
101 2         3242 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 1531 my $self = shift;
110 2         17 my $call_object = $self->new_with_coercions('Paws::DynamoDB::Scan', @_);
111 2         4271 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. You can return the item's attribute
693             values in the same operation, using the C<ReturnValues> parameter.
694              
695             This topic provides general information about the C<PutItem> API.
696              
697             For information on how to call the C<PutItem> API using the AWS SDK in
698             specific languages, see the following:
699              
700             =over
701              
702             =item *
703              
704             PutItem in the AWS Command Line Interface
705              
706             =item *
707              
708             PutItem in the AWS SDK for .NET
709              
710             =item *
711              
712             PutItem in the AWS SDK for C++
713              
714             =item *
715              
716             PutItem in the AWS SDK for Go
717              
718             =item *
719              
720             PutItem in the AWS SDK for Java
721              
722             =item *
723              
724             PutItem in the AWS SDK for JavaScript
725              
726             =item *
727              
728             PutItem in the AWS SDK for PHP V3
729              
730             =item *
731              
732             PutItem in the AWS SDK for Python
733              
734             =item *
735              
736             PutItem in the AWS SDK for Ruby V2
737              
738             =back
739              
740             When you add an item, the primary key attribute(s) are the only
741             required attributes. Attribute values cannot be null. String and Binary
742             type attributes must have lengths greater than zero. Set type
743             attributes cannot be empty. Requests with empty values will be rejected
744             with a C<ValidationException> exception.
745              
746             To prevent a new item from replacing an existing item, use a
747             conditional expression that contains the C<attribute_not_exists>
748             function with the name of the attribute being used as the partition key
749             for the table. Since every record must contain that attribute, the
750             C<attribute_not_exists> function will only succeed if no matching item
751             exists.
752              
753             For more information about C<PutItem>, see Working with Items in the
754             I<Amazon DynamoDB Developer Guide>.
755              
756              
757             =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])
758              
759             Each argument is described in detail in: L<Paws::DynamoDB::Query>
760              
761             Returns: a L<Paws::DynamoDB::QueryOutput> instance
762              
763             The C<Query> operation finds items based on primary key values. You can
764             query any table or secondary index that has a composite primary key (a
765             partition key and a sort key).
766              
767             Use the C<KeyConditionExpression> parameter to provide a specific value
768             for the partition key. The C<Query> operation will return all of the
769             items from the table or index with that partition key value. You can
770             optionally narrow the scope of the C<Query> operation by specifying a
771             sort key value and a comparison operator in C<KeyConditionExpression>.
772             To further refine the C<Query> results, you can optionally provide a
773             C<FilterExpression>. A C<FilterExpression> determines which items
774             within the results should be returned to you. All of the other results
775             are discarded.
776              
777             A C<Query> operation always returns a result set. If no matching items
778             are found, the result set will be empty. Queries that do not return
779             results consume the minimum number of read capacity units for that type
780             of read operation.
781              
782             DynamoDB calculates the number of read capacity units consumed based on
783             item size, not on the amount of data that is returned to an
784             application. The number of capacity units consumed will be the same
785             whether you request all of the attributes (the default behavior) or
786             just some of them (using a projection expression). The number will also
787             be the same whether or not you use a C<FilterExpression>.
788              
789             C<Query> results are always sorted by the sort key value. If the data
790             type of the sort key is Number, the results are returned in numeric
791             order; otherwise, the results are returned in order of UTF-8 bytes. By
792             default, the sort order is ascending. To reverse the order, set the
793             C<ScanIndexForward> parameter to false.
794              
795             A single C<Query> operation will read up to the maximum number of items
796             set (if using the C<Limit> parameter) or a maximum of 1 MB of data and
797             then apply any filtering to the results using C<FilterExpression>. If
798             C<LastEvaluatedKey> is present in the response, you will need to
799             paginate the result set. For more information, see Paginating the
800             Results in the I<Amazon DynamoDB Developer Guide>.
801              
802             C<FilterExpression> is applied after a C<Query> finishes, but before
803             the results are returned. A C<FilterExpression> cannot contain
804             partition key or sort key attributes. You need to specify those
805             attributes in the C<KeyConditionExpression>.
806              
807             A C<Query> operation can return an empty result set and a
808             C<LastEvaluatedKey> if all the items read for the page of results are
809             filtered out.
810              
811             You can query a table, a local secondary index, or a global secondary
812             index. For a query on a table or on a local secondary index, you can
813             set the C<ConsistentRead> parameter to C<true> and obtain a strongly
814             consistent result. Global secondary indexes support eventually
815             consistent reads only, so do not specify C<ConsistentRead> when
816             querying a global secondary index.
817              
818              
819             =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])
820              
821             Each argument is described in detail in: L<Paws::DynamoDB::Scan>
822              
823             Returns: a L<Paws::DynamoDB::ScanOutput> instance
824              
825             The C<Scan> operation returns one or more items and item attributes by
826             accessing every item in a table or a secondary index. To have DynamoDB
827             return fewer items, you can provide a C<FilterExpression> operation.
828              
829             If the total number of scanned items exceeds the maximum data set size
830             limit of 1 MB, the scan stops and results are returned to the user as a
831             C<LastEvaluatedKey> value to continue the scan in a subsequent
832             operation. The results also include the number of items exceeding the
833             limit. A scan can result in no table data meeting the filter criteria.
834              
835             A single C<Scan> operation will read up to the maximum number of items
836             set (if using the C<Limit> parameter) or a maximum of 1 MB of data and
837             then apply any filtering to the results using C<FilterExpression>. If
838             C<LastEvaluatedKey> is present in the response, you will need to
839             paginate the result set. For more information, see Paginating the
840             Results in the I<Amazon DynamoDB Developer Guide>.
841              
842             C<Scan> operations proceed sequentially; however, for faster
843             performance on a large table or secondary index, applications can
844             request a parallel C<Scan> operation by providing the C<Segment> and
845             C<TotalSegments> parameters. For more information, see Parallel Scan in
846             the I<Amazon DynamoDB Developer Guide>.
847              
848             C<Scan> uses eventually consistent reads when accessing the data in a
849             table; therefore, the result set might not include the changes to data
850             in the table immediately before the operation began. If you need a
851             consistent copy of the data, as of the time that the C<Scan> begins,
852             you can set the C<ConsistentRead> parameter to C<true>.
853              
854              
855             =head2 TagResource(ResourceArn => Str, Tags => ArrayRef[L<Paws::DynamoDB::Tag>])
856              
857             Each argument is described in detail in: L<Paws::DynamoDB::TagResource>
858              
859             Returns: nothing
860              
861             Associate a set of tags with an Amazon DynamoDB resource. You can then
862             activate these user-defined tags so that they appear on the Billing and
863             Cost Management console for cost allocation tracking. You can call
864             TagResource up to 5 times per second, per account.
865              
866             For an overview on tagging DynamoDB resources, see Tagging for DynamoDB
867             in the I<Amazon DynamoDB Developer Guide>.
868              
869              
870             =head2 UntagResource(ResourceArn => Str, TagKeys => ArrayRef[Str|Undef])
871              
872             Each argument is described in detail in: L<Paws::DynamoDB::UntagResource>
873              
874             Returns: nothing
875              
876             Removes the association of tags from an Amazon DynamoDB resource. You
877             can call UntagResource up to 5 times per second, per account.
878              
879             For an overview on tagging DynamoDB resources, see Tagging for DynamoDB
880             in the I<Amazon DynamoDB Developer Guide>.
881              
882              
883             =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])
884              
885             Each argument is described in detail in: L<Paws::DynamoDB::UpdateItem>
886              
887             Returns: a L<Paws::DynamoDB::UpdateItemOutput> instance
888              
889             Edits an existing item's attributes, or adds a new item to the table if
890             it does not already exist. You can put, delete, or add attribute
891             values. You can also perform a conditional update on an existing item
892             (insert a new attribute name-value pair if it doesn't exist, or replace
893             an existing name-value pair if it has certain expected attribute
894             values).
895              
896             You can also return the item's attribute values in the same
897             C<UpdateItem> operation using the C<ReturnValues> parameter.
898              
899              
900             =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>])
901              
902             Each argument is described in detail in: L<Paws::DynamoDB::UpdateTable>
903              
904             Returns: a L<Paws::DynamoDB::UpdateTableOutput> instance
905              
906             Modifies the provisioned throughput settings, global secondary indexes,
907             or DynamoDB Streams settings for a given table.
908              
909             You can only perform one of the following operations at once:
910              
911             =over
912              
913             =item *
914              
915             Modify the provisioned throughput settings of the table.
916              
917             =item *
918              
919             Enable or disable Streams on the table.
920              
921             =item *
922              
923             Remove a global secondary index from the table.
924              
925             =item *
926              
927             Create a new global secondary index on the table. Once the index begins
928             backfilling, you can use C<UpdateTable> to perform other operations.
929              
930             =back
931              
932             C<UpdateTable> is an asynchronous operation; while it is executing, the
933             table status changes from C<ACTIVE> to C<UPDATING>. While it is
934             C<UPDATING>, you cannot issue another C<UpdateTable> request. When the
935             table returns to the C<ACTIVE> state, the C<UpdateTable> operation is
936             complete.
937              
938              
939             =head2 UpdateTimeToLive(TableName => Str, TimeToLiveSpecification => L<Paws::DynamoDB::TimeToLiveSpecification>)
940              
941             Each argument is described in detail in: L<Paws::DynamoDB::UpdateTimeToLive>
942              
943             Returns: a L<Paws::DynamoDB::UpdateTimeToLiveOutput> instance
944              
945             The UpdateTimeToLive method will enable or disable TTL for the
946             specified table. A successful C<UpdateTimeToLive> call returns the
947             current C<TimeToLiveSpecification>; it may take up to one hour for the
948             change to fully process. Any additional C<UpdateTimeToLive> calls for
949             the same table during this one hour duration result in a
950             C<ValidationException>.
951              
952             TTL compares the current time in epoch time format to the time stored
953             in the TTL attribute of an item. If the epoch time value stored in the
954             attribute is less than the current time, the item is marked as expired
955             and subsequently deleted.
956              
957             The epoch time format is the number of seconds elapsed since 12:00:00
958             AM January 1st, 1970 UTC.
959              
960             DynamoDB deletes expired items on a best-effort basis to ensure
961             availability of throughput for other data operations.
962              
963             DynamoDB typically deletes expired items within two days of expiration.
964             The exact duration within which an item gets deleted after expiration
965             is specific to the nature of the workload. Items that have expired and
966             not been deleted will still show up in reads, queries, and scans.
967              
968             As items are deleted, they are removed from any Local Secondary Index
969             and Global Secondary Index immediately in the same eventually
970             consistent way as a standard delete operation.
971              
972             For more information, see Time To Live in the Amazon DynamoDB Developer
973             Guide.
974              
975              
976              
977              
978             =head1 PAGINATORS
979              
980             Paginator methods are helpers that repetively call methods that return partial results
981              
982             =head2 ListAllTables(sub { },[ExclusiveStartTableName => Str, Limit => Int])
983              
984             =head2 ListAllTables([ExclusiveStartTableName => Str, Limit => Int])
985              
986              
987             If passed a sub as first parameter, it will call the sub for each element found in :
988              
989             - TableNames, passing the object as the first parameter, and the string 'TableNames' as the second parameter
990              
991             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.
992              
993              
994             =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])
995              
996             =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])
997              
998              
999             If passed a sub as first parameter, it will call the sub for each element found in :
1000              
1001             - Items, passing the object as the first parameter, and the string 'Items' as the second parameter
1002              
1003             - Count, passing the object as the first parameter, and the string 'Count' as the second parameter
1004              
1005             - ScannedCount, passing the object as the first parameter, and the string 'ScannedCount' as the second parameter
1006              
1007             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.
1008              
1009              
1010             =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])
1011              
1012             =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])
1013              
1014              
1015             If passed a sub as first parameter, it will call the sub for each element found in :
1016              
1017             - Items, passing the object as the first parameter, and the string 'Items' as the second parameter
1018              
1019             - Count, passing the object as the first parameter, and the string 'Count' as the second parameter
1020              
1021             - ScannedCount, passing the object as the first parameter, and the string 'ScannedCount' as the second parameter
1022              
1023             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.
1024              
1025              
1026              
1027              
1028              
1029             =head1 SEE ALSO
1030              
1031             This service class forms part of L<Paws>
1032              
1033             =head1 BUGS and CONTRIBUTIONS
1034              
1035             The source code is located here: https://github.com/pplu/aws-sdk-perl
1036              
1037             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
1038              
1039             =cut
1040