

Amazon Timestream for LiveAnalytics に類似した機能をご希望の場合は Amazon Timestream for InfluxDB をご検討ください。リアルタイム分析に適した、シンプルなデータインジェストと 1 桁ミリ秒のクエリ応答時間を特徴としています。詳細については、[こちら](https://docs.aws.amazon.com//timestream/latest/developerguide/timestream-for-influxdb.html)を参照してください。

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

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

 この API を使用して、スケジュールされたクエリを手動で実行できます。

`QueryInsights` を有効にした場合、この API は Amazon SNS 通知の一部として、実行したクエリに関連するインサイトとメトリクスも返します。`QueryInsights` はクエリのパフォーマンスチューニングに役立ちます。`QueryInsights` の詳細については、「[クエリインサイトを使用して Amazon Timestream のクエリを最適化する](https://docs.aws.amazon.com/timestream/latest/developerguide/using-query-insights.html)」を参照してください。

## リクエストの構文
<a name="API_query_ExecuteScheduledQuery_RequestSyntax"></a>

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

## リクエストパラメーター
<a name="API_query_ExecuteScheduledQuery_RequestParameters"></a>

すべてのアクションに共通のパラメータの詳細については、「[共通パラメータ](CommonParameters.md)」を参照してください。

リクエストは以下のデータを JSON 形式で受け入れます。

 ** [ClientToken](#API_query_ExecuteScheduledQuery_RequestSyntax) **   <a name="timestream-query_ExecuteScheduledQuery-request-ClientToken"></a>
使用されていません。  
タイプ: 文字列  
長さの制限: 最小長 32。最大長は 128 です。  
必須: いいえ

 ** [InvocationTime](#API_query_ExecuteScheduledQuery_RequestSyntax) **   <a name="timestream-query_ExecuteScheduledQuery-request-InvocationTime"></a>
UTC のタイムスタンプ。クエリは、このタイムスタンプで呼び出されたものとして実行されます。  
タイプ: タイムスタンプ  
必須: はい

 ** [QueryInsights](#API_query_ExecuteScheduledQuery_RequestSyntax) **   <a name="timestream-query_ExecuteScheduledQuery-request-QueryInsights"></a>
`QueryInsights` を有効にするための設定をカプセル化します。  
`QueryInsights` を有効にすると、実行したクエリの Amazon SNS 通知の一部としてインサイトとメトリクスが返されます。`QueryInsights` を使用して、クエリのパフォーマンスとコストをチューニングできます。  
型: [ScheduledQueryInsights](API_query_ScheduledQueryInsights.md) オブジェクト  
必須: いいえ

 ** [ScheduledQueryArn](#API_query_ExecuteScheduledQuery_RequestSyntax) **   <a name="timestream-query_ExecuteScheduledQuery-request-ScheduledQueryArn"></a>
スケジュールされたクエリの ARN。  
タイプ: 文字列  
長さの制約: 最小長は 1 です。最大長は 2,048 です。  
必須: はい

## レスポンス要素
<a name="API_query_ExecuteScheduledQuery_ResponseElements"></a>

アクションが成功した場合、サービスは空の HTTP 本文を持つ HTTP 200 レスポンスを返します。

## エラー
<a name="API_query_ExecuteScheduledQuery_Errors"></a>

すべてのアクションに共通のエラーについては、「[共通エラー](CommonErrors.md)」を参照してください。

 ** AccessDeniedException **   
アカウント設定にアクセスするために必要なアクセス許可がありません。  
HTTP ステータスコード: 400

 ** InternalServerException **   
リクエストの処理中に内部サーバーエラーが発生しました。  
HTTP ステータスコード: 400

 ** InvalidEndpointException **   
リクエストされたエンドポイントが無効です。  
HTTP ステータスコード: 400

 ** ResourceNotFoundException **   
リクエストされたリソースが見つかりませんでした。    
 ** ScheduledQueryArn **   
スケジュールされたクエリの ARN。
HTTP ステータスコード: 400

 ** ThrottlingException **   
リクエストが多すぎるため、リクエストがスロットリングされました。  
HTTP ステータスコード: 400

 ** ValidationException **   
 リクエストが無効であるか、形式が正しくありません。  
HTTP ステータスコード: 400

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

### ENABLED\$1WITH\$1RATE\$1CONTROL モードのスケジュールされたクエリ通知メッセージ
<a name="API_query_ExecuteScheduledQuery_Example_1"></a>

次の例は、`QueryInsights` パラメータの `ENABLED_WITH_RATE_CONTROL` モードのスケジュールされたクエリ通知メッセージの成功を示しています。

```
"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
        }
    }
}
```

### DISABLED モードのスケジュールされたクエリ通知メッセージ
<a name="API_query_ExecuteScheduledQuery_Example_2"></a>

次の例は、`QueryInsights` パラメータの `DISABLED` モードのスケジュールされたクエリ通知メッセージの成功を示しています。

```
"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
        }
    }
}
```

### ENABLED\$1WITH\$1RATE\$1CONTROL モードの失敗通知メッセージ
<a name="API_query_ExecuteScheduledQuery_Example_3"></a>

次の例は、`QueryInsights` パラメータの `ENABLED_WITH_RATE_CONTROL` モードのスケジュールされたクエリ通知メッセージの失敗を示しています。

```
"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"
    }
}
```

### DISABLED モードの失敗通知メッセージ
<a name="API_query_ExecuteScheduledQuery_Example_4"></a>

次の例は、`QueryInsights` パラメータの `DISABLED` モードのスケジュールされたクエリ通知メッセージの失敗を示しています。

```
"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"
    }
}
```

## 以下の資料も参照してください。
<a name="API_query_ExecuteScheduledQuery_SeeAlso"></a>

言語固有の AWS SDKs のいずれかでこの API を使用する方法の詳細については、以下を参照してください。
+  [AWS コマンドラインインターフェイス 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) 