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
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 | |