• 沒有找到結果。

Retrieve Item Attributes

在文檔中 Amazon DynamoDB (頁 125-139)

The following example retrieves three attributes from the Thread table. In the response, the

ConsumedCapacityUnits value is 1, because ConsistentRead is set to true. If ConsistentRead had been set to false (or not specified) for the same request, an eventually consistent read would have been used and ConsumedCapacityUnits would have been 0.5.

Sample Request

POST / HTTP/1.1

Host: dynamodb.<region>.<domain>;

Accept-Encoding: identity

Content-Length: <PayloadSizeBytes>

User-Agent: <UserAgentString>

Content-Type: application/x-amz-json-1.0

Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature>

X-Amz-Date: <Date>

X-Amz-Target: DynamoDB_20120810.GetItem {

"TableName": "Thread", "Key": {

"ForumName": {

"S": "Amazon DynamoDB"

},

"Subject": {

"S": "How do I update multiple items?"

} },

"ProjectionExpression":"LastPostDateTime, Message, Tags", "ConsistentRead": true,

"ReturnConsumedCapacity": "TOTAL"

}

GetItem

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

x-amz-crc32: <Checksum>

Content-Type: application/x-amz-json-1.0 Content-Length: <PayloadSizeBytes>

Date: <Date>

{

"ConsumedCapacity": { "CapacityUnits": 1, "TableName": "Thread"

}, "Item": { "Tags": {

"SS": ["Update","Multiple Items","HelpMe"]

},

"LastPostDateTime": { "S": "201303190436"

},

"Message": {

"S": "I want to update multiple items in a single call. What's the best way to do that?"

} } }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

ListBackups

ListBackups

Service: Amazon DynamoDB

List backups associated with an AWS account. To list backups for a given table, specify TableName.

ListBackups returns a paginated list of results with at most 1 MB worth of items in a page. You can also specify a maximum number of entries to be returned in a page.

In the request, start time is inclusive, but end time is exclusive. Note that these boundaries are for the time at which the original backup was requested.

You can call ListBackups a maximum of five times per second.

Request Syntax

{

"BackupType": "string",

"ExclusiveStartBackupArn": "string", "Limit": number,

"TableName": "string",

"TimeRangeLowerBound": number, "TimeRangeUpperBound": number }

Request Parameters

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

BackupType (p. 121)

The backups from the table specified by BackupType are listed.

Where BackupType can be:

• USER - On-demand backup created by you.

• SYSTEM - On-demand backup automatically created by DynamoDB.

• ALL - All types of on-demand backups (USER and SYSTEM).

Type: String

Valid Values: USER | SYSTEM | AWS_BACKUP | ALL Required: No

ExclusiveStartBackupArn (p. 121)

LastEvaluatedBackupArn is the Amazon Resource Name (ARN) of the backup last evaluated when the current page of results was returned, inclusive of the current page of results. This value may be specified as the ExclusiveStartBackupArn of a new ListBackups operation in order to fetch the next page of results.

Type: String

Length Constraints: Minimum length of 37. Maximum length of 1024.

Required: No

ListBackups

Limit (p. 121)

Maximum number of backups to return at once.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No TableName (p. 121)

The backups from the table specified by TableName are listed.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 255.

Pattern: [a-zA-Z0-9_.-]+

Required: No

TimeRangeLowerBound (p. 121)

Only backups created after this time are listed. TimeRangeLowerBound is inclusive.

Type: Timestamp Required: No

TimeRangeUpperBound (p. 121)

Only backups created before this time are listed. TimeRangeUpperBound is exclusive.

Type: Timestamp Required: No

Response Syntax

{

"BackupSummaries": [ {

"BackupArn": "string",

"BackupCreationDateTime": number, "BackupExpiryDateTime": number, "BackupName": "string",

"BackupSizeBytes": number, "BackupStatus": "string", "BackupType": "string", "TableArn": "string", "TableId": "string", "TableName": "string"

} ],

"LastEvaluatedBackupArn": "string"

}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

ListBackups

The following data is returned in JSON format by the service.

BackupSummaries (p. 122)

List of BackupSummary objects.

Type: Array of BackupSummary (p. 356) objects LastEvaluatedBackupArn (p. 122)

The ARN of the backup last evaluated when the current page of results was returned, inclusive of the current page of results. This value may be specified as the ExclusiveStartBackupArn of a new ListBackups operation in order to fetch the next page of results.

If LastEvaluatedBackupArn is empty, then the last page of results has been processed and there are no more results to be retrieved.

If LastEvaluatedBackupArn is not empty, this may or may not indicate that there is more data to be returned. All results are guaranteed to have been returned if and only if no value for LastEvaluatedBackupArn is returned.

Type: String

Length Constraints: Minimum length of 37. Maximum length of 1024.

Errors

For information about the errors that are common to all actions, see Common Errors (p. 519).

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

ListContributorInsights

ListContributorInsights

Service: Amazon DynamoDB

Returns a list of ContributorInsightsSummary for a table and all its global secondary indexes.

Request Syntax

{

"MaxResults": number, "NextToken": "string", "TableName": "string"

}

Request Parameters

The request accepts the following data in JSON format.

