

 Amazon Forecast 不再提供給新客戶。Amazon Forecast 的現有客戶可以繼續正常使用服務。[進一步了解」](https://aws.amazon.com/blogs/machine-learning/transition-your-amazon-forecast-usage-to-amazon-sagemaker-canvas/)

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# CreateWhatIfForecastExport
<a name="API_CreateWhatIfForecastExport"></a>

將 [CreateWhatIfForecast](API_CreateWhatIfForecast.md)操作建立的預測匯出至 Amazon Simple Storage Service (Amazon S3) 儲存貯體。預測檔案名稱將符合下列慣例：

 `≈<ForecastExportJobName>_<ExportTimestamp>_<PartNumber>` 

<ExportTimestamp> 元件位於 Java SimpleDateFormat (yyyy-MM-ddTHH-mm-ssZ) 中。

**重要**  
Amazon Forecast 不再提供給新客戶。Amazon Forecast 的現有客戶可以繼續正常使用服務。[進一步了解」](https://aws.amazon.com/blogs/machine-learning/transition-your-amazon-forecast-usage-to-amazon-sagemaker-canvas/) 

您必須指定包含 (IAM) 角色的[DataDestination](API_DataDestination.md) AWS Identity and Access Management 物件，Amazon Forecast 可以擔任該角色來存取 Amazon S3 儲存貯體。如需詳細資訊，請參閱[設定 Amazon Forecast 的許可](aws-forecast-iam-roles.md)。

如需詳細資訊，請參閱[產生預測](howitworks-forecast.md)。

若要取得所有預測匯出任務的清單，請使用 [ListWhatIfForecastExports](API_ListWhatIfForecastExports.md)操作。

**注意**  
預測匯出任務`Status`的 必須是 `ACTIVE`，您才能存取 Amazon S3 儲存貯體中的預測。若要取得 狀態，請使用 [DescribeWhatIfForecastExport](API_DescribeWhatIfForecastExport.md)操作。

## 請求語法
<a name="API_CreateWhatIfForecastExport_RequestSyntax"></a>

```
{
   "Destination": { 
      "S3Config": { 
         "KMSKeyArn": "string",
         "Path": "string",
         "RoleArn": "string"
      }
   },
   "Format": "string",
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ],
   "WhatIfForecastArns": [ "string" ],
   "WhatIfForecastExportName": "string"
}
```

## 請求參數
<a name="API_CreateWhatIfForecastExport_RequestParameters"></a>

請求接受採用 JSON 格式的下列資料。

 ** [Destination](#API_CreateWhatIfForecastExport_RequestSyntax) **   <a name="forecast-CreateWhatIfForecastExport-request-Destination"></a>
您要儲存預測的位置，以及 Amazon Forecast 可以擔任以存取該位置的 AWS Identity and Access Management (IAM) 角色。預測必須匯出至 Amazon S3 儲存貯體。  
如果使用加密， `Destination` 必須包含 AWS Key Management Service (KMS) 金鑰。IAM 角色必須允許 Amazon Forecast 許可存取金鑰。  
類型：[DataDestination](API_DataDestination.md) 物件  
必要：是

 ** [Format](#API_CreateWhatIfForecastExport_RequestSyntax) **   <a name="forecast-CreateWhatIfForecastExport-request-Format"></a>
匯出資料的格式，CSV 或 PARQUET。  
類型：字串  
長度限制：長度上限為 7。  
模式：`^CSV|PARQUET$`  
必要：否

 ** [Tags](#API_CreateWhatIfForecastExport_RequestSyntax) **   <a name="forecast-CreateWhatIfForecastExport-request-Tags"></a>
要套用至預測內容的[標籤](https://docs.aws.amazon.com/forecast/latest/dg/tagging-forecast-resources.html)清單。  
類型：[Tag](API_Tag.md) 物件陣列  
陣列成員：項目數下限為 0。項目數上限為 200。  
必要：否

 ** [WhatIfForecastArns](#API_CreateWhatIfForecastExport_RequestSyntax) **   <a name="forecast-CreateWhatIfForecastExport-request-WhatIfForecastArns"></a>
要匯出的預測 Amazon Resource Name (ARNs清單。  
類型：字串陣列  
陣列成員：項目數下限為 1。項目數上限為 50。  
長度限制：長度上限為 300。  
模式：`arn:([a-z\d-]+):forecast:.*:.*:.+`  
必要：是

 ** [WhatIfForecastExportName](#API_CreateWhatIfForecastExport_RequestSyntax) **   <a name="forecast-CreateWhatIfForecastExport-request-WhatIfForecastExportName"></a>
要匯出之假設預測的名稱。  
類型：字串  
長度限制：長度下限為 1。長度上限為 63。  
模式：`^[a-zA-Z][a-zA-Z0-9_]*`  
必要：是

## 回應語法
<a name="API_CreateWhatIfForecastExport_ResponseSyntax"></a>

```
{
   "WhatIfForecastExportArn": "string"
}
```

## 回應元素
<a name="API_CreateWhatIfForecastExport_ResponseElements"></a>

如果動作成功，則服務傳回 HTTP 200 回應。

服務會傳回下列 JSON 格式的資料。

 ** [WhatIfForecastExportArn](#API_CreateWhatIfForecastExport_ResponseSyntax) **   <a name="forecast-CreateWhatIfForecastExport-response-WhatIfForecastExportArn"></a>
假設預測的 Amazon Resource Name (ARN)。  
類型：字串  
長度限制：長度上限為 300。  
模式：`arn:([a-z\d-]+):forecast:.*:.*:.+`

## 錯誤
<a name="API_CreateWhatIfForecastExport_Errors"></a>

 ** InvalidInputException **   
我們無法處理請求，因為它包含無效的值或超過有效範圍的值。  
HTTP 狀態碼：400

 ** LimitExceededException **   
已超過每個帳戶的資源數量限制。  
HTTP 狀態碼：400

 ** ResourceAlreadyExistsException **   
已有具有此名稱的資源。請用不同的名稱再試一次。  
HTTP 狀態碼：400

 ** ResourceInUseException **   
指定的資源正在使用中。  
HTTP 狀態碼：400

 ** ResourceNotFoundException **   
我們找不到具有該 Amazon Resource Name (ARN) 的資源。請檢查 ARN，然後再試一次。  
HTTP 狀態碼：400

## 另請參閱
<a name="API_CreateWhatIfForecastExport_SeeAlso"></a>

如需在其中一種語言特定 AWS SDKs中使用此 API 的詳細資訊，請參閱下列內容：
+  [AWS 命令列界面 V2](https://docs.aws.amazon.com/goto/cli2/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 .NET V4 的 SDK](https://docs.aws.amazon.com/goto/DotNetSDKV4/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 C\$1\$1 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 Go 的 SDK v2](https://docs.aws.amazon.com/goto/SdkForGoV2/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 Java V2 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaV2/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 JavaScript V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 Kotlin 的 SDK](https://docs.aws.amazon.com/goto/SdkForKotlin/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 PHP V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForPHPV3/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 Python 的 SDK](https://docs.aws.amazon.com/goto/boto3/forecast-2018-06-26/CreateWhatIfForecastExport) 
+  [AWS 適用於 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/forecast-2018-06-26/CreateWhatIfForecastExport) 