- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ExecuteScheduledQueryCommand
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 .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { TimestreamQueryClient, ExecuteScheduledQueryCommand } from "@aws-sdk/client-timestream-query"; // ES Modules import
// const { TimestreamQueryClient, ExecuteScheduledQueryCommand } = require("@aws-sdk/client-timestream-query"); // CommonJS import
const client = new TimestreamQueryClient(config);
const input = { // ExecuteScheduledQueryRequest
ScheduledQueryArn: "STRING_VALUE", // required
InvocationTime: new Date("TIMESTAMP"), // required
ClientToken: "STRING_VALUE",
QueryInsights: { // ScheduledQueryInsights
Mode: "ENABLED_WITH_RATE_CONTROL" || "DISABLED", // required
},
};
const command = new ExecuteScheduledQueryCommand(input);
const response = await client.send(command);
// {};
ExecuteScheduledQueryCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
InvocationTime Required | Date | undefined | The timestamp in UTC. Query will be run as if it was invoked at this timestamp. |
ScheduledQueryArn Required | string | undefined | ARN of the scheduled query. |
ClientToken | string | undefined | Not used. |
QueryInsights | ScheduledQueryInsights | undefined | Encapsulates settings for enabling Enabling |
ExecuteScheduledQueryCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have the necessary permissions to access the account settings. |
InternalServerException | server | An internal server error occurred while processing the request. |
InvalidEndpointException | client | The requested endpoint is invalid. |
ResourceNotFoundException | client | The requested resource could not be found. |
ThrottlingException | client | The request was throttled due to excessive requests. |
ValidationException | client | Invalid or malformed request. |
TimestreamQueryServiceException | Base exception class for all service exceptions from TimestreamQuery service. |