

For similar capabilities to Amazon Timestream for LiveAnalytics, consider Amazon Timestream for InfluxDB. It offers simplified data ingestion and single-digit millisecond query response times for real-time analytics. Learn more [here](https://docs.aws.amazon.com//timestream/latest/developerguide/timestream-for-influxdb.html).

# Amazon Timestream Query
<a name="API_Operations_Amazon_Timestream_Query"></a>

The following actions are supported by Amazon Timestream Query:
+  [CancelQuery](API_query_CancelQuery.md) 
+  [CreateScheduledQuery](API_query_CreateScheduledQuery.md) 
+  [DeleteScheduledQuery](API_query_DeleteScheduledQuery.md) 
+  [DescribeAccountSettings](API_query_DescribeAccountSettings.md) 
+  [DescribeEndpoints](API_query_DescribeEndpoints.md) 
+  [DescribeScheduledQuery](API_query_DescribeScheduledQuery.md) 
+  [ExecuteScheduledQuery](API_query_ExecuteScheduledQuery.md) 
+  [ListScheduledQueries](API_query_ListScheduledQueries.md) 
+  [ListTagsForResource](API_query_ListTagsForResource.md) 
+  [PrepareQuery](API_query_PrepareQuery.md) 
+  [Query](API_query_Query.md) 
+  [TagResource](API_query_TagResource.md) 
+  [UntagResource](API_query_UntagResource.md) 
+  [UpdateAccountSettings](API_query_UpdateAccountSettings.md) 
+  [UpdateScheduledQuery](API_query_UpdateScheduledQuery.md) 

# CancelQuery
<a name="API_query_CancelQuery"></a>

 Cancels a query that has been issued. Cancellation is provided only if the query has not completed running before the cancellation request was issued. Because cancellation is an idempotent operation, subsequent cancellation requests will return a `CancellationMessage`, indicating that the query has already been canceled. See [code sample](https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.cancel-query.html) for details. 

## Request Syntax
<a name="API_query_CancelQuery_RequestSyntax"></a>

```
{
   "QueryId": "string"
}
```

## Request Parameters
<a name="API_query_CancelQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [QueryId](#API_query_CancelQuery_RequestSyntax) **   <a name="timestream-query_CancelQuery-request-QueryId"></a>
 The ID of the query that needs to be cancelled. `QueryID` is returned as part of the query result.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[a-zA-Z0-9]+`   
Required: Yes

## Response Syntax
<a name="API_query_CancelQuery_ResponseSyntax"></a>

```
{
   "CancellationMessage": "string"
}
```

## Response Elements
<a name="API_query_CancelQuery_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [CancellationMessage](#API_query_CancelQuery_ResponseSyntax) **   <a name="timestream-query_CancelQuery-response-CancellationMessage"></a>
 A `CancellationMessage` is returned when a `CancelQuery` request for the query specified by `QueryId` has already been issued.   
Type: String

## Errors
<a name="API_query_CancelQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_CancelQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/CancelQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/CancelQuery) 

# CreateScheduledQuery
<a name="API_query_CreateScheduledQuery"></a>

 Create a scheduled query that will be run on your behalf at the configured schedule. Timestream assumes the execution role provided as part of the `ScheduledQueryExecutionRoleArn` parameter to run the query. You can use the `NotificationConfiguration` parameter to configure notification for your scheduled query operations.

## Request Syntax
<a name="API_query_CreateScheduledQuery_RequestSyntax"></a>

```
{
   "ClientToken": "string",
   "ErrorReportConfiguration": { 
      "S3Configuration": { 
         "BucketName": "string",
         "EncryptionOption": "string",
         "ObjectKeyPrefix": "string"
      }
   },
   "KmsKeyId": "string",
   "Name": "string",
   "NotificationConfiguration": { 
      "SnsConfiguration": { 
         "TopicArn": "string"
      }
   },
   "QueryString": "string",
   "ScheduleConfiguration": { 
      "ScheduleExpression": "string"
   },
   "ScheduledQueryExecutionRoleArn": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ],
   "TargetConfiguration": { 
      "TimestreamConfiguration": { 
         "DatabaseName": "string",
         "DimensionMappings": [ 
            { 
               "DimensionValueType": "string",
               "Name": "string"
            }
         ],
         "MeasureNameColumn": "string",
         "MixedMeasureMappings": [ 
            { 
               "MeasureName": "string",
               "MeasureValueType": "string",
               "MultiMeasureAttributeMappings": [ 
                  { 
                     "MeasureValueType": "string",
                     "SourceColumn": "string",
                     "TargetMultiMeasureAttributeName": "string"
                  }
               ],
               "SourceColumn": "string",
               "TargetMeasureName": "string"
            }
         ],
         "MultiMeasureMappings": { 
            "MultiMeasureAttributeMappings": [ 
               { 
                  "MeasureValueType": "string",
                  "SourceColumn": "string",
                  "TargetMultiMeasureAttributeName": "string"
               }
            ],
            "TargetMultiMeasureName": "string"
         },
         "TableName": "string",
         "TimeColumn": "string"
      }
   }
}
```

## Request Parameters
<a name="API_query_CreateScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ClientToken](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-ClientToken"></a>
Using a ClientToken makes the call to CreateScheduledQuery idempotent, in other words, making the same request repeatedly will produce the same result. Making multiple identical CreateScheduledQuery requests has the same effect as making a single request.   
+  If CreateScheduledQuery is called without a `ClientToken`, the Query SDK generates a `ClientToken` on your behalf.
+  After 8 hours, any request with the same `ClientToken` is treated as a new request. 
Type: String  
Length Constraints: Minimum length of 32. Maximum length of 128.  
Required: No

 ** [ErrorReportConfiguration](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-ErrorReportConfiguration"></a>
Configuration for error reporting. Error reports will be generated when a problem is encountered when writing the query results.   
Type: [ErrorReportConfiguration](API_query_ErrorReportConfiguration.md) object  
Required: Yes

 ** [KmsKeyId](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-KmsKeyId"></a>
The Amazon KMS key used to encrypt the scheduled query resource, at-rest. If the Amazon KMS key is not specified, the scheduled query resource will be encrypted with a Timestream owned Amazon KMS key. To specify a KMS key, use the key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix the name with *alias/*   
If ErrorReportConfiguration uses `SSE_KMS` as encryption type, the same KmsKeyId is used to encrypt the error report at rest.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: No

 ** [Name](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-Name"></a>
Name of the scheduled query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[a-zA-Z0-9|!\-_*'\(\)]([a-zA-Z0-9]|[!\-_*'\(\)\/.])+`   
Required: Yes

 ** [NotificationConfiguration](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-NotificationConfiguration"></a>
Notification configuration for the scheduled query. A notification is sent by Timestream when a query run finishes, when the state is updated or when you delete it.   
Type: [NotificationConfiguration](API_query_NotificationConfiguration.md) object  
Required: Yes

 ** [QueryString](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-QueryString"></a>
The query string to run. Parameter names can be specified in the query string `@` character followed by an identifier. The named Parameter `@scheduled_runtime` is reserved and can be used in the query to get the time at which the query is scheduled to run.  
The timestamp calculated according to the ScheduleConfiguration parameter, will be the value of `@scheduled_runtime` paramater for each query run. For example, consider an instance of a scheduled query executing on 2021-12-01 00:00:00. For this instance, the `@scheduled_runtime` parameter is initialized to the timestamp 2021-12-01 00:00:00 when invoking the query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 262144.  
Required: Yes

 ** [ScheduleConfiguration](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-ScheduleConfiguration"></a>
The schedule configuration for the query.  
Type: [ScheduleConfiguration](API_query_ScheduleConfiguration.md) object  
Required: Yes

 ** [ScheduledQueryExecutionRoleArn](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-ScheduledQueryExecutionRoleArn"></a>
The ARN for the IAM role that Timestream will assume when running the scheduled query.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

 ** [Tags](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-Tags"></a>
A list of key-value pairs to label the scheduled query.  
Type: Array of [Tag](API_query_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

 ** [TargetConfiguration](#API_query_CreateScheduledQuery_RequestSyntax) **   <a name="timestream-query_CreateScheduledQuery-request-TargetConfiguration"></a>
Configuration used for writing the result of a query.  
Type: [TargetConfiguration](API_query_TargetConfiguration.md) object  
Required: No

## Response Syntax
<a name="API_query_CreateScheduledQuery_ResponseSyntax"></a>

```
{
   "Arn": "string"
}
```

## Response Elements
<a name="API_query_CreateScheduledQuery_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Arn](#API_query_CreateScheduledQuery_ResponseSyntax) **   <a name="timestream-query_CreateScheduledQuery-response-Arn"></a>
ARN for the created scheduled query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.

## Errors
<a name="API_query_CreateScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** ConflictException **   
 Unable to poll results for a cancelled query.   
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
You have exceeded the service quota.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_CreateScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/CreateScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/CreateScheduledQuery) 

# DeleteScheduledQuery
<a name="API_query_DeleteScheduledQuery"></a>

Deletes a given scheduled query. This is an irreversible operation. 

## Request Syntax
<a name="API_query_DeleteScheduledQuery_RequestSyntax"></a>

```
{
   "ScheduledQueryArn": "string"
}
```

## Request Parameters
<a name="API_query_DeleteScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ScheduledQueryArn](#API_query_DeleteScheduledQuery_RequestSyntax) **   <a name="timestream-query_DeleteScheduledQuery-request-ScheduledQueryArn"></a>
The ARN of the scheduled query.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

## Response Elements
<a name="API_query_DeleteScheduledQuery_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

## Errors
<a name="API_query_DeleteScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The requested resource could not be found.    
 ** ScheduledQueryArn **   
The ARN of the scheduled query.
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_DeleteScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/DeleteScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/DeleteScheduledQuery) 

# DescribeAccountSettings
<a name="API_query_DescribeAccountSettings"></a>

Describes the settings for your account that include the query pricing model and the configured maximum TCUs the service can use for your query workload.

You're charged only for the duration of compute units used for your workloads.

## Response Syntax
<a name="API_query_DescribeAccountSettings_ResponseSyntax"></a>

```
{
   "MaxQueryTCU": number,
   "QueryCompute": { 
      "ComputeMode": "string",
      "ProvisionedCapacity": { 
         "ActiveQueryTCU": number,
         "LastUpdate": { 
            "Status": "string",
            "StatusMessage": "string",
            "TargetQueryTCU": number
         },
         "NotificationConfiguration": { 
            "RoleArn": "string",
            "SnsConfiguration": { 
               "TopicArn": "string"
            }
         }
      }
   },
   "QueryPricingModel": "string"
}
```

## Response Elements
<a name="API_query_DescribeAccountSettings_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [MaxQueryTCU](#API_query_DescribeAccountSettings_ResponseSyntax) **   <a name="timestream-query_DescribeAccountSettings-response-MaxQueryTCU"></a>
The maximum number of [Timestream compute units](https://docs.aws.amazon.com/timestream/latest/developerguide/tcu.html) (TCUs) the service will use at any point in time to serve your queries. To run queries, you must set a minimum capacity of 4 TCU. You can set the maximum number of TCU in multiples of 4, for example, 4, 8, 16, 32, and so on. This configuration is applicable only for on-demand usage of (TCUs).   
Type: Integer

 ** [QueryCompute](#API_query_DescribeAccountSettings_ResponseSyntax) **   <a name="timestream-query_DescribeAccountSettings-response-QueryCompute"></a>
An object that contains the usage settings for Timestream Compute Units (TCUs) in your account for the query workload. QueryCompute is available only in the Asia Pacific (Mumbai) region.  
Type: [QueryComputeResponse](API_query_QueryComputeResponse.md) object

 ** [QueryPricingModel](#API_query_DescribeAccountSettings_ResponseSyntax) **   <a name="timestream-query_DescribeAccountSettings-response-QueryPricingModel"></a>
The pricing model for queries in your account.  
The `QueryPricingModel` parameter is used by several Timestream operations; however, the `UpdateAccountSettings` API operation doesn't recognize any values other than `COMPUTE_UNITS`.
Type: String  
Valid Values: `BYTES_SCANNED | COMPUTE_UNITS` 

## Errors
<a name="API_query_DescribeAccountSettings_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

## See Also
<a name="API_query_DescribeAccountSettings_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/DescribeAccountSettings) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/DescribeAccountSettings) 

# DescribeEndpoints
<a name="API_query_DescribeEndpoints"></a>

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

Because the Timestream 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*:
+ You are using [VPC endpoints (AWS PrivateLink) with Timestream ](https://docs.aws.amazon.com/timestream/latest/developerguide/VPCEndpoints) 
+ 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 and when to use and implement DescribeEndpoints, see [The Endpoint Discovery Pattern](https://docs.aws.amazon.com/timestream/latest/developerguide/Using.API.html#Using-API.endpoint-discovery).

## Response Syntax
<a name="API_query_DescribeEndpoints_ResponseSyntax"></a>

```
{
   "Endpoints": [ 
      { 
         "Address": "string",
         "CachePeriodInMinutes": number
      }
   ]
}
```

## Response Elements
<a name="API_query_DescribeEndpoints_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Endpoints](#API_query_DescribeEndpoints_ResponseSyntax) **   <a name="timestream-query_DescribeEndpoints-response-Endpoints"></a>
An `Endpoints` object is returned when a `DescribeEndpoints` request is made.  
Type: Array of [Endpoint](API_query_Endpoint.md) objects

## Errors
<a name="API_query_DescribeEndpoints_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_DescribeEndpoints_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/DescribeEndpoints) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/DescribeEndpoints) 

# DescribeScheduledQuery
<a name="API_query_DescribeScheduledQuery"></a>

Provides detailed information about a scheduled query.

## Request Syntax
<a name="API_query_DescribeScheduledQuery_RequestSyntax"></a>

```
{
   "ScheduledQueryArn": "string"
}
```

## Request Parameters
<a name="API_query_DescribeScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ScheduledQueryArn](#API_query_DescribeScheduledQuery_RequestSyntax) **   <a name="timestream-query_DescribeScheduledQuery-request-ScheduledQueryArn"></a>
The ARN of the scheduled query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

## Response Syntax
<a name="API_query_DescribeScheduledQuery_ResponseSyntax"></a>

```
{
   "ScheduledQuery": { 
      "Arn": "string",
      "CreationTime": number,
      "ErrorReportConfiguration": { 
         "S3Configuration": { 
            "BucketName": "string",
            "EncryptionOption": "string",
            "ObjectKeyPrefix": "string"
         }
      },
      "KmsKeyId": "string",
      "LastRunSummary": { 
         "ErrorReportLocation": { 
            "S3ReportLocation": { 
               "BucketName": "string",
               "ObjectKey": "string"
            }
         },
         "ExecutionStats": { 
            "BytesMetered": number,
            "CumulativeBytesScanned": number,
            "DataWrites": number,
            "ExecutionTimeInMillis": number,
            "QueryResultRows": number,
            "RecordsIngested": number
         },
         "FailureReason": "string",
         "InvocationTime": number,
         "QueryInsightsResponse": { 
            "OutputBytes": number,
            "OutputRows": number,
            "QuerySpatialCoverage": { 
               "Max": { 
                  "PartitionKey": [ "string" ],
                  "TableArn": "string",
                  "Value": number
               }
            },
            "QueryTableCount": number,
            "QueryTemporalRange": { 
               "Max": { 
                  "TableArn": "string",
                  "Value": number
               }
            }
         },
         "RunStatus": "string",
         "TriggerTime": number
      },
      "Name": "string",
      "NextInvocationTime": number,
      "NotificationConfiguration": { 
         "SnsConfiguration": { 
            "TopicArn": "string"
         }
      },
      "PreviousInvocationTime": number,
      "QueryString": "string",
      "RecentlyFailedRuns": [ 
         { 
            "ErrorReportLocation": { 
               "S3ReportLocation": { 
                  "BucketName": "string",
                  "ObjectKey": "string"
               }
            },
            "ExecutionStats": { 
               "BytesMetered": number,
               "CumulativeBytesScanned": number,
               "DataWrites": number,
               "ExecutionTimeInMillis": number,
               "QueryResultRows": number,
               "RecordsIngested": number
            },
            "FailureReason": "string",
            "InvocationTime": number,
            "QueryInsightsResponse": { 
               "OutputBytes": number,
               "OutputRows": number,
               "QuerySpatialCoverage": { 
                  "Max": { 
                     "PartitionKey": [ "string" ],
                     "TableArn": "string",
                     "Value": number
                  }
               },
               "QueryTableCount": number,
               "QueryTemporalRange": { 
                  "Max": { 
                     "TableArn": "string",
                     "Value": number
                  }
               }
            },
            "RunStatus": "string",
            "TriggerTime": number
         }
      ],
      "ScheduleConfiguration": { 
         "ScheduleExpression": "string"
      },
      "ScheduledQueryExecutionRoleArn": "string",
      "State": "string",
      "TargetConfiguration": { 
         "TimestreamConfiguration": { 
            "DatabaseName": "string",
            "DimensionMappings": [ 
               { 
                  "DimensionValueType": "string",
                  "Name": "string"
               }
            ],
            "MeasureNameColumn": "string",
            "MixedMeasureMappings": [ 
               { 
                  "MeasureName": "string",
                  "MeasureValueType": "string",
                  "MultiMeasureAttributeMappings": [ 
                     { 
                        "MeasureValueType": "string",
                        "SourceColumn": "string",
                        "TargetMultiMeasureAttributeName": "string"
                     }
                  ],
                  "SourceColumn": "string",
                  "TargetMeasureName": "string"
               }
            ],
            "MultiMeasureMappings": { 
               "MultiMeasureAttributeMappings": [ 
                  { 
                     "MeasureValueType": "string",
                     "SourceColumn": "string",
                     "TargetMultiMeasureAttributeName": "string"
                  }
               ],
               "TargetMultiMeasureName": "string"
            },
            "TableName": "string",
            "TimeColumn": "string"
         }
      }
   }
}
```

## Response Elements
<a name="API_query_DescribeScheduledQuery_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [ScheduledQuery](#API_query_DescribeScheduledQuery_ResponseSyntax) **   <a name="timestream-query_DescribeScheduledQuery-response-ScheduledQuery"></a>
The scheduled query.  
Type: [ScheduledQueryDescription](API_query_ScheduledQueryDescription.md) object

## Errors
<a name="API_query_DescribeScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The requested resource could not be found.    
 ** ScheduledQueryArn **   
The ARN of the scheduled query.
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_DescribeScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/DescribeScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/DescribeScheduledQuery) 

# ExecuteScheduledQuery
<a name="API_query_ExecuteScheduledQuery"></a>

 You can use this API to run a scheduled query manually. 

If you enabled `QueryInsights`, this API also returns insights and metrics related to the query that you executed as part of an Amazon SNS notification. `QueryInsights` helps with performance tuning of your query. For more information about `QueryInsights`, see [Using query insights to optimize queries in Amazon Timestream](https://docs.aws.amazon.com/timestream/latest/developerguide/using-query-insights.html).

## Request Syntax
<a name="API_query_ExecuteScheduledQuery_RequestSyntax"></a>

```
{
   "ClientToken": "string",
   "InvocationTime": number,
   "QueryInsights": { 
      "Mode": "string"
   },
   "ScheduledQueryArn": "string"
}
```

## Request Parameters
<a name="API_query_ExecuteScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ClientToken](#API_query_ExecuteScheduledQuery_RequestSyntax) **   <a name="timestream-query_ExecuteScheduledQuery-request-ClientToken"></a>
Not used.   
Type: String  
Length Constraints: Minimum length of 32. Maximum length of 128.  
Required: No

 ** [InvocationTime](#API_query_ExecuteScheduledQuery_RequestSyntax) **   <a name="timestream-query_ExecuteScheduledQuery-request-InvocationTime"></a>
The timestamp in UTC. Query will be run as if it was invoked at this timestamp.   
Type: Timestamp  
Required: Yes

 ** [QueryInsights](#API_query_ExecuteScheduledQuery_RequestSyntax) **   <a name="timestream-query_ExecuteScheduledQuery-request-QueryInsights"></a>
Encapsulates settings for enabling `QueryInsights`.  
Enabling `QueryInsights` returns insights and metrics as a part of the Amazon SNS notification for the query that you executed. You can use `QueryInsights` to tune your query performance and cost.  
Type: [ScheduledQueryInsights](API_query_ScheduledQueryInsights.md) object  
Required: No

 ** [ScheduledQueryArn](#API_query_ExecuteScheduledQuery_RequestSyntax) **   <a name="timestream-query_ExecuteScheduledQuery-request-ScheduledQueryArn"></a>
ARN of the scheduled query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

## Response Elements
<a name="API_query_ExecuteScheduledQuery_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

## Errors
<a name="API_query_ExecuteScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The requested resource could not be found.    
 ** ScheduledQueryArn **   
The ARN of the scheduled query.
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## Examples
<a name="API_query_ExecuteScheduledQuery_Examples"></a>

### Scheduled query notification message for the ENABLED\$1WITH\$1RATE\$1CONTROL mode
<a name="API_query_ExecuteScheduledQuery_Example_1"></a>

The following example shows a successful scheduled query notification message for the `ENABLED_WITH_RATE_CONTROL` mode of the `QueryInsights` parameter.

```
"SuccessNotificationMessage": {
    "type": "MANUAL_TRIGGER_SUCCESS",
    "arn": "arn:aws:timestream:<Region>:<Account>:scheduled-query/sq-test-49c6ed55-c2e7-4cc2-9956-4a0ecea13420-80e05b035236a4c3",
    "scheduledQueryRunSummary": {
        "invocationEpochSecond": 1723710546,
        "triggerTimeMillis": 1723710547490,
        "runStatus": "MANUAL_TRIGGER_SUCCESS",
        "executionStats": {
            "executionTimeInMillis": 17343,
            "dataWrites": 1024,
            "bytesMetered": 0,
            "cumulativeBytesScanned": 600,
            "recordsIngested": 1,
            "queryResultRows": 1
        },
        "queryInsightsResponse": {
            "querySpatialCoverage": {
                "max": {
                    "value": 1.0,
                    "tableArn": "arn:aws:timestream:<Region>:<Account>:database/BaseDb/table/BaseTable",
                    "partitionKey": [
                        "measure_name"
                    ]
                }
            },
            "queryTemporalRange": {
                "max": {
                    "value": 2399999999999,
                    "tableArn": "arn:aws:timestream:<Region>:<Account>:database/BaseDb/table/BaseTable"
                }
            },
            "queryTableCount": 1,
            "outputRows": 1,
            "outputBytes": 59
        }
    }
}
```

### Scheduled query notification message for the DISABLED mode
<a name="API_query_ExecuteScheduledQuery_Example_2"></a>

The following example shows a successful scheduled query notification message for the `DISABLED` mode of the `QueryInsights` parameter.

```
"SuccessNotificationMessage": {
    "type": "MANUAL_TRIGGER_SUCCESS",
    "arn": "arn:aws:timestream:<Region>:<Account>:scheduled-query/sq-test-fa109d9e-6528-4a0d-ac40-482fa05e657f-140faaeecdc5b2a7",
    "scheduledQueryRunSummary": {
        "invocationEpochSecond": 1723711401,
        "triggerTimeMillis": 1723711402144,
        "runStatus": "MANUAL_TRIGGER_SUCCESS",
        "executionStats": {
            "executionTimeInMillis": 17992,
            "dataWrites": 1024,
            "bytesMetered": 0,
            "cumulativeBytesScanned": 600,
            "recordsIngested": 1,
            "queryResultRows": 1
        }
    }
}
```

### Failure notification message for the ENABLED\$1WITH\$1RATE\$1CONTROL mode
<a name="API_query_ExecuteScheduledQuery_Example_3"></a>

The following example shows a failed scheduled query notification message for the `ENABLED_WITH_RATE_CONTROL` mode of the `QueryInsights` parameter.

```
"FailureNotificationMessage": {
    "type": "MANUAL_TRIGGER_FAILURE",
    "arn": "arn:aws:timestream:<Region>:<Account>:scheduled-query/sq-test-b261670d-790c-4116-9db5-0798071b18b1-b7e27a1d79be226d",
    "scheduledQueryRunSummary": {
        "invocationEpochSecond": 1727915513,
        "triggerTimeMillis": 1727915513894,
        "runStatus": "MANUAL_TRIGGER_FAILURE",
        "executionStats": {
            "executionTimeInMillis": 10777,
            "dataWrites": 0,
            "bytesMetered": 0,
            "cumulativeBytesScanned": 0,
            "recordsIngested": 0,
            "queryResultRows": 4
        },
        "errorReportLocation": {
            "s3ReportLocation": {
                "bucketName": "amzn-s3-demo-bucket",
                "objectKey": "4my-organization-f7a3c5d065a1a95e/1727915513/MANUAL/1727915513894/5e14b3df-b147-49f4-9331-784f749b68ae"
            }
        },
        "failureReason": "Schedule encountered some errors and is incomplete. Please take a look at error report for further details"
    }
}
```

### Failure notification message for the DISABLED mode
<a name="API_query_ExecuteScheduledQuery_Example_4"></a>

The following example shows a failed scheduled query notification message for the `DISABLED` mode of the `QueryInsights` parameter.

```
"FailureNotificationMessage": {
    "type": "MANUAL_TRIGGER_FAILURE",
    "arn": "arn:aws:timestream:<Region>:<Account>:scheduled-query/sq-test-b261670d-790c-4116-9db5-0798071b18b1-b7e27a1d79be226d",
    "scheduledQueryRunSummary": {
        "invocationEpochSecond": 1727915194,
        "triggerTimeMillis": 1727915195119,
        "runStatus": "MANUAL_TRIGGER_FAILURE",
        "executionStats": {
            "executionTimeInMillis": 10777,
            "dataWrites": 0,
            "bytesMetered": 0,
            "cumulativeBytesScanned": 0,
            "recordsIngested": 0,
            "queryResultRows": 4
        },
        "errorReportLocation": {
            "s3ReportLocation": {
                "bucketName": "amzn-s3-demo-bucket",
                "objectKey": "4my-organization-b7e27a1d79be226d/1727915194/MANUAL/1727915195119/08dea9f5-9a0a-4e63-a5f7-ded23247bb98"
            }
        },
        "failureReason": "Schedule encountered some errors and is incomplete. Please take a look at error report for further details"
    }
}
```

## See Also
<a name="API_query_ExecuteScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/ExecuteScheduledQuery) 

# ListScheduledQueries
<a name="API_query_ListScheduledQueries"></a>

Gets a list of all scheduled queries in the caller's Amazon account and Region. `ListScheduledQueries` is eventually consistent. 

## Request Syntax
<a name="API_query_ListScheduledQueries_RequestSyntax"></a>

```
{
   "MaxResults": number,
   "NextToken": "string"
}
```

## Request Parameters
<a name="API_query_ListScheduledQueries_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [MaxResults](#API_query_ListScheduledQueries_RequestSyntax) **   <a name="timestream-query_ListScheduledQueries-request-MaxResults"></a>
The maximum 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 the argument to the subsequent call to `ListScheduledQueriesRequest`.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [NextToken](#API_query_ListScheduledQueries_RequestSyntax) **   <a name="timestream-query_ListScheduledQueries-request-NextToken"></a>
 A pagination token to resume pagination.  
Type: String  
Required: No

## Response Syntax
<a name="API_query_ListScheduledQueries_ResponseSyntax"></a>

```
{
   "NextToken": "string",
   "ScheduledQueries": [ 
      { 
         "Arn": "string",
         "CreationTime": number,
         "ErrorReportConfiguration": { 
            "S3Configuration": { 
               "BucketName": "string",
               "EncryptionOption": "string",
               "ObjectKeyPrefix": "string"
            }
         },
         "LastRunStatus": "string",
         "Name": "string",
         "NextInvocationTime": number,
         "PreviousInvocationTime": number,
         "State": "string",
         "TargetDestination": { 
            "TimestreamDestination": { 
               "DatabaseName": "string",
               "TableName": "string"
            }
         }
      }
   ]
}
```

## Response Elements
<a name="API_query_ListScheduledQueries_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [NextToken](#API_query_ListScheduledQueries_ResponseSyntax) **   <a name="timestream-query_ListScheduledQueries-response-NextToken"></a>
A token to specify where to start paginating. This is the NextToken from a previously truncated response.  
Type: String

 ** [ScheduledQueries](#API_query_ListScheduledQueries_ResponseSyntax) **   <a name="timestream-query_ListScheduledQueries-response-ScheduledQueries"></a>
A list of scheduled queries.  
Type: Array of [ScheduledQuery](API_query_ScheduledQuery.md) objects

## Errors
<a name="API_query_ListScheduledQueries_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_ListScheduledQueries_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/ListScheduledQueries) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/ListScheduledQueries) 

# ListTagsForResource
<a name="API_query_ListTagsForResource"></a>

List all tags on a Timestream query resource.

## Request Syntax
<a name="API_query_ListTagsForResource_RequestSyntax"></a>

```
{
   "MaxResults": number,
   "NextToken": "string",
   "ResourceARN": "string"
}
```

## Request Parameters
<a name="API_query_ListTagsForResource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [MaxResults](#API_query_ListTagsForResource_RequestSyntax) **   <a name="timestream-query_ListTagsForResource-request-MaxResults"></a>
The maximum number of tags to return.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 200.  
Required: No

 ** [NextToken](#API_query_ListTagsForResource_RequestSyntax) **   <a name="timestream-query_ListTagsForResource-request-NextToken"></a>
A pagination token to resume pagination.  
Type: String  
Required: No

 ** [ResourceARN](#API_query_ListTagsForResource_RequestSyntax) **   <a name="timestream-query_ListTagsForResource-request-ResourceARN"></a>
The Timestream resource with tags to be listed. This value is an Amazon Resource Name (ARN).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

## Response Syntax
<a name="API_query_ListTagsForResource_ResponseSyntax"></a>

```
{
   "NextToken": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Response Elements
<a name="API_query_ListTagsForResource_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [NextToken](#API_query_ListTagsForResource_ResponseSyntax) **   <a name="timestream-query_ListTagsForResource-response-NextToken"></a>
A pagination token to resume pagination with a subsequent call to `ListTagsForResourceResponse`.  
Type: String

 ** [Tags](#API_query_ListTagsForResource_ResponseSyntax) **   <a name="timestream-query_ListTagsForResource-response-Tags"></a>
The tags currently associated with the Timestream resource.   
Type: Array of [Tag](API_query_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.

## Errors
<a name="API_query_ListTagsForResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The requested resource could not be found.    
 ** ScheduledQueryArn **   
The ARN of the scheduled query.
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_ListTagsForResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/ListTagsForResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/ListTagsForResource) 

# PrepareQuery
<a name="API_query_PrepareQuery"></a>

A synchronous operation that allows you to submit a query with parameters to be stored by Timestream for later running. Timestream only supports using this operation with `ValidateOnly` set to `true`. 

## Request Syntax
<a name="API_query_PrepareQuery_RequestSyntax"></a>

```
{
   "QueryString": "string",
   "ValidateOnly": boolean
}
```

## Request Parameters
<a name="API_query_PrepareQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [QueryString](#API_query_PrepareQuery_RequestSyntax) **   <a name="timestream-query_PrepareQuery-request-QueryString"></a>
The Timestream query string that you want to use as a prepared statement. Parameter names can be specified in the query string `@` character followed by an identifier.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 262144.  
Required: Yes

 ** [ValidateOnly](#API_query_PrepareQuery_RequestSyntax) **   <a name="timestream-query_PrepareQuery-request-ValidateOnly"></a>
By setting this value to `true`, Timestream will only validate that the query string is a valid Timestream query, and not store the prepared query for later use.  
Type: Boolean  
Required: No

## Response Syntax
<a name="API_query_PrepareQuery_ResponseSyntax"></a>

```
{
   "Columns": [ 
      { 
         "Aliased": boolean,
         "DatabaseName": "string",
         "Name": "string",
         "TableName": "string",
         "Type": { 
            "ArrayColumnInfo": { 
               "Name": "string",
               "Type": "Type"
            },
            "RowColumnInfo": [ 
               { 
                  "Name": "string",
                  "Type": "Type"
               }
            ],
            "ScalarType": "string",
            "TimeSeriesMeasureValueColumnInfo": { 
               "Name": "string",
               "Type": "Type"
            }
         }
      }
   ],
   "Parameters": [ 
      { 
         "Name": "string",
         "Type": { 
            "ArrayColumnInfo": { 
               "Name": "string",
               "Type": "Type"
            },
            "RowColumnInfo": [ 
               { 
                  "Name": "string",
                  "Type": "Type"
               }
            ],
            "ScalarType": "string",
            "TimeSeriesMeasureValueColumnInfo": { 
               "Name": "string",
               "Type": "Type"
            }
         }
      }
   ],
   "QueryString": "string"
}
```

## Response Elements
<a name="API_query_PrepareQuery_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Columns](#API_query_PrepareQuery_ResponseSyntax) **   <a name="timestream-query_PrepareQuery-response-Columns"></a>
A list of SELECT clause columns of the submitted query string.   
Type: Array of [SelectColumn](API_query_SelectColumn.md) objects

 ** [Parameters](#API_query_PrepareQuery_ResponseSyntax) **   <a name="timestream-query_PrepareQuery-response-Parameters"></a>
A list of parameters used in the submitted query string.   
Type: Array of [ParameterMapping](API_query_ParameterMapping.md) objects

 ** [QueryString](#API_query_PrepareQuery_ResponseSyntax) **   <a name="timestream-query_PrepareQuery-response-QueryString"></a>
The query string that you want prepare.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 262144.

## Errors
<a name="API_query_PrepareQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_PrepareQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/PrepareQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/PrepareQuery) 

# Query
<a name="API_query_Query"></a>

 `Query` is a synchronous operation that enables you to run a query against your Amazon Timestream data.

If you enabled `QueryInsights`, this API also returns insights and metrics related to the query that you executed. `QueryInsights` helps with performance tuning of your query. For more information about `QueryInsights`, see [Using query insights to optimize queries in Amazon Timestream](https://docs.aws.amazon.com/timestream/latest/developerguide/using-query-insights.html).

**Note**  
The maximum number of `Query` API requests you're allowed to make with `QueryInsights` enabled is 1 query per second (QPS). If you exceed this query rate, it might result in throttling.

 `Query` will time out after 60 seconds. You must update the default timeout in the SDK to support a timeout of 60 seconds. See the [code sample](https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.run-query.html) for details. 

Your query request will fail in the following cases:
+  If you submit a `Query` request with the same client token outside of the 5-minute idempotency window. 
+  If you submit a `Query` request with the same client token, but change other parameters, within the 5-minute idempotency window. 
+  If the size of the row (including the query metadata) exceeds 1 MB, then the query will fail with the following error message: 

   `Query aborted as max page response size has been exceeded by the output result row` 
+  If the IAM principal of the query initiator and the result reader are not the same and/or the query initiator and the result reader do not have the same query string in the query requests, the query will fail with an `Invalid pagination token` error. 

## Request Syntax
<a name="API_query_Query_RequestSyntax"></a>

```
{
   "ClientToken": "string",
   "MaxRows": number,
   "NextToken": "string",
   "QueryInsights": { 
      "Mode": "string"
   },
   "QueryString": "string"
}
```

## Request Parameters
<a name="API_query_Query_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ClientToken](#API_query_Query_RequestSyntax) **   <a name="timestream-query_Query-request-ClientToken"></a>
 Unique, case-sensitive string of up to 64 ASCII characters specified when a `Query` request is made. Providing a `ClientToken` makes the call to `Query` *idempotent*. This means that running the same query repeatedly will produce the same result. In other words, making multiple identical `Query` requests has the same effect as making a single request. When using `ClientToken` in a query, note the following:   
+  If the Query API is instantiated without a `ClientToken`, the Query SDK generates a `ClientToken` on your behalf.
+ If the `Query` invocation only contains the `ClientToken` but does not include a `NextToken`, that invocation of `Query` is assumed to be a new query run.
+ If the invocation contains `NextToken`, that particular invocation is assumed to be a subsequent invocation of a prior call to the Query API, and a result set is returned.
+  After 4 hours, any request with the same `ClientToken` is treated as a new request. 
Type: String  
Length Constraints: Minimum length of 32. Maximum length of 128.  
Required: No

 ** [MaxRows](#API_query_Query_RequestSyntax) **   <a name="timestream-query_Query-request-MaxRows"></a>
 The total number of rows to be returned in the `Query` output. The initial run of `Query` with a `MaxRows` value specified will return the result set of the query in two cases:   
+ The size of the result is less than `1MB`.
+ The number of rows in the result set is less than the value of `maxRows`.
Otherwise, the initial invocation of `Query` only returns a `NextToken`, which can then be used in subsequent calls to fetch the result set. To resume pagination, provide the `NextToken` value in the subsequent command.  
If the row size is large (e.g. a row has many columns), Timestream may return fewer rows to keep the response size from exceeding the 1 MB limit. If `MaxRows` is not provided, Timestream will send the necessary number of rows to meet the 1 MB limit.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [NextToken](#API_query_Query_RequestSyntax) **   <a name="timestream-query_Query-request-NextToken"></a>
 A pagination token used to return a set of results. When the `Query` API is invoked using `NextToken`, that particular invocation is assumed to be a subsequent invocation of a prior call to `Query`, and a result set is returned. However, if the `Query` invocation only contains the `ClientToken`, that invocation of `Query` is assumed to be a new query run.   
Note the following when using NextToken in a query:  
+ A pagination token can be used for up to five `Query` invocations, OR for a duration of up to 1 hour – whichever comes first.
+ Using the same `NextToken` will return the same set of records. To keep paginating through the result set, you must to use the most recent `nextToken`.
+ Suppose a `Query` invocation returns two `NextToken` values, `TokenA` and `TokenB`. If `TokenB` is used in a subsequent `Query` invocation, then `TokenA` is invalidated and cannot be reused.
+ To request a previous result set from a query after pagination has begun, you must re-invoke the Query API.
+ The latest `NextToken` should be used to paginate until `null` is returned, at which point a new `NextToken` should be used.
+  If the IAM principal of the query initiator and the result reader are not the same and/or the query initiator and the result reader do not have the same query string in the query requests, the query will fail with an `Invalid pagination token` error. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: No

 ** [QueryInsights](#API_query_Query_RequestSyntax) **   <a name="timestream-query_Query-request-QueryInsights"></a>
Encapsulates settings for enabling `QueryInsights`.  
Enabling `QueryInsights` returns insights and metrics in addition to query results for the query that you executed. You can use `QueryInsights` to tune your query performance.  
Type: [QueryInsights](API_query_QueryInsights.md) object  
Required: No

 ** [QueryString](#API_query_Query_RequestSyntax) **   <a name="timestream-query_Query-request-QueryString"></a>
 The query to be run by Timestream.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 262144.  
Required: Yes

## Response Syntax
<a name="API_query_Query_ResponseSyntax"></a>

```
{
   "ColumnInfo": [ 
      { 
         "Name": "string",
         "Type": { 
            "ArrayColumnInfo": "ColumnInfo",
            "RowColumnInfo": [ 
               "ColumnInfo"
            ],
            "ScalarType": "string",
            "TimeSeriesMeasureValueColumnInfo": "ColumnInfo"
         }
      }
   ],
   "NextToken": "string",
   "QueryId": "string",
   "QueryInsightsResponse": { 
      "OutputBytes": number,
      "OutputRows": number,
      "QuerySpatialCoverage": { 
         "Max": { 
            "PartitionKey": [ "string" ],
            "TableArn": "string",
            "Value": number
         }
      },
      "QueryTableCount": number,
      "QueryTemporalRange": { 
         "Max": { 
            "TableArn": "string",
            "Value": number
         }
      },
      "UnloadPartitionCount": number,
      "UnloadWrittenBytes": number,
      "UnloadWrittenRows": number
   },
   "QueryStatus": { 
      "CumulativeBytesMetered": number,
      "CumulativeBytesScanned": number,
      "ProgressPercentage": number
   },
   "Rows": [ 
      { 
         "Data": [ 
            { 
               "ArrayValue": [ 
                  "Datum"
               ],
               "NullValue": boolean,
               "RowValue": "Row",
               "ScalarValue": "string",
               "TimeSeriesValue": [ 
                  { 
                     "Time": "string",
                     "Value": "Datum"
                  }
               ]
            }
         ]
      }
   ]
}
```

## Response Elements
<a name="API_query_Query_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [ColumnInfo](#API_query_Query_ResponseSyntax) **   <a name="timestream-query_Query-response-ColumnInfo"></a>
 The column data types of the returned result set.   
Type: Array of [ColumnInfo](API_query_ColumnInfo.md) objects

 ** [NextToken](#API_query_Query_ResponseSyntax) **   <a name="timestream-query_Query-response-NextToken"></a>
 A pagination token that can be used again on a `Query` call to get the next set of results.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.

 ** [QueryId](#API_query_Query_ResponseSyntax) **   <a name="timestream-query_Query-response-QueryId"></a>
 A unique ID for the given query.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[a-zA-Z0-9]+` 

 ** [QueryInsightsResponse](#API_query_Query_ResponseSyntax) **   <a name="timestream-query_Query-response-QueryInsightsResponse"></a>
Encapsulates `QueryInsights` containing insights and metrics related to the query that you executed.  
Type: [QueryInsightsResponse](API_query_QueryInsightsResponse.md) object

 ** [QueryStatus](#API_query_Query_ResponseSyntax) **   <a name="timestream-query_Query-response-QueryStatus"></a>
Information about the status of the query, including progress and bytes scanned.  
Type: [QueryStatus](API_query_QueryStatus.md) object

 ** [Rows](#API_query_Query_ResponseSyntax) **   <a name="timestream-query_Query-response-Rows"></a>
 The result set rows returned by the query.   
Type: Array of [Row](API_query_Row.md) objects

## Errors
<a name="API_query_Query_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** ConflictException **   
 Unable to poll results for a cancelled query.   
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** QueryExecutionException **   
 Timestream was unable to run the query successfully.   
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_Query_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/Query) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/Query) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/Query) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/Query) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/Query) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/Query) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/Query) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/Query) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/Query) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/Query) 

# TagResource
<a name="API_query_TagResource"></a>

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. 

## Request Syntax
<a name="API_query_TagResource_RequestSyntax"></a>

```
{
   "ResourceARN": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}
```

## Request Parameters
<a name="API_query_TagResource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ResourceARN](#API_query_TagResource_RequestSyntax) **   <a name="timestream-query_TagResource-request-ResourceARN"></a>
Identifies the Timestream resource to which tags should be added. This value is an Amazon Resource Name (ARN).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

 ** [Tags](#API_query_TagResource_RequestSyntax) **   <a name="timestream-query_TagResource-request-Tags"></a>
The tags to be assigned to the Timestream resource.  
Type: Array of [Tag](API_query_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: Yes

## Response Elements
<a name="API_query_TagResource_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

## Errors
<a name="API_query_TagResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The requested resource could not be found.    
 ** ScheduledQueryArn **   
The ARN of the scheduled query.
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
You have exceeded the service quota.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_TagResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/TagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/TagResource) 

# UntagResource
<a name="API_query_UntagResource"></a>

Removes the association of tags from a Timestream query resource.

## Request Syntax
<a name="API_query_UntagResource_RequestSyntax"></a>

```
{
   "ResourceARN": "string",
   "TagKeys": [ "string" ]
}
```

## Request Parameters
<a name="API_query_UntagResource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ResourceARN](#API_query_UntagResource_RequestSyntax) **   <a name="timestream-query_UntagResource-request-ResourceARN"></a>
The Timestream resource that the tags will be removed from. This value is an Amazon Resource Name (ARN).   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

 ** [TagKeys](#API_query_UntagResource_RequestSyntax) **   <a name="timestream-query_UntagResource-request-TagKeys"></a>
A list of tags keys. Existing tags of the resource whose keys are members of this list will be removed from the Timestream resource.   
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Required: Yes

## Response Elements
<a name="API_query_UntagResource_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

## Errors
<a name="API_query_UntagResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The requested resource could not be found.    
 ** ScheduledQueryArn **   
The ARN of the scheduled query.
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_UntagResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/UntagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/UntagResource) 

# UpdateAccountSettings
<a name="API_query_UpdateAccountSettings"></a>

Transitions your account to use TCUs for query pricing and modifies the maximum query compute units that you've configured. If you reduce the value of `MaxQueryTCU` to a desired configuration, the new value can take up to 24 hours to be effective.

**Note**  
After you've transitioned your account to use TCUs for query pricing, you can't transition to using bytes scanned for query pricing.

## Request Syntax
<a name="API_query_UpdateAccountSettings_RequestSyntax"></a>

```
{
   "MaxQueryTCU": number,
   "QueryCompute": { 
      "ComputeMode": "string",
      "ProvisionedCapacity": { 
         "NotificationConfiguration": { 
            "RoleArn": "string",
            "SnsConfiguration": { 
               "TopicArn": "string"
            }
         },
         "TargetQueryTCU": number
      }
   },
   "QueryPricingModel": "string"
}
```

## Request Parameters
<a name="API_query_UpdateAccountSettings_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [MaxQueryTCU](#API_query_UpdateAccountSettings_RequestSyntax) **   <a name="timestream-query_UpdateAccountSettings-request-MaxQueryTCU"></a>
The maximum number of compute units the service will use at any point in time to serve your queries. To run queries, you must set a minimum capacity of 4 TCU. You can set the maximum number of TCU in multiples of 4, for example, 4, 8, 16, 32, and so on. The maximum value supported for `MaxQueryTCU` is 1000. To request an increase to this soft limit, contact AWS Support. For information about the default quota for maxQueryTCU, see Default quotas. This configuration is applicable only for on-demand usage of Timestream Compute Units (TCUs).  
The maximum value supported for `MaxQueryTCU` is 1000. To request an increase to this soft limit, contact AWS Support. For information about the default quota for `maxQueryTCU`, see [Default quotas](https://docs.aws.amazon.com/timestream/latest/developerguide/ts-limits.html#limits.default).  
Type: Integer  
Required: No

 ** [QueryCompute](#API_query_UpdateAccountSettings_RequestSyntax) **   <a name="timestream-query_UpdateAccountSettings-request-QueryCompute"></a>
Modifies the query compute settings configured in your account, including the query pricing model and provisioned Timestream Compute Units (TCUs) in your account. QueryCompute is available only in the Asia Pacific (Mumbai) region.  
This API is idempotent, meaning that making the same request multiple times will have the same effect as making the request once.
Type: [QueryComputeRequest](API_query_QueryComputeRequest.md) object  
Required: No

 ** [QueryPricingModel](#API_query_UpdateAccountSettings_RequestSyntax) **   <a name="timestream-query_UpdateAccountSettings-request-QueryPricingModel"></a>
The pricing model for queries in an account.  
The `QueryPricingModel` parameter is used by several Timestream operations; however, the `UpdateAccountSettings` API operation doesn't recognize any values other than `COMPUTE_UNITS`.
Type: String  
Valid Values: `BYTES_SCANNED | COMPUTE_UNITS`   
Required: No

## Response Syntax
<a name="API_query_UpdateAccountSettings_ResponseSyntax"></a>

```
{
   "MaxQueryTCU": number,
   "QueryCompute": { 
      "ComputeMode": "string",
      "ProvisionedCapacity": { 
         "ActiveQueryTCU": number,
         "LastUpdate": { 
            "Status": "string",
            "StatusMessage": "string",
            "TargetQueryTCU": number
         },
         "NotificationConfiguration": { 
            "RoleArn": "string",
            "SnsConfiguration": { 
               "TopicArn": "string"
            }
         }
      }
   },
   "QueryPricingModel": "string"
}
```

## Response Elements
<a name="API_query_UpdateAccountSettings_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [MaxQueryTCU](#API_query_UpdateAccountSettings_ResponseSyntax) **   <a name="timestream-query_UpdateAccountSettings-response-MaxQueryTCU"></a>
The configured maximum number of compute units the service will use at any point in time to serve your queries.  
Type: Integer

 ** [QueryCompute](#API_query_UpdateAccountSettings_ResponseSyntax) **   <a name="timestream-query_UpdateAccountSettings-response-QueryCompute"></a>
Confirms the updated account settings for querying data in your account. QueryCompute is available only in the Asia Pacific (Mumbai) region.  
Type: [QueryComputeResponse](API_query_QueryComputeResponse.md) object

 ** [QueryPricingModel](#API_query_UpdateAccountSettings_ResponseSyntax) **   <a name="timestream-query_UpdateAccountSettings-response-QueryPricingModel"></a>
The pricing model for an account.  
Type: String  
Valid Values: `BYTES_SCANNED | COMPUTE_UNITS` 

## Errors
<a name="API_query_UpdateAccountSettings_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_UpdateAccountSettings_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/UpdateAccountSettings) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/UpdateAccountSettings) 

# UpdateScheduledQuery
<a name="API_query_UpdateScheduledQuery"></a>

Update a scheduled query.

## Request Syntax
<a name="API_query_UpdateScheduledQuery_RequestSyntax"></a>

```
{
   "ScheduledQueryArn": "string",
   "State": "string"
}
```

## Request Parameters
<a name="API_query_UpdateScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ScheduledQueryArn](#API_query_UpdateScheduledQuery_RequestSyntax) **   <a name="timestream-query_UpdateScheduledQuery-request-ScheduledQueryArn"></a>
ARN of the scheuled query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

 ** [State](#API_query_UpdateScheduledQuery_RequestSyntax) **   <a name="timestream-query_UpdateScheduledQuery-request-State"></a>
State of the scheduled query.   
Type: String  
Valid Values: `ENABLED | DISABLED`   
Required: Yes

## Response Elements
<a name="API_query_UpdateScheduledQuery_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

## Errors
<a name="API_query_UpdateScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have the necessary permissions to access the account settings.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request.  
HTTP Status Code: 400

 ** InvalidEndpointException **   
The requested endpoint is invalid.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The requested resource could not be found.    
 ** ScheduledQueryArn **   
The ARN of the scheduled query.
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled due to excessive requests.  
HTTP Status Code: 400

 ** ValidationException **   
 Invalid or malformed request.   
HTTP Status Code: 400

## See Also
<a name="API_query_UpdateScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/timestream-query-2018-11-01/UpdateScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/timestream-query-2018-11-01/UpdateScheduledQuery) 