The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::Amazon::DynamoDB::20120810 - interact with DynamoDB using API version 20120810

VERSION

version 0.001

DESCRIPTION

new

Instantiates the API object.

Expects the following named parameters:

  • implementation - the object which provides a Future-returning request method, see WebService::Amazon::DynamoDB::NaHTTP for example.

  • host - the host (IP or hostname) to communicate with

  • port - the port to use for HTTP(S) requests

  • ssl - true for HTTPS, false for HTTP

  • algorithm - which signing algorithm to use, default AWS4-HMAC-SHA256

  • scope - the scope for requests, typically region/host/aws4_request

  • access_key - the access key for signing requests

  • secret_key - the secret key for signing requests

create_table

Creates a new table. It may take some time before the table is marked as active - use "wait_for_table" to poll until the status changes.

Named parameters:

  • table - the table name

  • read_capacity - expected read capacity units (optional, default 5)

  • write_capacity - expected write capacity units (optional, default 5)

  • fields - an arrayref specifying the fields, in pairs of (name, type), where type is N for numeric, S for string, SS for string sequence, B for binary etc.

  • primary - the primary keys as an arrayref of pairs indicating (name, type), default type is hash so ['pkey'] would create a single HASH primary key

describe_table

Describes the given table.

Takes a single named parameter:

  • table - the table name

and returns the table spec.

delete_table

Delete a table entirely.

Takes a single named parameter:

  • table - the table name

wait_for_table

Waits for the given table to be marked as active.

Takes a single named parameter:

  • table - the table name

each_table

Run code for all current tables.

Takes a coderef as the first parameter, will call this for each table found.

put_item

Writes a single item to the table.

Takes the following named parameters:

  • table - the table name

  • fields - the field spec, as a { key => value } hashref

update_item

Updates a single item in the table.

Takes the following named parameters:

  • table - the table name

  • item - the item to update, as a{ key => value } hashref

  • fields - the field spec, as a { key => value } hashref

delete_item

Deletes a single item from the table.

Takes the following named parameters:

  • table - the table name

  • item - the item to delete, as a{ key => value } hashref

batch_get_item

Retrieve a batch of items from one or more tables.

Takes a coderef which will be called for each found item, followed by these named parameters:

  • items - the search spec, as { table => { attribute => 'value', ... }, ... }

scan

Scan a table for values with an optional filter expression.

METHODS - Internal

The following methods are intended for internal use and are documented purely for completeness - for normal operations see "METHODS" instead.

make_request

Generates an HTTP::Request.

FUNCTIONS - Internal

type_for_value

Returns an appropriate type (N, S, SS etc.) for the given value.

Rules are similar to JSON - if you want numeric, numify (0+$value), otherwise you'll get a string.

AUTHOR

Tom Molesworth <cpan@entitymodel.com>

LICENSE

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