Crate rusoto_dynamodb [] [src]

Amazon DynamoDB

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database, so that you don't have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling.

With DynamoDB, you can create database tables that can store and retrieve any amount of data, and serve any level of request traffic. You can scale up or scale down your tables' throughput capacity without downtime or performance degradation, and use the AWS Management Console to monitor resource utilization and performance metrics.

DynamoDB automatically spreads the data and traffic for your tables over a sufficient number of servers to handle your throughput and storage requirements, while maintaining consistent and fast performance. All of your data is stored on solid state disks (SSDs) and automatically replicated across multiple Availability Zones in an AWS region, providing built-in high availability and data durability.

If you're using the service, you're probably looking for DynamoDbClient and DynamoDb.

Examples

List Tables

The following code shows a simple example of using Rusoto's DynamoDB API to list the names of all tables in a database.

extern crate rusoto_core;
extern crate rusoto_dynamodb;
 
use rusoto_core::Region;
use rusoto_dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput};
 
fn main() {
    let client = DynamoDbClient::simple(Region::UsEast1);
    let list_tables_input: ListTablesInput = Default::default();
 
    match client.list_tables(&list_tables_input).sync() {
        Ok(output) => {
            match output.table_names {
                Some(table_name_list) => {
                    println!("Tables in database:");
 
                    for table_name in table_name_list {
                        println!("{}", table_name);
                    }
                },
                None => println!("No tables in database!"),
            }
        },
        Err(error) => {
            println!("Error: {:?}", error);
        },
    }
}

Structs

AttributeDefinition

Represents an attribute for describing the key schema for the table and indexes.

AttributeValue

Represents the data for an attribute.

Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.

For more information, see Data Types in the Amazon DynamoDB Developer Guide.

AttributeValueUpdate

For the UpdateItem operation, represents the attributes to be modified, the action to perform on each, and the new value for each.

You cannot use UpdateItem to update any primary key attributes. Instead, you will need to delete the item, and then use PutItem to create a new item with new attributes.

Attribute values cannot be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests with empty values will be rejected with a ValidationException exception.

BackupDescription

Contains the description of the backup created for the table.

BackupDetails

Contains the details of the backup created for the table.

BackupSummary

Contains details for the backup.

BatchGetItemInput

Represents the input of a BatchGetItem operation.

BatchGetItemOutput

Represents the output of a BatchGetItem operation.

BatchWriteItemInput

Represents the input of a BatchWriteItem operation.

BatchWriteItemOutput

Represents the output of a BatchWriteItem operation.

Capacity

Represents the amount of provisioned throughput capacity consumed on a table or an index.

Condition

Represents the selection criteria for a Query or Scan operation:

  • For a Query operation, Condition is used for specifying the KeyConditions to use when querying a table or an index. For KeyConditions, only the following comparison operators are supported:

    EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN

    Condition is also used in a QueryFilter, which evaluates the query results and returns only the desired values.

  • For a Scan operation, Condition is used in a ScanFilter, which evaluates the scan results and returns only the desired values.

ConsumedCapacity

The capacity units consumed by an operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. ConsumedCapacity is only returned if the request asked for it. For more information, see Provisioned Throughput in the Amazon DynamoDB Developer Guide.

ContinuousBackupsDescription

Represents the backup and restore settings on the table when the backup was created.

CreateBackupInput
CreateBackupOutput
CreateGlobalSecondaryIndexAction

Represents a new global secondary index to be added to an existing table.

CreateGlobalTableInput
CreateGlobalTableOutput
CreateReplicaAction

Represents a replica to be added.

CreateTableInput

Represents the input of a CreateTable operation.

CreateTableOutput

Represents the output of a CreateTable operation.

DeleteBackupInput
DeleteBackupOutput
DeleteGlobalSecondaryIndexAction

Represents a global secondary index to be deleted from an existing table.

DeleteItemInput

Represents the input of a DeleteItem operation.

DeleteItemOutput

Represents the output of a DeleteItem operation.

DeleteReplicaAction

Represents a replica to be removed.

DeleteRequest

Represents a request to perform a DeleteItem operation on an item.

DeleteTableInput

