UpdateTimeToLive method
Enables or disables TTL for the specified table.
If successful, returns the current TimeToLiveSpecification value. The operation may take up to an hour. Additional method calls for the same table will throw a ValidationException error until the operation is completed.
The TTL checking mechanism compares the current time in Unix time
Items with an expired TTL are usually deleted within two days; the deletion time depends on the nature of the workload. Obsolete but not yet deleted items are displayed when reading, querying, and scanning data. Deleting items from a table immediately deletes them from the local and global secondary indexes the same way as a standard delete operation.
Obsolete items are deleted to provide sufficient throughput capacity for other data operations.
Request
The request contains data in JSON format.
{
"TableName": "string",
"TimeToLiveSpecification": {
"AttributeName": "string",
"Enabled": boolean
}
}
Parameters
| Parameter | Description |
|---|---|
TableName |
Name of the table to enable or disable TTL for. It may contain a path in the hierarchical directory structure in path/to/table format.Type: String Length: 3 to 255 characters. Template: [a-zA-Z0-9_.-]+ Required: Yes |
TimeToLiveSpecification |
Parameters to use to enable or disable TTL for the specified table. Type: Object of the TimeToLiveSpecification type.Required: Yes |
Response
If successful, HTTP code 200 is returned.
You will get data in JSON format.
{
"TimeToLiveSpecification": {
"AttributeName": "string",
"Enabled": boolean
}
}
Parameters
| Parameter | Description |
|---|---|
TimeToLiveSpecification |
Operation result. Type: Object of the TimeToLiveSpecification type. |
Errors
| Parameter | Description |
|---|---|
InternalServerError |
An internal error occurred on the server side. HTTP status code: 500 |
LimitExceededException |
Table operations limit exceeded. You can concurrently perform up to 50 operations on tables, including CreateTable, UpdateTable, DeleteTable, UpdateTimeToLive, RestoreTableFromBackup, and RestoreTableToPointInTime.HTTP status code: 400 |
ResourceInUseException |
The resource is currently being used by another operation. HTTP status code: 400 |
ResourceNotFoundException |
The specified table does not exist or its state is different from ACTIVE.HTTP status code: 400 |
There may be some common errors as well shared by all methods.