restore_table
async
¶
restore_table(
source_keyspace_name: KeyspaceName,
source_table_name: TableName,
target_keyspace_name: KeyspaceName,
target_table_name: TableName,
*,
config_overrides: Optional[AsyncKeyspacesClientConfig] = None,
restore_timestamp: Optional[Timestamp] = None,
capacity_specification_override: Optional[CapacitySpecification] = None,
encryption_specification_override: Optional[EncryptionSpecification] = None,
point_in_time_recovery_override: Optional[PointInTimeRecovery] = None,
tags_override: Optional[TagList] = None,
auto_scaling_specification: Optional[AutoScalingSpecification] = None,
replica_specifications: Optional[ReplicaSpecificationList] = None,
) -> RestoreTableResponse
Restores the table to the specified point in time within the earliest_restorable_timestamp and the current time. For more information about restore points, see Time window for PITR continuous backups in the Amazon Keyspaces Developer Guide.
Any number of users can execute up to 4 concurrent restores (any type of restore) in a given account.
When you restore using point in time recovery, Amazon Keyspaces restores your source table's schema and data to the state based on the selected timestamp (day:hour:minute:second) to a new table. The Time to Live (TTL) settings are also restored to the state based on the selected timestamp.
In addition to the table's schema, data, and TTL settings, RestoreTable restores the capacity mode, auto scaling settings, encryption settings, and point-in-time recovery settings from the source table. Unlike the table's schema data and TTL settings, which are restored based on the selected timestamp, these settings are always restored based on the table's settings as of the current time or when the table was deleted.
You can also overwrite these settings during restore:
-
Read/write capacity mode
-
Provisioned throughput capacity units
-
Auto scaling settings
-
Point-in-time (PITR) settings
-
Tags
For more information, see PITR restore settings in the Amazon Keyspaces Developer Guide.
Note that the following settings are not restored, and you must configure them manually for the new table:
-
Identity and Access Management (IAM) policies
-
Amazon CloudWatch metrics and alarms
Parameters:
-
source_keyspace_name(KeyspaceName) –The keyspace name of the source table.
-
source_table_name(TableName) –The name of the source table.
-
target_keyspace_name(KeyspaceName) –The name of the target keyspace.
-
target_table_name(TableName) –The name of the target table.
-
restore_timestamp(Optional[Timestamp], default:None) –The restore timestamp in ISO 8601 format.
-
capacity_specification_override(Optional[CapacitySpecification], default:None) –Specifies the read/write throughput capacity mode for the target table. The options are:
-
throughputMode:PAY_PER_REQUEST -
throughputMode:PROVISIONED- Provisioned capacity mode requiresreadCapacityUnitsandwriteCapacityUnitsas input.
The default is
throughput_mode:PAY_PER_REQUEST.For more information, see Read/write capacity modes in the Amazon Keyspaces Developer Guide.
-
-
encryption_specification_override(Optional[EncryptionSpecification], default:None) –Specifies the encryption settings for the target table. You can choose one of the following KMS key (KMS key):
-
type:AWS_OWNED_KMS_KEY- This key is owned by Amazon Keyspaces. -
type:CUSTOMER_MANAGED_KMS_KEY- This key is stored in your account and is created, owned, and managed by you. This option requires thekms_key_identifierof the KMS key in Amazon Resource Name (ARN) format as input.
The default is
type:AWS_OWNED_KMS_KEY.For more information, see Encryption at rest in the Amazon Keyspaces Developer Guide.
-
-
point_in_time_recovery_override(Optional[PointInTimeRecovery], default:None) –Specifies the
pointInTimeRecoverysettings for the target table. The options are:-
status=ENABLED -
status=DISABLED
If it's not specified, the default is
status=DISABLED.For more information, see Point-in-time recovery in the Amazon Keyspaces Developer Guide.
-
-
tags_override(Optional[TagList], default:None) –A list of key-value pair tags to be attached to the restored table.
For more information, see Adding tags and labels to Amazon Keyspaces resources in the Amazon Keyspaces Developer Guide.
-
auto_scaling_specification(Optional[AutoScalingSpecification], default:None) –The optional auto scaling settings for the restored table in provisioned capacity mode. Specifies if the service can manage throughput capacity of a provisioned table automatically on your behalf. Amazon Keyspaces auto scaling helps you provision throughput capacity for variable workloads efficiently by increasing and decreasing your table's read and write capacity automatically in response to application traffic.
For more information, see Managing throughput capacity automatically with Amazon Keyspaces auto scaling in the Amazon Keyspaces Developer Guide.
-
replica_specifications(Optional[ReplicaSpecificationList], default:None) –The optional Region specific settings of a multi-Regional table.
Raises:
-
AccessDeniedException–You don't have sufficient access permissions to perform this action.
-
ConflictException–Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists.
-
InternalServerException–Amazon Keyspaces was unable to fully process this request because of an internal server error.
-
ResourceNotFoundException–The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be
ACTIVE. -
ServiceQuotaExceededException–The operation exceeded the service quota for this resource. For more information on service quotas, see Quotas in the Amazon Keyspaces Developer Guide.
-
ValidationException–The operation failed due to an invalid or malformed request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_keyspaces/_services/async_keyspaces.py
1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 | |