Represents the input of a DeleteTable operation.

DeleteTableOutput

Represents the output of a DeleteTable operation.

DescribeBackupInput
DescribeBackupOutput
DescribeContinuousBackupsInput
DescribeContinuousBackupsOutput
DescribeGlobalTableInput
DescribeGlobalTableOutput
DescribeLimitsInput

Represents the input of a DescribeLimits operation. Has no content.

DescribeLimitsOutput

Represents the output of a DescribeLimits operation.

DescribeTableInput

Represents the input of a DescribeTable operation.

DescribeTableOutput

Represents the output of a DescribeTable operation.

DescribeTimeToLiveInput
DescribeTimeToLiveOutput
DynamoDbClient

A client for the DynamoDB API.

ExpectedAttributeValue

Represents a condition to be compared with an attribute value. This condition can be used with DeleteItem, PutItem or UpdateItem operations; if the comparison evaluates to true, the operation succeeds; if not, the operation fails. You can use ExpectedAttributeValue in one of two different ways:

  • Use AttributeValueList to specify one or more values to compare against an attribute. Use ComparisonOperator to specify how you want to perform the comparison. If the comparison evaluates to true, then the conditional operation succeeds.

  • Use Value to specify a value that DynamoDB will compare against an attribute. If the values match, then ExpectedAttributeValue evaluates to true and the conditional operation succeeds. Optionally, you can also set Exists to false, indicating that you do not expect to find the attribute value in the table. In this case, the conditional operation succeeds only if the comparison evaluates to false.

Value and Exists are incompatible with AttributeValueList and ComparisonOperator. Note that if you use both sets of parameters at once, DynamoDB will return a ValidationException exception.

GetItemInput

Represents the input of a GetItem operation.

GetItemOutput

Represents the output of a GetItem operation.

GlobalSecondaryIndex

Represents the properties of a global secondary index.

GlobalSecondaryIndexDescription

Represents the properties of a global secondary index.

GlobalSecondaryIndexInfo

Represents the properties of a global secondary index for the table when the backup was created.

GlobalSecondaryIndexUpdate

Represents one of the following:

  • A new global secondary index to be added to an existing table.

  • New provisioned throughput parameters for an existing global secondary index.

  • An existing global secondary index to be removed from an existing table.

GlobalTable

Represents the properties of a global table.

GlobalTableDescription

Contains details about the global table.

ItemCollectionMetrics

Information about item collections, if any, that were affected by the operation. ItemCollectionMetrics is only returned if the request asked for it. If the table does not have any local secondary indexes, this information is not returned in the response.

KeySchemaElement

Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.

A KeySchemaElement represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one KeySchemaElement (for the partition key). A composite primary key would require one KeySchemaElement for the partition key, and another KeySchemaElement for the sort key.

A KeySchemaElement must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.

KeysAndAttributes

Represents a set of primary keys and, for each key, the attributes to retrieve from the table.

For each primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide the partition key. For a composite primary key, you must provide both the partition key and the sort key.

ListBackupsInput
ListBackupsOutput
ListGlobalTablesInput
ListGlobalTablesOutput
ListTablesInput

Represents the input of a ListTables operation.

ListTablesOutput

Represents the output of a ListTables operation.

ListTagsOfResourceInput
ListTagsOfResourceOutput
LocalSecondaryIndex

Represents the properties of a local secondary index.

LocalSecondaryIndexDescription

Represents the properties of a local secondary index.

LocalSecondaryIndexInfo

Represents the properties of a local secondary index for the table when the backup was created.

Projection

Represents attributes that are copied (projected) from the table into an index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.

ProvisionedThroughput

Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the UpdateTable operation.

For current minimum and maximum provisioned throughput values, see Limits in the Amazon DynamoDB Developer Guide.

ProvisionedThroughputDescription

Represents the provisioned throughput settings for the table, consisting of read and write capacity units, along with data about increases and decreases.

PutItemInput

Represents the input of a PutItem operation.

PutItemOutput

Represents the output of a PutItem operation.

PutRequest

Represents a request to perform a PutItem operation on an item.

QueryInput

Represents the input of a Query operation.

QueryOutput

