GetRecords
Retrieves data records from a specified shard in an Amazon Keyspaces data stream. This operation returns a collection of data records from the shard, including the primary key columns and information about modifications made to the captured table data. Each record represents a single data modification in the Amazon Keyspaces table and includes metadata about when the change occurred.
Request Syntax
{
"maxResults": number
,
"shardIterator": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- maxResults
-
The maximum number of records to return in a single
GetRecords
request. Default value is 1000. You can specify a limit between 1 and 10000, but the actual number returned might be less than the specified maximum if the size of the data for the returned records exceeds the internal size limit.Type: Integer
Valid Range: Minimum value of 1. Maximum value of 1000.
Required: No
- shardIterator
-
The unique identifier of the shard iterator. A shard iterator specifies the position in the shard from which you want to start reading data records sequentially. You obtain this value by calling the
GetShardIterator
operation. Each shard iterator is valid for 5 minutes after creation.Type: String
Length Constraints: Minimum length of 1. Maximum length of 4096.
Required: Yes
Response Syntax
{
"changeRecords": [
{
"clusteringKeys": {
"string" : { ... }
},
"createdAt": number,
"eventVersion": "string",
"newImage": {
"rowMetadata": {
"expirationTime": "string",
"writeTime": "string"
},
"staticCells": {
"string" : {
"metadata": {
"expirationTime": "string",
"writeTime": "string"
},
"value": { ... }
}
},
"valueCells": {
"string" : {
"metadata": {
"expirationTime": "string",
"writeTime": "string"
},
"value": { ... }
}
}
},
"oldImage": {
"rowMetadata": {
"expirationTime": "string",
"writeTime": "string"
},
"staticCells": {
"string" : {
"metadata": {
"expirationTime": "string",
"writeTime": "string"
},
"value": { ... }
}
},
"valueCells": {
"string" : {
"metadata": {
"expirationTime": "string",
"writeTime": "string"
},
"value": { ... }
}
}
},
"origin": "string",
"partitionKeys": {
"string" : { ... }
},
"sequenceNumber": "string"
}
],
"nextShardIterator": "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.
- changeRecords
-
An array of change data records retrieved from the specified shard. Each record represents a single data modification (insert, update, or delete) to a row in the Amazon Keyspaces table. Records include the primary key columns and information about what data was modified.
Type: Array of Record objects
- nextShardIterator
-
The next position in the shard from which to start sequentially reading data records. If null, the shard has been closed and the requested iterator doesn't return any more data.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 4096.
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You don't have sufficient access permissions to perform this operation.
This exception occurs when your IAM user or role lacks the required permissions to access the Amazon Keyspaces resource or perform the requested action. Check your IAM policies and ensure they grant the necessary permissions.
HTTP Status Code: 400
- InternalServerException
-
The Amazon Keyspaces service encountered an unexpected error while processing the request.
This internal server error is not related to your request parameters. Retry your request after a brief delay. If the issue persists, contact AWS Support with details of your request to help identify and resolve the problem.
HTTP Status Code: 500
- ResourceNotFoundException
-
The requested resource doesn't exist or could not be found.
This exception occurs when you attempt to access a keyspace, table, stream, or other Amazon Keyspaces resource that doesn't exist or that has been deleted. Verify that the resource identifier is correct and that the resource exists in your account.
HTTP Status Code: 400
- ThrottlingException
-
The request rate is too high and exceeds the service's throughput limits.
This exception occurs when you send too many requests in a short period of time. Implement exponential backoff in your retry strategy to handle this exception. Reducing your request frequency or distributing requests more evenly can help avoid throughput exceptions.
HTTP Status Code: 400
- ValidationException
-
The request validation failed because one or more input parameters failed validation.
This exception occurs when there are syntax errors in the request, field constraints are violated, or required parameters are missing. To help you fix the issue, the exception message provides details about which parameter failed and why.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: