You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

Class: AWS.TimestreamWrite

Inherits:
AWS.Service show all
Identifier:
timestreamwrite
API Version:
2018-11-01
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

Amazon Timestream is a fast, scalable, fully managed time series database service that makes it easy to store and analyze trillions of time series data points per day. With Timestream, you can easily store and analyze IoT sensor data to derive insights from your IoT applications. You can analyze industrial telemetry to streamline equipment management and maintenance. You can also store and analyze log data and metrics to improve the performance and availability of your applications. Timestream is built from the ground up to effectively ingest, process, and store time series data. It organizes data to optimize query processing. It automatically scales based on the volume of data ingested and on the query volume to ensure you receive optimal performance while inserting and querying data. As your data grows over time, Timestream’s adaptive query processing engine spans across storage tiers to provide fast analysis while reducing costs.

Sending a Request Using TimestreamWrite

var timestreamwrite = new AWS.TimestreamWrite();
timestreamwrite.createDatabase(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the TimestreamWrite object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var timestreamwrite = new AWS.TimestreamWrite({apiVersion: '2018-11-01'});

You can also set the API version globally in AWS.config.apiVersions using the timestreamwrite service identifier:

AWS.config.apiVersions = {
  timestreamwrite: '2018-11-01',
  // other service API versions
};

var timestreamwrite = new AWS.TimestreamWrite();

Version:

  • 2018-11-01

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.TimestreamWrite(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a TimestreamWrite object

var timestreamwrite = new AWS.TimestreamWrite({apiVersion: '2018-11-01'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.TimestreamWrite.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.TimestreamWrite.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.TimestreamWrite.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createDatabase(params = {}, callback) ⇒ AWS.Request

Creates a new Timestream database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info. Service quotas apply. For more information, see Access Management in the Timestream Developer Guide.

Service Reference:

Examples:

Calling the createDatabase operation

var params = {
  DatabaseName: 'STRING_VALUE', /* required */
  KmsKeyId: 'STRING_VALUE',
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
timestreamwrite.createDatabase(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the Timestream database.

    • KmsKeyId — (String)

      The KMS key for the database. If the KMS key is not specified, the database will be encrypted with a Timestream managed KMS key located in your account. Refer to AWS managed KMS keys for more info.

    • Tags — (Array<map>)

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

      • Keyrequired — (String)

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

      • Valuerequired — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Database — (map)

        The newly created Timestream database.

        • Arn — (String)

          The Amazon Resource Name that uniquely identifies this database.

        • DatabaseName — (String)

          The name of the Timestream database.

        • TableCount — (Integer)

          The total number of tables found within a Timestream database.

        • KmsKeyId — (String)

          The identifier of the KMS key used to encrypt the data stored in the database.

        • CreationTime — (Date)

          The time when the database was created, calculated from the Unix epoch time.

        • LastUpdatedTime — (Date)

          The last time that this database was updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createTable(params = {}, callback) ⇒ AWS.Request

The CreateTable operation adds a new table to an existing database in your account. In an AWS account, table names must be at least unique within each Region if they are in the same database. You may have identical table names in the same Region if the tables are in seperate databases. While creating the table, you must specify the table name, database name, and the retention properties. Service quotas apply. For more information, see Access Management in the Timestream Developer Guide.

Service Reference:

Examples:

Calling the createTable operation

var params = {
  DatabaseName: 'STRING_VALUE', /* required */
  TableName: 'STRING_VALUE', /* required */
  RetentionProperties: {
    MagneticStoreRetentionPeriodInDays: 'NUMBER_VALUE', /* required */
    MemoryStoreRetentionPeriodInHours: 'NUMBER_VALUE' /* required */
  },
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
timestreamwrite.createTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the Timestream database.

    • TableName — (String)

      The name of the Timestream table.

    • RetentionProperties — (map)

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

      • MemoryStoreRetentionPeriodInHoursrequired — (Integer)

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

      • MagneticStoreRetentionPeriodInDaysrequired — (Integer)

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

    • Tags — (Array<map>)

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

      • Keyrequired — (String)

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

      • Valuerequired — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Table — (map)

        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.

          Possible values include:
          • "ACTIVE"
          • "DELETING"
        • RetentionProperties — (map)

          The retention duration for the memory store and magnetic store.

          • MemoryStoreRetentionPeriodInHoursrequired — (Integer)

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

          • MagneticStoreRetentionPeriodInDaysrequired — (Integer)

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

        • CreationTime — (Date)

          The time when the Timestream table was created.

        • LastUpdatedTime — (Date)

          The time when the Timestream table was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteDatabase(params = {}, callback) ⇒ AWS.Request

Deletes a given Timestream database. This is an irreversible operation. After a database is deleted, the time series data from its tables cannot be recovered.

All tables in the database must be deleted first, or a ValidationException error will be thrown.

Due to the nature of distributed retries, the operation can return either success or a ResourceNotFoundException. Clients should consider them equivalent.

Service Reference:

Examples:

Calling the deleteDatabase operation

var params = {
  DatabaseName: 'STRING_VALUE' /* required */
};
timestreamwrite.deleteDatabase(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the Timestream database to be deleted.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteTable(params = {}, callback) ⇒ AWS.Request

Deletes a given Timestream table. This is an irreversible operation. After a Timestream database table is deleted, the time series data stored in the table cannot be recovered.

Due to the nature of distributed retries, the operation can return either success or a ResourceNotFoundException. Clients should consider them equivalent.

Service Reference:

Examples:

Calling the deleteTable operation

var params = {
  DatabaseName: 'STRING_VALUE', /* required */
  TableName: 'STRING_VALUE' /* required */
};
timestreamwrite.deleteTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the database where the Timestream database is to be deleted.

    • TableName — (String)

      The name of the Timestream table to be deleted.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeDatabase(params = {}, callback) ⇒ AWS.Request

Returns information about the database, including the database name, time that the database was created, and the total number of tables found within the database. Service quotas apply. For more information, see Access Management in the Timestream Developer Guide.

Service Reference:

Examples:

Calling the describeDatabase operation

var params = {
  DatabaseName: 'STRING_VALUE' /* required */
};
timestreamwrite.describeDatabase(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the Timestream database.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Database — (map)

        The name of the Timestream table.

        • Arn — (String)

          The Amazon Resource Name that uniquely identifies this database.

        • DatabaseName — (String)

          The name of the Timestream database.

        • TableCount — (Integer)

          The total number of tables found within a Timestream database.

        • KmsKeyId — (String)

          The identifier of the KMS key used to encrypt the data stored in the database.

        • CreationTime — (Date)

          The time when the database was created, calculated from the Unix epoch time.

        • LastUpdatedTime — (Date)

          The last time that this database was updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeEndpoints(params = {}, callback) ⇒ AWS.Request

DescribeEndpoints returns a list of available endpoints to make Timestream API calls against. This API is available through both Write and Query.

Because Timestream’s SDKs are designed to transparently work with the service’s architecture, including the management and mapping of the service endpoints, it is not recommended that you use this API unless:

  • Your application uses a programming language that does not yet have SDK support

  • You require better control over the client-side implementation

For detailed information on how to use DescribeEndpoints, see The Endpoint Discovery Pattern and REST APIs.

Service Reference:

Examples:

Calling the describeEndpoints operation

var params = {
};
timestreamwrite.describeEndpoints(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Endpoints — (Array<map>)

        An Endpoints object is returned when a DescribeEndpoints request is made.

        • Addressrequired — (String)

          An endpoint address.

        • CachePeriodInMinutesrequired — (Integer)

          The TTL for the endpoint, in minutes.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTable(params = {}, callback) ⇒ AWS.Request

Returns information about the table, including the table name, database name, retention duration of the memory store and the magnetic store. Service quotas apply. For more information, see Access Management in the Timestream Developer Guide.

Service Reference:

Examples:

Calling the describeTable operation

var params = {
  DatabaseName: 'STRING_VALUE', /* required */
  TableName: 'STRING_VALUE' /* required */
};
timestreamwrite.describeTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the Timestream database.

    • TableName — (String)

      The name of the Timestream table.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Table — (map)

        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.

          Possible values include:
          • "ACTIVE"
          • "DELETING"
        • RetentionProperties — (map)

          The retention duration for the memory store and magnetic store.

          • MemoryStoreRetentionPeriodInHoursrequired — (Integer)

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

          • MagneticStoreRetentionPeriodInDaysrequired — (Integer)

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

        • CreationTime — (Date)

          The time when the Timestream table was created.

        • LastUpdatedTime — (Date)

          The time when the Timestream table was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listDatabases(params = {}, callback) ⇒ AWS.Request

Returns a list of your Timestream databases. Service quotas apply. For more information, see Access Management in the Timestream Developer Guide.

Service Reference:

Examples:

Calling the listDatabases operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
timestreamwrite.listDatabases(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • NextToken — (String)

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

    • MaxResults — (Integer)

      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.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Databases — (Array<map>)

        A list of database names.

        • Arn — (String)

          The Amazon Resource Name that uniquely identifies this database.

        • DatabaseName — (String)

          The name of the Timestream database.

        • TableCount — (Integer)

          The total number of tables found within a Timestream database.

        • KmsKeyId — (String)

          The identifier of the KMS key used to encrypt the data stored in the database.

        • CreationTime — (Date)

          The time when the database was created, calculated from the Unix epoch time.

        • LastUpdatedTime — (Date)

          The last time that this database was updated.

      • NextToken — (String)

        The pagination token. This parameter is returned when the response is truncated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTables(params = {}, callback) ⇒ AWS.Request

A list of tables, along with the name, status and retention properties of each table.

Service Reference:

Examples:

Calling the listTables operation

var params = {
  DatabaseName: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
timestreamwrite.listTables(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the Timestream database.

    • NextToken — (String)

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

    • MaxResults — (Integer)

      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.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Tables — (Array<map>)

        A list of tables.

        • 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.

          Possible values include:
          • "ACTIVE"
          • "DELETING"
        • RetentionProperties — (map)

          The retention duration for the memory store and magnetic store.

          • MemoryStoreRetentionPeriodInHoursrequired — (Integer)

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

          • MagneticStoreRetentionPeriodInDaysrequired — (Integer)

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

        • CreationTime — (Date)

          The time when the Timestream table was created.

        • LastUpdatedTime — (Date)

          The time when the Timestream table was last updated.

      • NextToken — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTagsForResource(params = {}, callback) ⇒ AWS.Request

List all tags on a Timestream resource.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  ResourceARN: 'STRING_VALUE' /* required */
};
timestreamwrite.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceARN — (String)

      The Timestream resource with tags to be listed. This value is an Amazon Resource Name (ARN).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Tags — (Array<map>)

        The tags currently associated with the Timestream resource.

        • Keyrequired — (String)

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

        • Valuerequired — (String)

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tagResource(params = {}, callback) ⇒ AWS.Request

Associate a set of tags with a Timestream resource. You can then activate these user-defined tags so that they appear on the Billing and Cost Management console for cost allocation tracking.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
timestreamwrite.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceARN — (String)

      Identifies the Timestream resource to which tags should be added. This value is an Amazon Resource Name (ARN).

    • Tags — (Array<map>)

      The tags to be assigned to the Timestream resource.

      • Keyrequired — (String)

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

      • Valuerequired — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untagResource(params = {}, callback) ⇒ AWS.Request

Removes the association of tags from a Timestream resource.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  ResourceARN: 'STRING_VALUE', /* required */
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
timestreamwrite.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceARN — (String)

      The Timestream resource that the tags will be removed from. This value is an Amazon Resource Name (ARN).

    • TagKeys — (Array<String>)

      A list of tags keys. Existing tags of the resource whose keys are members of this list will be removed from the Timestream resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateDatabase(params = {}, callback) ⇒ AWS.Request

Modifies the KMS key for an existing database. While updating the database, you must specify the database name and the identifier of the new KMS key to be used (KmsKeyId). If there are any concurrent UpdateDatabase requests, first writer wins.

Service Reference:

Examples:

Calling the updateDatabase operation

var params = {
  DatabaseName: 'STRING_VALUE', /* required */
  KmsKeyId: 'STRING_VALUE' /* required */
};
timestreamwrite.updateDatabase(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the database.

    • KmsKeyId — (String)

      The identifier of the new KMS key (KmsKeyId) to be used to encrypt the data stored in the database. If the KmsKeyId currently registered with the database is the same as the KmsKeyId in the request, there will not be any update.

      You can specify the KmsKeyId using any of the following:

      • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

      • Key ARN: arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

      • Alias name: alias/ExampleAlias

      • Alias ARN: arn:aws:kms:us-east-1:111122223333:alias/ExampleAlias

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Database — (map)

        A top level container for a table. Databases and tables are the fundamental management concepts in Amazon Timestream. All tables in a database are encrypted with the same KMS key.

        • Arn — (String)

          The Amazon Resource Name that uniquely identifies this database.

        • DatabaseName — (String)

          The name of the Timestream database.

        • TableCount — (Integer)

          The total number of tables found within a Timestream database.

        • KmsKeyId — (String)

          The identifier of the KMS key used to encrypt the data stored in the database.

        • CreationTime — (Date)

          The time when the database was created, calculated from the Unix epoch time.

        • LastUpdatedTime — (Date)

          The last time that this database was updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateTable(params = {}, callback) ⇒ AWS.Request

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.

Service quotas apply. For more information, see Access Management in the Timestream Developer Guide.

Service Reference:

Examples:

Calling the updateTable operation

var params = {
  DatabaseName: 'STRING_VALUE', /* required */
  RetentionProperties: { /* required */
    MagneticStoreRetentionPeriodInDays: 'NUMBER_VALUE', /* required */
    MemoryStoreRetentionPeriodInHours: 'NUMBER_VALUE' /* required */
  },
  TableName: 'STRING_VALUE' /* required */
};
timestreamwrite.updateTable(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the Timestream database.

    • TableName — (String)

      The name of the Timesream table.

    • RetentionProperties — (map)

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

      • MemoryStoreRetentionPeriodInHoursrequired — (Integer)

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

      • MagneticStoreRetentionPeriodInDaysrequired — (Integer)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Table — (map)

        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.

          Possible values include:
          • "ACTIVE"
          • "DELETING"
        • RetentionProperties — (map)

          The retention duration for the memory store and magnetic store.

          • MemoryStoreRetentionPeriodInHoursrequired — (Integer)

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

          • MagneticStoreRetentionPeriodInDaysrequired — (Integer)

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

        • CreationTime — (Date)

          The time when the Timestream table was created.

        • LastUpdatedTime — (Date)

          The time when the Timestream table was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

writeRecords(params = {}, callback) ⇒ AWS.Request

The WriteRecords operation enables you to write your time series data into Timestream. You can specify a single data point or a batch of data points to be inserted into the system. Timestream offers you with a flexible schema that auto detects the column names and data types for your Timestream tables based on the dimension names and data types of the data points you specify when invoking writes into the database. Timestream support eventual consistency read semantics. This means that when you query data immediately after writing a batch of data into Timestream, the query results might not reflect the results of a recently completed write operation. The results may also include some stale data. If you repeat the query request after a short time, the results should return the latest data. Service quotas apply. For more information, see Access Management in the Timestream Developer Guide.

Service Reference:

Examples:

Calling the writeRecords operation

var params = {
  DatabaseName: 'STRING_VALUE', /* required */
  Records: [ /* required */
    {
      Dimensions: [
        {
          Name: 'STRING_VALUE', /* required */
          Value: 'STRING_VALUE', /* required */
          DimensionValueType: VARCHAR
        },
        /* more items */
      ],
      MeasureName: 'STRING_VALUE',
      MeasureValue: 'STRING_VALUE',
      MeasureValueType: DOUBLE | BIGINT | VARCHAR | BOOLEAN,
      Time: 'STRING_VALUE',
      TimeUnit: MILLISECONDS | SECONDS | MICROSECONDS | NANOSECONDS,
      Version: 'NUMBER_VALUE'
    },
    /* more items */
  ],
  TableName: 'STRING_VALUE', /* required */
  CommonAttributes: {
    Dimensions: [
      {
        Name: 'STRING_VALUE', /* required */
        Value: 'STRING_VALUE', /* required */
        DimensionValueType: VARCHAR
      },
      /* more items */
    ],
    MeasureName: 'STRING_VALUE',
    MeasureValue: 'STRING_VALUE',
    MeasureValueType: DOUBLE | BIGINT | VARCHAR | BOOLEAN,
    Time: 'STRING_VALUE',
    TimeUnit: MILLISECONDS | SECONDS | MICROSECONDS | NANOSECONDS,
    Version: 'NUMBER_VALUE'
  }
};
timestreamwrite.writeRecords(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • DatabaseName — (String)

      The name of the Timestream database.

    • TableName — (String)

      The name of the Timesream table.

    • CommonAttributes — (map)

      A record containing the common measure and dimension attributes shared across all the records in the request. The measure and dimension attributes specified in here will be merged with the measure and dimension attributes in the records object when the data is written into Timestream.

      • Dimensions — (Array<map>)

        Contains the list of dimensions for time series data points.

        • Namerequired — (String)

          Dimension represents the meta data attributes of the time series. For example, the name and availability zone of an EC2 instance or the name of the manufacturer of a wind turbine are dimensions.

          For constraints on Dimension names, see Naming Constraints.

        • Valuerequired — (String)

          The value of the dimension.

        • DimensionValueType — (String)

          The data type of the dimension for the time series data point.

          Possible values include:
          • "VARCHAR"
      • MeasureName — (String)

        Measure represents the data attribute of the time series. For example, the CPU utilization of an EC2 instance or the RPM of a wind turbine are measures.

      • MeasureValue — (String)

        Contains the measure value for the time series data point.

      • MeasureValueType — (String)

        Contains the data type of the measure value for the time series data point.

        Possible values include:
        • "DOUBLE"
        • "BIGINT"
        • "VARCHAR"
        • "BOOLEAN"
      • Time — (String)

        Contains the time at which the measure value for the data point was collected. The time value plus the unit provides the time elapsed since the epoch. For example, if the time value is 12345 and the unit is ms, then 12345 ms have elapsed since the epoch.

      • TimeUnit — (String)

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

        Possible values include:
        • "MILLISECONDS"
        • "SECONDS"
        • "MICROSECONDS"
        • "NANOSECONDS"
      • Version — (Integer)

        64-bit attribute used for record updates. Write requests for duplicate data with a higher version number will update the existing measure value and version. In cases where the measure value is the same, Version will still be updated . Default value is to 1.

    • Records — (Array<map>)

      An array of records containing the unique dimension and measure attributes for each time series data point.

      • Dimensions — (Array<map>)

        Contains the list of dimensions for time series data points.

        • Namerequired — (String)

          Dimension represents the meta data attributes of the time series. For example, the name and availability zone of an EC2 instance or the name of the manufacturer of a wind turbine are dimensions.

          For constraints on Dimension names, see Naming Constraints.

        • Valuerequired — (String)

          The value of the dimension.

        • DimensionValueType — (String)

          The data type of the dimension for the time series data point.

          Possible values include:
          • "VARCHAR"
      • MeasureName — (String)

        Measure represents the data attribute of the time series. For example, the CPU utilization of an EC2 instance or the RPM of a wind turbine are measures.

      • MeasureValue — (String)

        Contains the measure value for the time series data point.

      • MeasureValueType — (String)

        Contains the data type of the measure value for the time series data point.

        Possible values include:
        • "DOUBLE"
        • "BIGINT"
        • "VARCHAR"
        • "BOOLEAN"
      • Time — (String)

        Contains the time at which the measure value for the data point was collected. The time value plus the unit provides the time elapsed since the epoch. For example, if the time value is 12345 and the unit is ms, then 12345 ms have elapsed since the epoch.

      • TimeUnit — (String)

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

        Possible values include:
        • "MILLISECONDS"
        • "SECONDS"
        • "MICROSECONDS"
        • "NANOSECONDS"
      • Version — (Integer)

        64-bit attribute used for record updates. Write requests for duplicate data with a higher version number will update the existing measure value and version. In cases where the measure value is the same, Version will still be updated . Default value is to 1.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.