Amazon Forecast
Developer Guide

This is prerelease documentation for a service in preview release. It is subject to change.

CreateDatasetImportJob

Imports your training data to an Amazon Forecast dataset. In the request, you provide the location of the Amazon Simple Storage Service (Amazon S3) bucket that contains your training data and the name of the Amazon Forecast dataset that you want to import the data to.

When Amazon Forecast uploads your training data, it verifies that the data was collected at the DataFrequency specified when the target dataset was created. For more information, see CreateDataset.

A dataset can contain multiple versions of training data. To import an updated version of your data, you can explicitly call the CreateDatasetImportJob operation or schedule imports by specifying a ScheduleExpression in the CreateDatasetImportJob request. Each import operation results in a new dataset version. After creating the import job, you can add, update, or cancel the schedule with the UpdateDatasetImportJob operation.

You can delete a specific dataset version using the DeleteDatasetImport operation or all versions using the DeleteDataset operation.

To get the status of a dataset import job, use the DescribeDatasetImportJob operation. For more information about using datasets, see Datasets.

Request Syntax

{ "DatasetGroupName": "string", "DatasetName": "string", "Delimiter": "string", "S3Uri": "string", "ScheduleExpression": "string" }

Request Parameters

The request accepts the following data in JSON format.

DatasetGroupName

The name of the dataset group containing the dataset.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_]+$

Required: Yes

DatasetName

The name of the Amazon Forecast dataset that you want to import data to.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_]+$

Required: Yes

Delimiter

The delimiter that separates the data elements in the input data. For example, a comma (,) or a pipe (|).

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_\*\?\,\|\^\-\/\#\s\(\)\+\\\\]+$

Required: Yes

S3Uri

The path to the Amazon S3 bucket where the data that you want to import to your dataset is stored. For example:

s3://bucket-name/example-object.csv

Type: String

Length Constraints: Maximum length of 1024.

Pattern: ^[a-zA-Z0-9\-\_\.\/\:]+$

Required: Yes

ScheduleExpression

The optional schedule for automatically importing training data. Specify the schedule as an Amazon CloudWatch cron expression. For more information, see Cron Expressions in the Amazon CloudWatch User Guide.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_\*\?\,\|\^\-\/\#\s\(\)\+]+$

Required: No

Response Syntax

{ "DatasetArn": "string", "DatasetName": "string", "VersionId": "string" }

Response Elements

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

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

DatasetArn

The Amazon Resource Name (ARN) of the dataset.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\-\_\.\/\:]+$

DatasetName

The dataset name.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_]+$

VersionId

The version ID of the data imported to the dataset. A dataset can contain multiple versions of training data. Every time you call the CreateDatasetImportJob operation, Amazon Forecast imports source data and returns a new version ID.

Type: String

Length Constraints: Maximum length of 256.

Pattern: ^[a-zA-Z0-9\_]+$

Errors

InternalServiceException

Request processing has failed due to some unknown error, exception, or failure.

HTTP Status Code: 400

InvalidInputException

We can't process the request because it includes an invalid value or a value that exceeds the valid range.

HTTP Status Code: 400

InvalidStateException

Processing has reached an invalid state. Amazon Forecast returns this exception when an operation attempts to perform an action on a resource that is changing.

HTTP Status Code: 400

QuotaLimitExceededException

You have exceeded the quota limits for resources that are long-running jobs, such as import jobs, create predictors, and forecasts. You might also be creating too many resources concurrently, in which case, you might wait for resources to be created and try again.

HTTP Status Code: 400

ResourceAlreadyExistsException

There is already a resource with this name and characteristics. Try again with different settings.

HTTP Status Code: 400

ResourceNotFoundException

We can't find a resource with that name. Check the name and try again.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: