update_table
¶
update_table(
keyspace_name: KeyspaceName,
table_name: TableName,
*,
config_overrides: Optional[KeyspacesClientConfig] = None,
add_columns: Optional[ColumnDefinitionList] = None,
capacity_specification: Optional[CapacitySpecification] = None,
encryption_specification: Optional[EncryptionSpecification] = None,
point_in_time_recovery: Optional[PointInTimeRecovery] = None,
ttl: Optional[TimeToLive] = None,
default_time_to_live: Optional[DefaultTimeToLive] = None,
client_side_timestamps: Optional[ClientSideTimestamps] = None,
auto_scaling_specification: Optional[AutoScalingSpecification] = None,
replica_specifications: Optional[ReplicaSpecificationList] = None,
cdc_specification: Optional[CdcSpecification] = None,
warm_throughput_specification: Optional[WarmThroughputSpecification] = None,
) -> UpdateTableResponse
Adds new columns to the table or updates one of the table's settings, for example capacity mode, auto scaling, encryption, point-in-time recovery, or ttl settings. Note that you can only update one specific table setting per update operation.
Parameters:
-
keyspace_name(KeyspaceName) –The name of the keyspace the specified table is stored in.
-
table_name(TableName) –The name of the table.
-
add_columns(Optional[ColumnDefinitionList], default:None) –For each column to be added to the specified table:
-
name- The name of the column. -
type- An Amazon Keyspaces data type. For more information, see Data types in the Amazon Keyspaces Developer Guide.
-
-
capacity_specification(Optional[CapacitySpecification], default:None) –Modifies the read/write throughput capacity mode for the table. The options are:
-
throughputMode:PAY_PER_REQUESTand -
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(Optional[EncryptionSpecification], default:None) –Modifies the encryption settings of the 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
AWS_OWNED_KMS_KEY.For more information, see Encryption at rest in the Amazon Keyspaces Developer Guide.
-
-
point_in_time_recovery(Optional[PointInTimeRecovery], default:None) –Modifies the
pointInTimeRecoverysettings of the 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.
-
-
ttl(Optional[TimeToLive], default:None) –Modifies Time to Live custom settings for the table. The options are:
-
status:enabled -
status:disabled
The default is
status:disabled. Afterttlis enabled, you can't disable it for the table.For more information, see Expiring data by using Amazon Keyspaces Time to Live (TTL) in the Amazon Keyspaces Developer Guide.
-
-
default_time_to_live(Optional[DefaultTimeToLive], default:None) –The default Time to Live setting in seconds for the table.
For more information, see Setting the default TTL value for a table in the Amazon Keyspaces Developer Guide.
-
client_side_timestamps(Optional[ClientSideTimestamps], default:None) –Enables client-side timestamps for the table. By default, the setting is disabled. You can enable client-side timestamps with the following option:
-
status: "enabled"
Once client-side timestamps are enabled for a table, this setting cannot be disabled.
-
-
auto_scaling_specification(Optional[AutoScalingSpecification], default:None) –The optional auto scaling settings to update for a 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.
If auto scaling is already enabled for the table, you can use
UpdateTableto update the minimum and maximum values or the auto scaling policy settings independently.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 Region specific settings of a multi-Regional table.
-
cdc_specification(Optional[CdcSpecification], default:None) –The CDC stream settings of the table.
-
warm_throughput_specification(Optional[WarmThroughputSpecification], default:None) –Modifies the warm throughput settings for the table. You can update the read and write capacity units to adjust the pre-provisioned throughput.
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/keyspaces.py
1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 | |