Get all available regions for the Amazon DynamoDB service.
Return type: | list |
---|---|
Returns: | A list of boto.regioninfo.RegionInfo |
This is the lowest-level interface to DynamoDB. Methods at this layer map directly to API requests and parameters to the methods are either simple, scalar values or they are the Python equivalent of the JSON input as defined in the DynamoDB Developer’s Guide. All responses are direct decoding of the JSON response bodies to Python data structures via the json or simplejson modules.
Variables: | throughput_exceeded_events – An integer variable that keeps a running total of the number of ThroughputExceeded responses this connection has received from Amazon DynamoDB. |
---|
The error response returned when a conditional check fails
The default region name for DynamoDB API.
alias of DynamoDBResponseError
The name of the Service
The error response returned when session token has expired
The error response returned when provisioned throughput is exceeded
The error response returned when an item is invalid in some way
DynamoDB API version.
Return a set of attributes for a multiple items in multiple tables using their primary keys.
Parameters: | request_items (dict) – A Python version of the RequestItems data structure defined by DynamoDB. |
---|
This operation enables you to put or delete several items across multiple tables in a single API call.
Parameters: | request_items (dict) – A Python version of the RequestItems data structure defined by DynamoDB. |
---|
Add a new table to your account. The table name must be unique among those associated with the account issuing the request. This request triggers an asynchronous workflow to begin creating the table. When the workflow is complete, the state of the table will be ACTIVE.
Parameters: |
---|
Delete an item and all of it’s attributes by primary key. You can perform a conditional delete by specifying an expected rule.
Parameters: |
|
---|
Deletes the table and all of it’s data. After this request the table will be in the DELETING state until DynamoDB completes the delete operation.
Parameters: | table_name (str) – The name of the table to delete. |
---|
Returns information about the table including current state of the table, primary key schema and when the table was created.
Parameters: | table_name (str) – The name of the table to describe. |
---|
Return a set of attributes for an item that matches the supplied key.
Parameters: |
|
---|
Returns a dictionary of results. The dictionary contains a TableNames key whose value is a list of the table names. The dictionary could also contain a LastEvaluatedTableName key whose value would be the last table name returned if the complete list of table names was not returned. This value would then be passed as the start_table parameter on a subsequent call to this method.
Parameters: |
---|
Raises: | DynamoDBExpiredTokenError if the security token expires. |
---|
Create a new item or replace an old item with a new item (including all attributes). If an item already exists in the specified table with the same primary key, the new item will completely replace the old item. You can perform a conditional put by specifying an expected rule.
Parameters: |
|
---|
Perform a query of DynamoDB. This version is currently punting and expecting you to provide a full and correct JSON body which is passed as is to DynamoDB.
Parameters: |
|
---|
Perform a scan of DynamoDB. This version is currently punting and expecting you to provide a full and correct JSON body which is passed as is to DynamoDB.
Parameters: |
|
---|
Edits an existing item’s attributes. You can perform a conditional update (insert a new attribute name-value pair if it doesn’t exist, or replace an existing name-value pair if it has certain expected attribute values).
Parameters: |
|
---|
Return a set of attributes for a multiple items in multiple tables using their primary keys.
Parameters: | batch_list (boto.dynamodb.batch.BatchList) – A BatchList object which consists of a list of boto.dynamoddb.batch.Batch objects. Each Batch object contains the information about one batch of objects that you wish to retrieve in this request. |
---|
Performs multiple Puts and Deletes in one batch.
Parameters: | batch_list (boto.dynamodb.batch.BatchWriteList) – A BatchWriteList object which consists of a list of boto.dynamoddb.batch.BatchWrite objects. Each Batch object contains the information about one batch of objects that you wish to put or delete. |
---|
Build a Key structure to be used for accessing items in Amazon DynamoDB. This method takes the supplied hash_key and optional range_key and validates them against the schema. If there is a mismatch, a TypeError is raised. Otherwise, a Python dict version of a Amazon DynamoDB Key data structure is returned.
Parameters: |
|
---|
Create a Schema object used when creating a Table.
Parameters: |
|
---|
Create a new Amazon DynamoDB table.
Parameters: |
|
---|---|
Return type: | |
Returns: | A Table object representing the new Amazon DynamoDB table. |
Delete the item from Amazon DynamoDB.
Parameters: |
|
---|
Delete this table and all items in it. After calling this the Table objects status attribute will be set to ‘DELETING’.
Parameters: | table (boto.dynamodb.table.Table) – The Table object that is being deleted. |
---|
Retrieve information about an existing table.
Parameters: | name (str) – The name of the desired table. |
---|
Convert a set of pending item updates into the structure required by Layer1.
Convert an expected_value parameter into the data structure required for Layer1.
Convert a last_evaluated_key parameter into the data structure required for Layer1.
Convert a layer2 range_key_condition parameter into the structure required by Layer1.
Convert a layer2 scan_filter parameter into the structure required by Layer1.
Retrieve an existing item from the table.
Parameters: |
|
---|
Retrieve the Table object for an existing table.
Parameters: | name (str) – The name of the desired table. |
---|---|
Return type: | boto.dynamodb.table.Table |
Returns: | A Table object representing the table. |
Return a list of the names of all tables associated with the current account and region.
Parameters: | limit (int) – The maximum number of tables to return. |
---|
Retrieve the Table object for an existing table.
Parameters: | name (str) – The name of the desired table. |
---|---|
Return type: | boto.dynamodb.table.Table |
Returns: | A Table object representing the table. |
Return a new, empty boto.dynamodb.batch.BatchList object.
Return a new, empty boto.dynamodb.batch.BatchWriteList object.
Store a new item or completely replace an existing item in Amazon DynamoDB.
Parameters: |
|
---|
Perform a query on the table.
Parameters: |
|
---|---|
Return type: |
Perform a scan of DynamoDB.
Parameters: |
|
---|---|
Return type: |
Commit pending item updates to Amazon DynamoDB.
Parameters: |
|
---|
Update the ProvisionedThroughput for the Amazon DynamoDB Table.
Parameters: |
|
---|
This is an object that wraps up the table_generator function. The only real reason to have this is that we want to be able to accumulate and return the ConsumedCapacityUnits element that is part of each response.
Variables: | consumed_units – An integer that holds the number of ConsumedCapacityUnits accumulated thus far for this generator. |
---|
A custom object hook for use when decoding JSON item bodys. This hook will transform Amazon DynamoDB JSON responses to something that maps directly to native Python types.
A low-level generator used to page through results from query and scan operations. This is used by boto.dynamodb.layer2.TableGenerator and is not intended to be used outside of that context.
An Amazon DynamoDB table.
Variables: |
|
---|
Return a set of attributes for a multiple items from a single table using their primary keys. This abstraction removes the 100 Items per batch limitations as well as the “UnprocessedKeys” logic.
Parameters: |
|
---|---|
Returns: | A TableBatchGenerator (generator) object which will iterate over all results |
Return type: |
Delete this table and all items in it. After calling this the Table objects status attribute will be set to ‘DELETING’.
Retrieve an existing item from the table.
Parameters: |
|
---|
Checks the table to see if the Item with the specified hash_key exists. This may save a tiny bit of time/bandwidth over a straight get_item() if you have no intention to touch the data that is returned, since this method specifically tells Amazon not to return anything but the Item’s key.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if the Item exists, False if not. |
Retrieve an existing item from the table.
Parameters: |
|
---|
Return an new, unsaved Item which can later be PUT to Amazon DynamoDB.
This method has explicit (but optional) parameters for the hash_key and range_key values of the item. You can use these explicit parameters when calling the method, such as:
>>> my_item = my_table.new_item(hash_key='a', range_key=1,
attrs={‘key1’: ‘val1’, ‘key2’: ‘val2’})>>> my_item {u'bar': 1, u'foo': 'a', 'key1': 'val1', 'key2': 'val2'}
Or, if you prefer, you can simply put the hash_key and range_key in the attrs dictionary itself, like this:
>>> attrs = {'foo': 'a', 'bar': 1, 'key1': 'val1', 'key2': 'val2'}
>>> my_item = my_table.new_item(attrs=attrs)
>>> my_item
{u'bar': 1, u'foo': 'a', 'key1': 'val1', 'key2': 'val2'}
The effect is the same.
Parameters: |
|
---|
Perform a query on the table.
Parameters: |
|
---|
Refresh all of the fields of the Table object by calling the underlying DescribeTable request.
Parameters: |
|
---|
Scan through this table, this is a very long and expensive operation, and should be avoided if at all possible.
Parameters: |
|
---|---|
Returns: | A TableGenerator (generator) object which will iterate over all results |
Return type: |
Update the state of the Table object based on the response data received from Amazon DynamoDB.
Update the ProvisionedThroughput for the Amazon DynamoDB Table.
Parameters: |
---|
A low-level generator used to page through results from batch_get_item operations.
Variables: | consumed_units – An integer that holds the number of ConsumedCapacityUnits accumulated thus far for this generator. |
---|
Represents a DynamoDB schema.
Variables: |
|
---|
An item in Amazon DynamoDB.
Variables: |
|
---|
Queue the addition of an attribute to an item in DynamoDB. This will eventually result in an UpdateItem request being issued with an update action of ADD when the save method is called.
Parameters: |
|
---|
Delete the item from DynamoDB.
Parameters: |
|
---|
Queue the deletion of an attribute from an item in DynamoDB. This call will result in a UpdateItem request being issued with update action of DELETE when the save method is called.
Parameters: |
---|
Store a new item or completely replace an existing item in Amazon DynamoDB.
Parameters: |
|
---|
Queue the putting of an attribute to an item in DynamoDB. This call will result in an UpdateItem request being issued with the update action of PUT when the save method is called.
Parameters: |
|
---|
Commits pending updates to Amazon DynamoDB.
Parameters: |
|
---|
Used to construct a BatchGet request.
Variables: |
|
---|
Convert the Batch object into the format required for Layer1.
A subclass of a list object that contains a collection of boto.dynamodb.batch.Batch objects.
Add a Batch to this BatchList.
Parameters: |
|
---|
Resubmit the batch to get the next result set. The request object is rebuild from scratch meaning that all batch added between submit and resubmit will be lost.
Note: This method is experimental and subject to changes in future releases
Convert a BatchList object into format required for Layer1.
Used to construct a BatchWrite request. Each BatchWrite object represents a collection of PutItem and DeleteItem requests for a single Table.
Variables: |
|
---|
Convert the Batch object into the format required for Layer1.
A subclass of a list object that contains a collection of boto.dynamodb.batch.BatchWrite objects.
Add a BatchWrite to this BatchWriteList.
Parameters: |
|
---|
Convert a BatchWriteList object into format required for Layer1.