Represents the output of a Query operation.

Replica

Represents the properties of a replica.

ReplicaDescription

Contains the details of the replica.

ReplicaUpdate

Represents one of the following:

  • A new replica to be added to an existing global table.

  • New parameters for an existing replica.

  • An existing replica to be removed from an existing global table.

RestoreSummary

Contains details for the restore.

RestoreTableFromBackupInput
RestoreTableFromBackupOutput
ScanInput

Represents the input of a Scan operation.

ScanOutput

Represents the output of a Scan operation.

SourceTableDetails

Contains the details of the table when the backup was created.

SourceTableFeatureDetails

Contains the details of the features enabled on the table when the backup was created. For example, LSIs, GSIs, streams, TTL.

StreamSpecification

Represents the DynamoDB Streams configuration for a table in DynamoDB.

TableDescription

Represents the properties of a table.

Tag

Describes a tag. A tag is a key-value pair. You can add up to 50 tags to a single DynamoDB table.

AWS-assigned tag names and values are automatically assigned the aws: prefix, which the user cannot assign. AWS-assigned tag names do not count towards the tag limit of 50. User-assigned tag names have the prefix user: in the Cost Allocation Report. You cannot backdate the application of a tag.

For an overview on tagging DynamoDB resources, see Tagging for DynamoDB in the Amazon DynamoDB Developer Guide.

TagResourceInput
TimeToLiveDescription

The description of the Time to Live (TTL) status on the specified table.

TimeToLiveSpecification

Represents the settings used to enable or disable Time to Live for the specified table.

UntagResourceInput
UpdateGlobalSecondaryIndexAction

Represents the new provisioned throughput settings to be applied to a global secondary index.

UpdateGlobalTableInput
UpdateGlobalTableOutput
UpdateItemInput

Represents the input of an UpdateItem operation.

UpdateItemOutput

Represents the output of an UpdateItem operation.

UpdateTableInput

Represents the input of an UpdateTable operation.

UpdateTableOutput

Represents the output of an UpdateTable operation.

UpdateTimeToLiveInput

Represents the input of an UpdateTimeToLive operation.

UpdateTimeToLiveOutput
WriteRequest

Represents an operation to perform - either DeleteItem or PutItem. You can only request one of these operations, not both, in a single WriteRequest. If you do need to perform both of these operations, you will need to provide two separate WriteRequest objects.

Enums

BatchGetItemError

Errors returned by BatchGetItem

BatchWriteItemError

Errors returned by BatchWriteItem

CreateBackupError

Errors returned by CreateBackup

CreateGlobalTableError

Errors returned by CreateGlobalTable

CreateTableError

Errors returned by CreateTable

DeleteBackupError

Errors returned by DeleteBackup

DeleteItemError

Errors returned by DeleteItem

DeleteTableError

Errors returned by DeleteTable

DescribeBackupError

Errors returned by DescribeBackup

DescribeContinuousBackupsError

Errors returned by DescribeContinuousBackups

DescribeGlobalTableError

Errors returned by DescribeGlobalTable

DescribeLimitsError

Errors returned by DescribeLimits

DescribeTableError

Errors returned by DescribeTable

DescribeTimeToLiveError

Errors returned by DescribeTimeToLive

GetItemError

Errors returned by GetItem

ListBackupsError

Errors returned by ListBackups

ListGlobalTablesError

Errors returned by ListGlobalTables

ListTablesError

Errors returned by ListTables

ListTagsOfResourceError

Errors returned by ListTagsOfResource

PutItemError

Errors returned by PutItem

QueryError

Errors returned by Query

RestoreTableFromBackupError

Errors returned by RestoreTableFromBackup

ScanError

Errors returned by Scan

TagResourceError

Errors returned by TagResource

UntagResourceError

Errors returned by UntagResource

UpdateGlobalTableError

Errors returned by UpdateGlobalTable

UpdateItemError

Errors returned by UpdateItem

UpdateTableError

Errors returned by UpdateTable

UpdateTimeToLiveError

Errors returned by UpdateTimeToLive

Traits

DynamoDb

Trait representing the capabilities of the DynamoDB API. DynamoDB clients implement this trait.