Amazon Timestream Write

2023/02/27 - Amazon Timestream Write - 4 new 4 updated api methods

Changes  This release adds the ability to ingest batched historical data or migrate data in bulk from S3 into Timestream using CSV files.

ListBatchLoadTasks (new) Link ¶

Provides a list of batch load tasks, along with the name, status, when the task is resumable until, and other details. See code sample for details.

See also: AWS API Documentation

Request Syntax

client.list_batch_load_tasks(
    NextToken='string',
    MaxResults=123,
    TaskStatus='CREATED'|'IN_PROGRESS'|'FAILED'|'SUCCEEDED'|'PROGRESS_STOPPED'|'PENDING_RESUME'
)
type NextToken

string

param NextToken

A token to specify where to start paginating. This is the NextToken from a previously truncated response.

type MaxResults

integer

param MaxResults

The total number of items to return in the output. If the total number of items available is more than the value specified, a NextToken is provided in the output. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

type TaskStatus

string

param TaskStatus

Status of the batch load task.

rtype

dict

returns

Response Syntax

{
    'NextToken': 'string',
    'BatchLoadTasks': [
        {
            'TaskId': 'string',
            'TaskStatus': 'CREATED'|'IN_PROGRESS'|'FAILED'|'SUCCEEDED'|'PROGRESS_STOPPED'|'PENDING_RESUME',
            'DatabaseName': 'string',
            'TableName': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'LastUpdatedTime': datetime(2015, 1, 1),
            'ResumableUntil': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      A token to specify where to start paginating. Provide the next ListBatchLoadTasksRequest.

    • BatchLoadTasks (list) --

      A list of batch load task details.

      • (dict) --

        Details about a batch load task.

        • TaskId (string) --

          The ID of the batch load task.

        • TaskStatus (string) --

          Status of the batch load task.

        • DatabaseName (string) --

          Database name for the database into which a batch load task loads data.

        • TableName (string) --

          Table name for the table into which a batch load task loads data.

        • CreationTime (datetime) --

          The time when the Timestream batch load task was created.

        • LastUpdatedTime (datetime) --

          The time when the Timestream batch load task was last updated.

        • ResumableUntil (datetime) --

DescribeBatchLoadTask (new) Link ¶

Returns information about the batch load task, including configurations, mappings, progress, and other details. Service quotas apply. See code sample for details.

See also: AWS API Documentation

Request Syntax

client.describe_batch_load_task(
    TaskId='string'
)
type TaskId

string

param TaskId

[REQUIRED]

The ID of the batch load task.

rtype

dict

returns

Response Syntax

{
    'BatchLoadTaskDescription': {
        'TaskId': 'string',
        'ErrorMessage': 'string',
        'DataSourceConfiguration': {
            'DataSourceS3Configuration': {
                'BucketName': 'string',
                'ObjectKeyPrefix': 'string'
            },
            'CsvConfiguration': {
                'ColumnSeparator': 'string',
                'EscapeChar': 'string',
                'QuoteChar': 'string',
                'NullValue': 'string',
                'TrimWhiteSpace': True|False
            },
            'DataFormat': 'CSV'
        },
        'ProgressReport': {
            'RecordsProcessed': 123,
            'RecordsIngested': 123,
            'ParseFailures': 123,
            'RecordIngestionFailures': 123,
            'FileFailures': 123,
            'BytesMetered': 123
        },
        'ReportConfiguration': {
            'ReportS3Configuration': {
                'BucketName': 'string',
                'ObjectKeyPrefix': 'string',
                'EncryptionOption': 'SSE_S3'|'SSE_KMS',
                'KmsKeyId': 'string'
            }
        },
        'DataModelConfiguration': {
            'DataModel': {
                'TimeColumn': 'string',
                'TimeUnit': 'MILLISECONDS'|'SECONDS'|'MICROSECONDS'|'NANOSECONDS',
                'DimensionMappings': [
                    {
                        'SourceColumn': 'string',
                        'DestinationColumn': 'string'
                    },
                ],
                'MultiMeasureMappings': {
                    'TargetMultiMeasureName': 'string',
                    'MultiMeasureAttributeMappings': [
                        {
                            'SourceColumn': 'string',
                            'TargetMultiMeasureAttributeName': 'string',
                            'MeasureValueType': 'DOUBLE'|'BIGINT'|'BOOLEAN'|'VARCHAR'|'TIMESTAMP'
                        },
                    ]
                },
                'MixedMeasureMappings': [
                    {
                        'MeasureName': 'string',
                        'SourceColumn': 'string',
                        'TargetMeasureName': 'string',
                        'MeasureValueType': 'DOUBLE'|'BIGINT'|'VARCHAR'|'BOOLEAN'|'TIMESTAMP'|'MULTI',
                        'MultiMeasureAttributeMappings': [
                            {
                                'SourceColumn': 'string',
                                'TargetMultiMeasureAttributeName': 'string',
                                'MeasureValueType': 'DOUBLE'|'BIGINT'|'BOOLEAN'|'VARCHAR'|'TIMESTAMP'
                            },
                        ]
                    },
                ],
                'MeasureNameColumn': 'string'
            },
            'DataModelS3Configuration': {
                'BucketName': 'string',
                'ObjectKey': 'string'
            }
        },
        'TargetDatabaseName': 'string',
        'TargetTableName': 'string',
        'TaskStatus': 'CREATED'|'IN_PROGRESS'|'FAILED'|'SUCCEEDED'|'PROGRESS_STOPPED'|'PENDING_RESUME',
        'RecordVersion': 123,
        'CreationTime': datetime(2015, 1, 1),
        'LastUpdatedTime': datetime(2015, 1, 1),
        'ResumableUntil': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • BatchLoadTaskDescription (dict) --

      Description of the batch load task.

      • TaskId (string) --

        The ID of the batch load task.

      • ErrorMessage (string) --

      • DataSourceConfiguration (dict) --

        Configuration details about the data source for a batch load task.

        • DataSourceS3Configuration (dict) --

          Configuration of an S3 location for a file which contains data to load.

          • BucketName (string) --

            The bucket name of the customer S3 bucket.

          • ObjectKeyPrefix (string) --

        • CsvConfiguration (dict) --

          A delimited data format where the column separator can be a comma and the record separator is a newline character.

          • ColumnSeparator (string) --

            Column separator can be one of comma (','), pipe ('|), semicolon (';'), tab('/t'), or blank space (' ').

          • EscapeChar (string) --

            Escape character can be one of

          • QuoteChar (string) --

            Can be single quote (') or double quote (").

          • NullValue (string) --

            Can be blank space (' ').

          • TrimWhiteSpace (boolean) --

            Specifies to trim leading and trailing white space.

        • DataFormat (string) --

          This is currently CSV.

      • ProgressReport (dict) --

        • RecordsProcessed (integer) --

        • RecordsIngested (integer) --

        • ParseFailures (integer) --

        • RecordIngestionFailures (integer) --

        • FileFailures (integer) --

        • BytesMetered (integer) --

      • ReportConfiguration (dict) --

        Report configuration for a batch load task. This contains details about where error reports are stored.

        • ReportS3Configuration (dict) --

          Configuration of an S3 location to write error reports and events for a batch load.

          • BucketName (string) --

          • ObjectKeyPrefix (string) --

          • EncryptionOption (string) --

          • KmsKeyId (string) --

      • DataModelConfiguration (dict) --

        Data model configuration for a batch load task. This contains details about where a data model for a batch load task is stored.

        • DataModel (dict) --

          • TimeColumn (string) --

            Source column to be mapped to time.

          • TimeUnit (string) --

            The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds, nanoseconds, or other supported values. Default is MILLISECONDS .

          • DimensionMappings (list) --

            Source to target mappings for dimensions.

            • (dict) --

              • SourceColumn (string) --

              • DestinationColumn (string) --

          • MultiMeasureMappings (dict) --

            Source to target mappings for multi-measure records.

            • TargetMultiMeasureName (string) --

            • MultiMeasureAttributeMappings (list) --

              • (dict) --

                • SourceColumn (string) --

                • TargetMultiMeasureAttributeName (string) --

                • MeasureValueType (string) --

          • MixedMeasureMappings (list) --

            Source to target mappings for measures.

            • (dict) --

              • MeasureName (string) --

              • SourceColumn (string) --

              • TargetMeasureName (string) --

              • MeasureValueType (string) --

              • MultiMeasureAttributeMappings (list) --

                • (dict) --

                  • SourceColumn (string) --

                  • TargetMultiMeasureAttributeName (string) --

                  • MeasureValueType (string) --

          • MeasureNameColumn (string) --

        • DataModelS3Configuration (dict) --

          • BucketName (string) --

          • ObjectKey (string) --

      • TargetDatabaseName (string) --

      • TargetTableName (string) --

      • TaskStatus (string) --

        Status of the batch load task.

      • RecordVersion (integer) --

      • CreationTime (datetime) --

        The time when the Timestream batch load task was created.

      • LastUpdatedTime (datetime) --

        The time when the Timestream batch load task was last updated.

      • ResumableUntil (datetime) --

CreateBatchLoadTask (new) Link ¶

Creates a new Timestream batch load task. A batch load task processes data from a CSV source in an S3 location and writes to a Timestream table. A mapping from source to target is defined in a batch load task. Errors and events are written to a report at an S3 location. For the report, if the KMS key is not specified, the batch load task will be encrypted with a Timestream managed KMS key located in your account. For more information, see Amazon Web Services managed keys. Service quotas apply. For details, see code sample.

See also: AWS API Documentation

Request Syntax

client.create_batch_load_task(
    ClientToken='string',
    DataModelConfiguration={
        'DataModel': {
            'TimeColumn': 'string',
            'TimeUnit': 'MILLISECONDS'|'SECONDS'|'MICROSECONDS'|'NANOSECONDS',
            'DimensionMappings': [
                {
                    'SourceColumn': 'string',
                    'DestinationColumn': 'string'
                },
            ],
            'MultiMeasureMappings': {
                'TargetMultiMeasureName': 'string',
                'MultiMeasureAttributeMappings': [
                    {
                        'SourceColumn': 'string',
                        'TargetMultiMeasureAttributeName': 'string',
                        'MeasureValueType': 'DOUBLE'|'BIGINT'|'BOOLEAN'|'VARCHAR'|'TIMESTAMP'
                    },
                ]
            },
            'MixedMeasureMappings': [
                {
                    'MeasureName': 'string',
                    'SourceColumn': 'string',
                    'TargetMeasureName': 'string',
                    'MeasureValueType': 'DOUBLE'|'BIGINT'|'VARCHAR'|'BOOLEAN'|'TIMESTAMP'|'MULTI',
                    'MultiMeasureAttributeMappings': [
                        {
                            'SourceColumn': 'string',
                            'TargetMultiMeasureAttributeName': 'string',
                            'MeasureValueType': 'DOUBLE'|'BIGINT'|'BOOLEAN'|'VARCHAR'|'TIMESTAMP'
                        },
                    ]
                },
            ],
            'MeasureNameColumn': 'string'
        },
        'DataModelS3Configuration': {
            'BucketName': 'string',
            'ObjectKey': 'string'
        }
    },
    DataSourceConfiguration={
        'DataSourceS3Configuration': {
            'BucketName': 'string',
            'ObjectKeyPrefix': 'string'
        },
        'CsvConfiguration': {
            'ColumnSeparator': 'string',
            'EscapeChar': 'string',
            'QuoteChar': 'string',
            'NullValue': 'string',
            'TrimWhiteSpace': True|False
        },
        'DataFormat': 'CSV'
    },
    ReportConfiguration={
        'ReportS3Configuration': {
            'BucketName': 'string',
            'ObjectKeyPrefix': 'string',
            'EncryptionOption': 'SSE_S3'|'SSE_KMS',
            'KmsKeyId': 'string'
        }
    },
    TargetDatabaseName='string',
    TargetTableName='string',
    RecordVersion=123
)
type ClientToken

string

param ClientToken

This field is autopopulated if not provided.

type DataModelConfiguration

dict

param DataModelConfiguration
  • DataModel (dict) --

    • TimeColumn (string) --

      Source column to be mapped to time.

    • TimeUnit (string) --

      The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds, nanoseconds, or other supported values. Default is MILLISECONDS .

    • DimensionMappings (list) -- [REQUIRED]

      Source to target mappings for dimensions.

      • (dict) --

        • SourceColumn (string) --

        • DestinationColumn (string) --

    • MultiMeasureMappings (dict) --

      Source to target mappings for multi-measure records.

      • TargetMultiMeasureName (string) --

      • MultiMeasureAttributeMappings (list) -- [REQUIRED]

        • (dict) --

          • SourceColumn (string) -- [REQUIRED]

          • TargetMultiMeasureAttributeName (string) --

          • MeasureValueType (string) --

    • MixedMeasureMappings (list) --

      Source to target mappings for measures.

      • (dict) --

        • MeasureName (string) --

        • SourceColumn (string) --

        • TargetMeasureName (string) --

        • MeasureValueType (string) -- [REQUIRED]

        • MultiMeasureAttributeMappings (list) --

          • (dict) --

            • SourceColumn (string) -- [REQUIRED]

            • TargetMultiMeasureAttributeName (string) --

            • MeasureValueType (string) --

    • MeasureNameColumn (string) --

  • DataModelS3Configuration (dict) --

    • BucketName (string) --

    • ObjectKey (string) --

type DataSourceConfiguration

dict

param DataSourceConfiguration

[REQUIRED]

Defines configuration details about the data source for a batch load task.

  • DataSourceS3Configuration (dict) -- [REQUIRED]

    Configuration of an S3 location for a file which contains data to load.

    • BucketName (string) -- [REQUIRED]

      The bucket name of the customer S3 bucket.

    • ObjectKeyPrefix (string) --

  • CsvConfiguration (dict) --

    A delimited data format where the column separator can be a comma and the record separator is a newline character.

    • ColumnSeparator (string) --

      Column separator can be one of comma (','), pipe ('|), semicolon (';'), tab('/t'), or blank space (' ').

    • EscapeChar (string) --

      Escape character can be one of

    • QuoteChar (string) --

      Can be single quote (') or double quote (").

    • NullValue (string) --

      Can be blank space (' ').

    • TrimWhiteSpace (boolean) --

      Specifies to trim leading and trailing white space.

  • DataFormat (string) -- [REQUIRED]

    This is currently CSV.

type ReportConfiguration

dict

param ReportConfiguration

[REQUIRED]

Report configuration for a batch load task. This contains details about where error reports are stored.

  • ReportS3Configuration (dict) --

    Configuration of an S3 location to write error reports and events for a batch load.

    • BucketName (string) -- [REQUIRED]

    • ObjectKeyPrefix (string) --

    • EncryptionOption (string) --

    • KmsKeyId (string) --

type TargetDatabaseName

string

param TargetDatabaseName

[REQUIRED]

Target Timestream database for a batch load task.

type TargetTableName

string

param TargetTableName

[REQUIRED]

Target Timestream table for a batch load task.

type RecordVersion

integer

param RecordVersion

rtype

dict

returns

Response Syntax

{
    'TaskId': 'string'
}

Response Structure

  • (dict) --

    • TaskId (string) --

      The ID of the batch load task.

ResumeBatchLoadTask (new) Link ¶

See also: AWS API Documentation

Request Syntax

client.resume_batch_load_task(
    TaskId='string'
)
type TaskId

string

param TaskId

[REQUIRED]

The ID of the batch load task to resume.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

CreateTable (updated) Link ¶
Changes (response)
{'Table': {'TableStatus': {'RESTORING'}}}

Adds a new table to an existing database in your account. In an Amazon Web Services account, table names must be at least unique within each Region if they are in the same database. You might have identical table names in the same Region if the tables are in separate databases. While creating the table, you must specify the table name, database name, and the retention properties. Service quotas apply. See code sample for details.

See also: AWS API Documentation

Request Syntax

client.create_table(
    DatabaseName='string',
    TableName='string',
    RetentionProperties={
        'MemoryStoreRetentionPeriodInHours': 123,
        'MagneticStoreRetentionPeriodInDays': 123
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    MagneticStoreWriteProperties={
        'EnableMagneticStoreWrites': True|False,
        'MagneticStoreRejectedDataLocation': {
            'S3Configuration': {
                'BucketName': 'string',
                'ObjectKeyPrefix': 'string',
                'EncryptionOption': 'SSE_S3'|'SSE_KMS',
                'KmsKeyId': 'string'
            }
        }
    }
)
type DatabaseName

string

param DatabaseName

[REQUIRED]

The name of the Timestream database.

type TableName

string

param TableName

[REQUIRED]

The name of the Timestream table.

type RetentionProperties

dict

param RetentionProperties

The duration for which your time-series data must be stored in the memory store and the magnetic store.

  • MemoryStoreRetentionPeriodInHours (integer) -- [REQUIRED]

    The duration for which data must be stored in the memory store.

  • MagneticStoreRetentionPeriodInDays (integer) -- [REQUIRED]

    The duration for which data must be stored in the magnetic store.

type Tags

list

param Tags

A list of key-value pairs to label the table.

  • (dict) --

    A tag is a label that you assign to a Timestream database and/or table. Each tag consists of a key and an optional value, both of which you define. With tags, you can categorize databases and/or tables, for example, by purpose, owner, or environment.

    • Key (string) -- [REQUIRED]

      The key of the tag. Tag keys are case sensitive.

    • Value (string) -- [REQUIRED]

      The value of the tag. Tag values are case-sensitive and can be null.

type MagneticStoreWriteProperties

dict

param MagneticStoreWriteProperties

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

  • EnableMagneticStoreWrites (boolean) -- [REQUIRED]

    A flag to enable magnetic store writes.

  • MagneticStoreRejectedDataLocation (dict) --

    The location to write error reports for records rejected asynchronously during magnetic store writes.

    • S3Configuration (dict) --

      Configuration of an S3 location to write error reports for records rejected, asynchronously, during magnetic store writes.

      • BucketName (string) --

        The bucket name of the customer S3 bucket.

      • ObjectKeyPrefix (string) --

        The object key preview for the customer S3 location.

      • EncryptionOption (string) --

        The encryption option for the customer S3 location. Options are S3 server-side encryption with an S3 managed key or Amazon Web Services managed key.

      • KmsKeyId (string) --

        The KMS key ID for the customer S3 location when encrypting with an Amazon Web Services managed key.

rtype

dict

returns

Response Syntax

{
    'Table': {
        'Arn': 'string',
        'TableName': 'string',
        'DatabaseName': 'string',
        'TableStatus': 'ACTIVE'|'DELETING'|'RESTORING',
        'RetentionProperties': {
            'MemoryStoreRetentionPeriodInHours': 123,
            'MagneticStoreRetentionPeriodInDays': 123
        },
        'CreationTime': datetime(2015, 1, 1),
        'LastUpdatedTime': datetime(2015, 1, 1),
        'MagneticStoreWriteProperties': {
            'EnableMagneticStoreWrites': True|False,
            'MagneticStoreRejectedDataLocation': {
                'S3Configuration': {
                    'BucketName': 'string',
                    'ObjectKeyPrefix': 'string',
                    'EncryptionOption': 'SSE_S3'|'SSE_KMS',
                    'KmsKeyId': 'string'
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    • Table (dict) --

      The newly created Timestream table.

      • Arn (string) --

        The Amazon Resource Name that uniquely identifies this table.

      • TableName (string) --

        The name of the Timestream table.

      • DatabaseName (string) --

        The name of the Timestream database that contains this table.

      • TableStatus (string) --

        The current state of the table:

        • DELETING - The table is being deleted.

        • ACTIVE - The table is ready for use.

      • RetentionProperties (dict) --

        The retention duration for the memory store and magnetic store.

        • MemoryStoreRetentionPeriodInHours (integer) --

          The duration for which data must be stored in the memory store.

        • MagneticStoreRetentionPeriodInDays (integer) --

          The duration for which data must be stored in the magnetic store.

      • CreationTime (datetime) --

        The time when the Timestream table was created.

      • LastUpdatedTime (datetime) --

        The time when the Timestream table was last updated.

      • MagneticStoreWriteProperties (dict) --

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

        • EnableMagneticStoreWrites (boolean) --

          A flag to enable magnetic store writes.

        • MagneticStoreRejectedDataLocation (dict) --

          The location to write error reports for records rejected asynchronously during magnetic store writes.

          • S3Configuration (dict) --

            Configuration of an S3 location to write error reports for records rejected, asynchronously, during magnetic store writes.

            • BucketName (string) --

              The bucket name of the customer S3 bucket.

            • ObjectKeyPrefix (string) --

              The object key preview for the customer S3 location.

            • EncryptionOption (string) --

              The encryption option for the customer S3 location. Options are S3 server-side encryption with an S3 managed key or Amazon Web Services managed key.

            • KmsKeyId (string) --

              The KMS key ID for the customer S3 location when encrypting with an Amazon Web Services managed key.

DescribeTable (updated) Link ¶
Changes (response)
{'Table': {'TableStatus': {'RESTORING'}}}

Returns information about the table, including the table name, database name, retention duration of the memory store and the magnetic store. Service quotas apply. See code sample for details.

See also: AWS API Documentation

Request Syntax

client.describe_table(
    DatabaseName='string',
    TableName='string'
)
type DatabaseName

string

param DatabaseName

[REQUIRED]

The name of the Timestream database.

type TableName

string

param TableName

[REQUIRED]

The name of the Timestream table.

rtype

dict

returns

Response Syntax

{
    'Table': {
        'Arn': 'string',
        'TableName': 'string',
        'DatabaseName': 'string',
        'TableStatus': 'ACTIVE'|'DELETING'|'RESTORING',
        'RetentionProperties': {
            'MemoryStoreRetentionPeriodInHours': 123,
            'MagneticStoreRetentionPeriodInDays': 123
        },
        'CreationTime': datetime(2015, 1, 1),
        'LastUpdatedTime': datetime(2015, 1, 1),
        'MagneticStoreWriteProperties': {
            'EnableMagneticStoreWrites': True|False,
            'MagneticStoreRejectedDataLocation': {
                'S3Configuration': {
                    'BucketName': 'string',
                    'ObjectKeyPrefix': 'string',
                    'EncryptionOption': 'SSE_S3'|'SSE_KMS',
                    'KmsKeyId': 'string'
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    • Table (dict) --

      The Timestream table.

      • Arn (string) --

        The Amazon Resource Name that uniquely identifies this table.

      • TableName (string) --

        The name of the Timestream table.

      • DatabaseName (string) --

        The name of the Timestream database that contains this table.

      • TableStatus (string) --

        The current state of the table:

        • DELETING - The table is being deleted.

        • ACTIVE - The table is ready for use.

      • RetentionProperties (dict) --

        The retention duration for the memory store and magnetic store.

        • MemoryStoreRetentionPeriodInHours (integer) --

          The duration for which data must be stored in the memory store.

        • MagneticStoreRetentionPeriodInDays (integer) --

          The duration for which data must be stored in the magnetic store.

      • CreationTime (datetime) --

        The time when the Timestream table was created.

      • LastUpdatedTime (datetime) --

        The time when the Timestream table was last updated.

      • MagneticStoreWriteProperties (dict) --

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

        • EnableMagneticStoreWrites (boolean) --

          A flag to enable magnetic store writes.

        • MagneticStoreRejectedDataLocation (dict) --

          The location to write error reports for records rejected asynchronously during magnetic store writes.

          • S3Configuration (dict) --

            Configuration of an S3 location to write error reports for records rejected, asynchronously, during magnetic store writes.

            • BucketName (string) --

              The bucket name of the customer S3 bucket.

            • ObjectKeyPrefix (string) --

              The object key preview for the customer S3 location.

            • EncryptionOption (string) --

              The encryption option for the customer S3 location. Options are S3 server-side encryption with an S3 managed key or Amazon Web Services managed key.

            • KmsKeyId (string) --

              The KMS key ID for the customer S3 location when encrypting with an Amazon Web Services managed key.

ListTables (updated) Link ¶
Changes (response)
{'Tables': {'TableStatus': {'RESTORING'}}}

Provides a list of tables, along with the name, status, and retention properties of each table. See code sample for details.

See also: AWS API Documentation

Request Syntax

client.list_tables(
    DatabaseName='string',
    NextToken='string',
    MaxResults=123
)
type DatabaseName

string

param DatabaseName

The name of the Timestream database.

type NextToken

string

param NextToken

The pagination token. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

type MaxResults

integer

param MaxResults

The total number of items to return in the output. If the total number of items available is more than the value specified, a NextToken is provided in the output. To resume pagination, provide the NextToken value as argument of a subsequent API invocation.

rtype

dict

returns

Response Syntax

{
    'Tables': [
        {
            'Arn': 'string',
            'TableName': 'string',
            'DatabaseName': 'string',
            'TableStatus': 'ACTIVE'|'DELETING'|'RESTORING',
            'RetentionProperties': {
                'MemoryStoreRetentionPeriodInHours': 123,
                'MagneticStoreRetentionPeriodInDays': 123
            },
            'CreationTime': datetime(2015, 1, 1),
            'LastUpdatedTime': datetime(2015, 1, 1),
            'MagneticStoreWriteProperties': {
                'EnableMagneticStoreWrites': True|False,
                'MagneticStoreRejectedDataLocation': {
                    'S3Configuration': {
                        'BucketName': 'string',
                        'ObjectKeyPrefix': 'string',
                        'EncryptionOption': 'SSE_S3'|'SSE_KMS',
                        'KmsKeyId': 'string'
                    }
                }
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Tables (list) --

      A list of tables.

      • (dict) --

        Represents a database table in Timestream. Tables contain one or more related time series. You can modify the retention duration of the memory store and the magnetic store for a table.

        • Arn (string) --

          The Amazon Resource Name that uniquely identifies this table.

        • TableName (string) --

          The name of the Timestream table.

        • DatabaseName (string) --

          The name of the Timestream database that contains this table.

        • TableStatus (string) --

          The current state of the table:

          • DELETING - The table is being deleted.

          • ACTIVE - The table is ready for use.

        • RetentionProperties (dict) --

          The retention duration for the memory store and magnetic store.

          • MemoryStoreRetentionPeriodInHours (integer) --

            The duration for which data must be stored in the memory store.

          • MagneticStoreRetentionPeriodInDays (integer) --

            The duration for which data must be stored in the magnetic store.

        • CreationTime (datetime) --

          The time when the Timestream table was created.

        • LastUpdatedTime (datetime) --

          The time when the Timestream table was last updated.

        • MagneticStoreWriteProperties (dict) --

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

          • EnableMagneticStoreWrites (boolean) --

            A flag to enable magnetic store writes.

          • MagneticStoreRejectedDataLocation (dict) --

            The location to write error reports for records rejected asynchronously during magnetic store writes.

            • S3Configuration (dict) --

              Configuration of an S3 location to write error reports for records rejected, asynchronously, during magnetic store writes.

              • BucketName (string) --

                The bucket name of the customer S3 bucket.

              • ObjectKeyPrefix (string) --

                The object key preview for the customer S3 location.

              • EncryptionOption (string) --

                The encryption option for the customer S3 location. Options are S3 server-side encryption with an S3 managed key or Amazon Web Services managed key.

              • KmsKeyId (string) --

                The KMS key ID for the customer S3 location when encrypting with an Amazon Web Services managed key.

    • NextToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previously truncated response.

UpdateTable (updated) Link ¶
Changes (response)
{'Table': {'TableStatus': {'RESTORING'}}}

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.

See also: AWS API Documentation

Request Syntax

client.update_table(
    DatabaseName='string',
    TableName='string',
    RetentionProperties={
        'MemoryStoreRetentionPeriodInHours': 123,
        'MagneticStoreRetentionPeriodInDays': 123
    },
    MagneticStoreWriteProperties={
        'EnableMagneticStoreWrites': True|False,
        'MagneticStoreRejectedDataLocation': {
            'S3Configuration': {
                'BucketName': 'string',
                'ObjectKeyPrefix': 'string',
                'EncryptionOption': 'SSE_S3'|'SSE_KMS',
                'KmsKeyId': 'string'
            }
        }
    }
)
type DatabaseName

string

param DatabaseName

[REQUIRED]

The name of the Timestream database.

type TableName

string

param TableName

[REQUIRED]

The name of the Timestream table.

type RetentionProperties

dict

param RetentionProperties

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

  • MemoryStoreRetentionPeriodInHours (integer) -- [REQUIRED]

    The duration for which data must be stored in the memory store.

  • MagneticStoreRetentionPeriodInDays (integer) -- [REQUIRED]

    The duration for which data must be stored in the magnetic store.

type MagneticStoreWriteProperties

dict

param MagneticStoreWriteProperties

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

  • EnableMagneticStoreWrites (boolean) -- [REQUIRED]

    A flag to enable magnetic store writes.

  • MagneticStoreRejectedDataLocation (dict) --

    The location to write error reports for records rejected asynchronously during magnetic store writes.

    • S3Configuration (dict) --

      Configuration of an S3 location to write error reports for records rejected, asynchronously, during magnetic store writes.

      • BucketName (string) --

        The bucket name of the customer S3 bucket.

      • ObjectKeyPrefix (string) --

        The object key preview for the customer S3 location.

      • EncryptionOption (string) --

        The encryption option for the customer S3 location. Options are S3 server-side encryption with an S3 managed key or Amazon Web Services managed key.

      • KmsKeyId (string) --

        The KMS key ID for the customer S3 location when encrypting with an Amazon Web Services managed key.

rtype

dict

returns

Response Syntax

{
    'Table': {
        'Arn': 'string',
        'TableName': 'string',
        'DatabaseName': 'string',
        'TableStatus': 'ACTIVE'|'DELETING'|'RESTORING',
        'RetentionProperties': {
            'MemoryStoreRetentionPeriodInHours': 123,
            'MagneticStoreRetentionPeriodInDays': 123
        },
        'CreationTime': datetime(2015, 1, 1),
        'LastUpdatedTime': datetime(2015, 1, 1),
        'MagneticStoreWriteProperties': {
            'EnableMagneticStoreWrites': True|False,
            'MagneticStoreRejectedDataLocation': {
                'S3Configuration': {
                    'BucketName': 'string',
                    'ObjectKeyPrefix': 'string',
                    'EncryptionOption': 'SSE_S3'|'SSE_KMS',
                    'KmsKeyId': 'string'
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    • Table (dict) --

      The updated Timestream table.

      • Arn (string) --

        The Amazon Resource Name that uniquely identifies this table.

      • TableName (string) --

        The name of the Timestream table.

      • DatabaseName (string) --

        The name of the Timestream database that contains this table.

      • TableStatus (string) --

        The current state of the table:

        • DELETING - The table is being deleted.

        • ACTIVE - The table is ready for use.

      • RetentionProperties (dict) --

        The retention duration for the memory store and magnetic store.

        • MemoryStoreRetentionPeriodInHours (integer) --

          The duration for which data must be stored in the memory store.

        • MagneticStoreRetentionPeriodInDays (integer) --

          The duration for which data must be stored in the magnetic store.

      • CreationTime (datetime) --

        The time when the Timestream table was created.

      • LastUpdatedTime (datetime) --

        The time when the Timestream table was last updated.

      • MagneticStoreWriteProperties (dict) --

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

        • EnableMagneticStoreWrites (boolean) --

          A flag to enable magnetic store writes.

        • MagneticStoreRejectedDataLocation (dict) --

          The location to write error reports for records rejected asynchronously during magnetic store writes.

          • S3Configuration (dict) --

            Configuration of an S3 location to write error reports for records rejected, asynchronously, during magnetic store writes.

            • BucketName (string) --

              The bucket name of the customer S3 bucket.

            • ObjectKeyPrefix (string) --

              The object key preview for the customer S3 location.

            • EncryptionOption (string) --

              The encryption option for the customer S3 location. Options are S3 server-side encryption with an S3 managed key or Amazon Web Services managed key.

            • KmsKeyId (string) --

              The KMS key ID for the customer S3 location when encrypting with an Amazon Web Services managed key.