NAME

WebService::Amazon::DynamoDB - perl server implementation for the AWS DynamoDB API

VERSION

version 0.001

DESCRIPTION

METHODS

new

list_tables

Takes the following named parameters:

  • ExclusiveStartTableName

  • Limit

Resolves to a hashref containing the following data:

  • LastEvaluatedTableName

  • TableNames

ListTables (p. 58)

create_table

CreateTable (p. 22)

describe_table

DescribeTable (p. 47)

update_table

UpdateTable (p. 119)

delete_table

DeleteTable (p. 43)

put_item

PutItem (p. 61)

get_item

GetItem (p. 52)

update_item

UpdateItem (p. 103)

METHODS - Internal

The following methods are not part of the standard DynamoDB public API, so they are not recommended for use directly.

add_table

Adds this table - called by "create_table" if everything passes validation.

drop_table

Drops the table - called to remove a table that was previously in 'DELETING' state.

return_values

Resolves to the attributes requested for this update.

consumed_capacity

Returns consumed capacity information if available.

collection_metrics

Resolves to collection metrics information, if available.

table_status

Update or return current table status.

have_table

Returns true if we have this table.

validate_table_state

Raises various exceptions based on table state.

EVENTS

The following events may be raised on the message bus used by this class - use "subscribe_to_event" in Mixin::Event::Dispatch to watch for them:

 $srv->bus->subscribe_to_event(
   list_tables => sub {
     my ($ev, $tables, $req, $resp) = @_;
	 ...
   }
 );

Note that most of these include a Future - the event is triggered once the Future is marked as ready, so it should be safe to call get to examine the current state:

 $srv->bus->subscribe_to_event(
   create_table => sub {
     my ($ev, $tbl, $req, $resp) = @_;
	 warn "Had a failed table creation request" unless eval { $resp->get };
   }
 );

list_tables event

List tables request.

describe_table event

Describe table request.

create_table event

Called when have had a table creation request.

update_table event

A table update request.

delete_table event

Called when we have had a table deletion request.

  • $request - the original request which caused the creation, as a hashref

  • $response - the response that will be sent back to the client, as a Future

  • $tbl - the WebService::Amazon::DynamoDB::Server::Table instance that will be deleted, may be undef

get_item event

Get item request.

put_item event

Put item request.

AUTHOR

Tom Molesworth <cpan@perlsite.co.uk>

LICENSE

Copyright Tom Molesworth 2013-2015. Licensed under the same terms as Perl itself.