Skip to content

update_table async

update_table(
    database_name: ResourceName,
    table_name: ResourceName,
    *,
    config_overrides: Optional[AsyncTimestreamWriteClientConfig] = None,
    retention_properties: Optional[RetentionProperties] = None,
    magnetic_store_write_properties: Optional[MagneticStoreWriteProperties] = None,
    schema: Optional[Schema] = None,
) -> UpdateTableResponse

Modifies the retention duration of the memory store and magnetic store for your Timestream table. Note that the change in retention duration takes effect immediately. For example, if the retention period of the memory store was initially set to 2 hours and then changed to 24 hours, the memory store will be capable of holding 24 hours of data, but will be populated with 24 hours of data 22 hours after this change was made. Timestream does not retrieve data from the magnetic store to populate the memory store.

See code sample for details.

Parameters:

  • database_name (ResourceName) –

    The name of the Timestream database.

  • table_name (ResourceName) –

    The name of the Timestream table.

  • retention_properties (Optional[RetentionProperties], default: None ) –

    The retention duration of the memory store and the magnetic store.

  • magnetic_store_write_properties (Optional[MagneticStoreWriteProperties], default: None ) –

    Contains properties to set on the table when enabling magnetic store writes.

  • schema (Optional[Schema], default: None ) –

    The schema of the table.

Raises:

Source code in docs_src/capo_timestream_write/_services/async_timestream_write.py
async def update_table(
    self,
    database_name: "capo_timestream_write.types.resource_name.ResourceName",
    table_name: "capo_timestream_write.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncTimestreamWriteClientConfig] = None,
    retention_properties: Optional[
        "capo_timestream_write.types.retention_properties.RetentionProperties"
    ] = None,
    magnetic_store_write_properties: Optional[
        "capo_timestream_write.types.magnetic_store_write_properties.MagneticStoreWriteProperties"
    ] = None,
    schema: Optional["capo_timestream_write.types.schema.Schema"] = None,
) -> "capo_timestream_write.types.update_table_response.UpdateTableResponse":
    """<p>Modifies the retention duration of the memory store and magnetic store for your Timestream table. Note that the change in retention duration takes effect immediately. For example, if the retention period of the memory store was initially set to 2 hours and then changed to 24 hours, the memory store will be capable of holding 24 hours of data, but will be populated with 24 hours of data 22 hours after this change was made. Timestream does not retrieve data from the magnetic store to populate the memory store. </p> <p>See <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.update-table.html">code sample</a> for details.</p>

    Args:
        database_name: <p>The name of the Timestream database.</p>
        table_name: <p>The name of the Timestream table.</p>
        retention_properties: <p>The retention duration of the memory store and the magnetic store.</p>
        magnetic_store_write_properties: <p>Contains properties to set on the table when enabling magnetic store writes.</p>
        schema: <p> The schema of the table. </p>

    Raises:
        capo_timestream_write.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to perform this action.</p>
        capo_timestream_write.errors.internal_server_exception.InternalServerException: <p> Timestream was unable to fully process this request because of an internal server error.</p>
        capo_timestream_write.errors.invalid_endpoint_exception.InvalidEndpointException: <p>The requested endpoint was not valid.</p>
        capo_timestream_write.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent resource. The resource might not be specified correctly, or its status might not be ACTIVE.</p>
        capo_timestream_write.errors.throttling_exception.ThrottlingException: <p> Too many requests were made by a user and they exceeded the service quotas. The request was throttled.</p>
        capo_timestream_write.errors.validation_exception.ValidationException: <p> An invalid or malformed request.</p>
        capo_timestream_write.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_timestream_write.types.update_table_request.UpdateTableRequest]",
    ) -> AsyncOperationResponse[
        "capo_timestream_write.types.update_table_response.UpdateTableResponse"
    ]:
        import capo_timestream_write._operations.timestream_20181101.update_table

        (
            output,
            http_response,
        ) = await capo_timestream_write._operations.timestream_20181101.update_table.async_update_table(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTable")
    )
    input_: capo_timestream_write.types.update_table_request.UpdateTableRequest = {
        "database_name": database_name,
        "table_name": table_name,
    }
    if retention_properties is not None:
        input_["retention_properties"] = retention_properties
    if magnetic_store_write_properties is not None:
        input_["magnetic_store_write_properties"] = magnetic_store_write_properties
    if schema is not None:
        input_["schema"] = schema

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output