

Amazon Timestream for LiveAnalytics와 유사한 기능을 원하는 경우 Amazon Timestream for InfluxDB를 고려해 보세요. 간소화된 데이터 수집과 실시간 분석을 위한 10밀리초 미만의 쿼리 응답 시간을 제공합니다. [여기](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"
    }
}
```

### 비활성화 모드에 대한 실패 알림 메시지
<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
+  [AWS 명령줄 인터페이스 V2](https://docs.aws.amazon.com/goto/cli2/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS .NET V4용 SDK](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 Go용 SDK v2](https://docs.aws.amazon.com/goto/SdkForGoV2/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS Java V2용 SDK](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 PHP V3용 SDK](https://docs.aws.amazon.com/goto/SdkForPHPV3/timestream-query-2018-11-01/ExecuteScheduledQuery) 
+  [AWS Python용 SDK](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) 