NoteIn the following list, the required parameters are described first.

MaxResults (p. 124)

Maximum number of results to return per page.

Type: Integer

Valid Range: Maximum value of 100.

Required: No NextToken (p. 124)

A token to for the desired page, if there is one.

Type: String Required: No TableName (p. 124)

The name of the table.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 255.

Pattern: [a-zA-Z0-9_.-]+

Required: No

Response Syntax

{ "ContributorInsightsSummaries": [ {

"ContributorInsightsStatus": "string", "IndexName": "string",

"TableName": "string"

}

ListContributorInsights

],

"NextToken": "string"

}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ContributorInsightsSummaries (p. 124) A list of ContributorInsightsSummary.

Type: Array of ContributorInsightsSummary (p. 372) objects NextToken (p. 124)

A token to go to the next page if there is one.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors (p. 519).

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500 ResourceNotFoundException

The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be ACTIVE.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

ListExports

ListExports

Service: Amazon DynamoDB

Lists completed exports within the past 90 days.

Request Syntax

{ "MaxResults": number, "NextToken": "string", "TableArn": "string"

}

Request Parameters

The request accepts the following data in JSON format.

NoteIn the following list, the required parameters are described first.

MaxResults (p. 126)

Maximum number of results to return per page.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 25.

Required: No NextToken (p. 126)

An optional string that, if supplied, must be copied from the output of a previous call to ListExports. When provided in this manner, the API fetches the next page of results.

Type: String Required: No TableArn (p. 126)

The Amazon Resource Name (ARN) associated with the exported table.

Type: String Required: No

Response Syntax

{

"ExportSummaries": [ {

"ExportArn": "string", "ExportStatus": "string"

} ],

"NextToken": "string"

}

ListExports

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ExportSummaries (p. 126)

A list of ExportSummary objects.

Type: Array of ExportSummary (p. 392) objects NextToken (p. 126)

If this value is returned, there are additional results to be displayed. To retrieve them, call ListExports again, with NextToken set to this value.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors (p. 519).

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500 LimitExceededException

There is no limit to the number of daily on-demand backups that can be taken.

Up to 50 simultaneous table operations are allowed per account. These operations include

CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, and RestoreTableToPointInTime.

The only exception is when you are creating a table with one or more secondary indexes. You can have up to 25 such requests running at a time; however, if the table or index specifications are complex, DynamoDB might temporarily reduce the number of concurrent operations.

There is a soft account quota of 256 tables.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

ListExports

• AWS SDK for Ruby V3

ListGlobalTables

ListGlobalTables

Service: Amazon DynamoDB

Lists all global tables that have a replica in the specified Region.

NoteThis operation only applies to Version 2017.11.29 of global tables.

Request Syntax

{ "ExclusiveStartGlobalTableName": "string", "Limit": number,

"RegionName": "string"

}

Request Parameters

The request accepts the following data in JSON format.

NoteIn the following list, the required parameters are described first.

ExclusiveStartGlobalTableName (p. 129)

The first global table name that this operation will evaluate.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 255.

Pattern: [a-zA-Z0-9_.-]+

Required: No Limit (p. 129)

The maximum number of table names to return, if the parameter is not specified DynamoDB defaults to 100.

If the number of global tables DynamoDB finds reaches this limit, it stops the operation and returns the table names collected up to that point, with a table name in the LastEvaluatedGlobalTableName to apply in a subsequent operation to the ExclusiveStartGlobalTableName parameter.

Type: Integer

Valid Range: Minimum value of 1.

Required: No RegionName (p. 129)

Lists the global tables in a specific Region.

Type: String Required: No

ListGlobalTables

Response Syntax

{ "GlobalTables": [ {

"GlobalTableName": "string", "ReplicationGroup": [ {

"RegionName": "string"

} ] } ],

"LastEvaluatedGlobalTableName": "string"

}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

GlobalTables (p. 130)

List of global table names.

Type: Array of GlobalTable (p. 405) objects LastEvaluatedGlobalTableName (p. 130)

Last evaluated global table name.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 255.

Pattern: [a-zA-Z0-9_.-]+

Errors

For information about the errors that are common to all actions, see Common Errors (p. 519).

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

ListGlobalTables

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

• AWS SDK for Ruby V3

ListTables

ListTables

Service: Amazon DynamoDB

Returns an array of table names associated with the current account and endpoint. The output from ListTables is paginated, with each page returning a maximum of 100 table names.

Request Syntax

{ "ExclusiveStartTableName": "string", "Limit": number

}

Request Parameters

The request accepts the following data in JSON format.

NoteIn the following list, the required parameters are described first.

ExclusiveStartTableName (p. 132)

The first table name that this operation will evaluate. Use the value that was returned for LastEvaluatedTableName in a previous operation, so that you can obtain the next page of results.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 255.

Pattern: [a-zA-Z0-9_.-]+

Required: No Limit (p. 132)

A maximum number of table names to return. If this parameter is not specified, the limit is 100.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No

Response Syntax

{

"LastEvaluatedTableName": "string", "TableNames": [ "string" ]

}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

在文檔中 Amazon DynamoDB (頁 125-139)

相關文件