UpdateTable¶
When given a UpdateTable, the connection will return a UpdateTableResponse:
>>> r = connection(
... UpdateTable(table)
... .provisioned_throughput(2, 2)
... )
>>> r
<LowVoltage.actions.update_table.UpdateTableResponse ...>
>>> r.table_description.table_status
u'UPDATING'
Note that you can use the wait_for_table_activation() compound to poll the table status until it’s updated. See Actions vs. compounds in the user guide.
-
class
UpdateTableResponse¶ The UpdateTable response.
-
table_description¶ The description of the table you just updated.
Type: NoneorTableDescription
-
-
class
UpdateTable(table_name=None)¶ The UpdateTable request.
Passing
table_nameto the constructor is like callingtable_name()on the new instance.-
table_name(table_name)¶ Set TableName. Mandatory, can also be set in the constructor.
See
update_global_secondary_index()for an example.
-
hash_key(name, typ=None)¶ Set the hash key in KeySchema for the active index. If you provide a second argument,
attribute_definition()will be called as well.Raise: BuilderErrorif called when no index is active or if the active index is not being created.See
create_global_secondary_index()for an example.
-
range_key(name, typ=None)¶ Set the range key in KeySchema for the active index. If you provide a second argument,
attribute_definition()will be called as well.Raise: BuilderErrorif called when no index is active or if the active index is not being created.See
create_global_secondary_index()for an example.
-
attribute_definition(name, typ)¶ Set the type of an attribute in AttributeDefinitions. Key attribute must be typed. See
attribute_typesfor constants to be passed to this method.
-
provisioned_throughput(read_capacity_units, write_capacity_units)¶ Set the new provisioned throughput for the table or the active index.
See
create_global_secondary_index()for an example.
-
create_global_secondary_index(name)¶ Create a new GSI. This method sets the active index: methods like
provisioned_throughput()will apply to the index.>>> connection( ... UpdateTable(table4) ... .create_global_secondary_index("gsi") ... .hash_key("hh", STRING) ... .range_key("rr", NUMBER) ... .project_all() ... .provisioned_throughput(2, 2) ... ) <LowVoltage.actions.update_table.UpdateTableResponse ...>
-
update_global_secondary_index(name)¶ Update an existing GSI. This method sets the active index: methods like
provisioned_throughput()will apply to the index.>>> connection( ... UpdateTable() ... .table_name(table2) ... .update_global_secondary_index("gsi") ... .provisioned_throughput(2, 2) ... ) <LowVoltage.actions.update_table.UpdateTableResponse ...>
-
delete_global_secondary_index(name)¶ Mark a GSI for deletion.
This method does not set the active index, because there is nothing to modify.
>>> connection( ... UpdateTable(table3) ... .delete_global_secondary_index("gsi") ... ) <LowVoltage.actions.update_table.UpdateTableResponse ...>
-
table()¶ Reset the active index: methods like
provisioned_throughput()will apply to the table.
-
project_all()¶ Set ProjectionType to ALL for the active index.
Raise: BuilderErrorif called when no index is active or if the active index is not being created.See
create_global_secondary_index()for an example.
-
project_keys_only()¶ Set ProjectionType to KEYS_ONLY for the active index.
Raise: BuilderErrorif called when no index is active or if the active index is not being created.
-
project(*attrs)¶ Note that this function is variadic. See Variadic functions.
Set ProjectionType to INCLUDE for the active index and add names to NonKeyAttributes.
Raise: BuilderErrorif called when no index is active or if the active index is not being created.
-