CreateDataRepositoryTask - Amazon FSx
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Creates an Amazon FSx for Lustre data repository task. You use data repository tasks to perform bulk operations between your Amazon FSx file system and its linked data repositories. An example of a data repository task is exporting any data and metadata changes, including POSIX metadata, to files, directories, and symbolic links (symlinks) from your FSx file system to a linked data repository. A CreateDataRepositoryTask operation will fail if a data repository is not linked to the FSx file system. To learn more about data repository tasks, see Data Repository Tasks. To learn more about linking a data repository to your file system, see Linking your file system to an S3 bucket.

Request Syntax

{ "CapacityToRelease": number, "ClientRequestToken": "string", "FileSystemId": "string", "Paths": [ "string" ], "Report": { "Enabled": boolean, "Format": "string", "Path": "string", "Scope": "string" }, "Tags": [ { "Key": "string", "Value": "string" } ], "Type": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


Specifies the amount of data to release, in GiB, by an Amazon File Cache AUTO_RELEASE_DATA task that automatically releases files from the cache.

Type: Long

Valid Range: Minimum value of 1. Maximum value of 2147483647.

Required: No


(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Amazon Command Line Interface (Amazon CLI) or an Amazon SDK.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 63.

Pattern: [A-za-z0-9_.-]{0,63}$

Required: No


The globally unique ID of the file system, assigned by Amazon FSx.

Type: String

Length Constraints: Minimum length of 11. Maximum length of 21.

Pattern: ^(fs-[0-9a-f]{8,})$

Required: Yes


A list of paths for the data repository task to use when the task is processed. If a path that you provide isn't valid, the task fails.

  • For export tasks, the list contains paths on the Amazon FSx file system from which the files are exported to the Amazon S3 bucket. The default path is the file system root directory. The paths you provide need to be relative to the mount point of the file system. If the mount point is /mnt/fsx and /mnt/fsx/path1 is a directory or file on the file system you want to export, then the path to provide is path1.

  • For import tasks, the list contains paths in the Amazon S3 bucket from which POSIX metadata changes are imported to the Amazon FSx file system. The path can be an S3 bucket or prefix in the format s3://myBucket/myPrefix (where myPrefix is optional).

Type: Array of strings

Array Members: Maximum number of 100 items.

Length Constraints: Minimum length of 0. Maximum length of 4096.

Pattern: ^[^\u0000\u0085\u2028\u2029\r\n]{0,4096}$

Required: No


Defines whether or not Amazon FSx provides a CompletionReport once the task has completed. A CompletionReport provides a detailed report on the files that Amazon FSx processed that meet the criteria specified by the Scope parameter. For more information, see Working with Task Completion Reports.

Type: CompletionReport object

Required: Yes


A list of Tag values, with a maximum of 50 elements.

Type: Array of Tag objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: No


Specifies the type of data repository task to create.

Type: String


Required: Yes

Response Syntax

{ "DataRepositoryTask": { "CapacityToRelease": number, "CreationTime": number, "EndTime": number, "FailureDetails": { "Message": "string" }, "FileCacheId": "string", "FileSystemId": "string", "Lifecycle": "string", "Paths": [ "string" ], "Report": { "Enabled": boolean, "Format": "string", "Path": "string", "Scope": "string" }, "ResourceARN": "string", "StartTime": number, "Status": { "FailedCount": number, "LastUpdatedTime": number, "ReleasedCapacity": number, "SucceededCount": number, "TotalCount": number }, "Tags": [ { "Key": "string", "Value": "string" } ], "TaskId": "string", "Type": "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.


The description of the data repository task that you just created.

Type: DataRepositoryTask object


For information about the errors that are common to all actions, see Common Errors.


A generic error indicating a failure with a client request.

HTTP Status Code: 400


An existing data repository task is currently executing on the file system. Wait until the existing task has completed, then create the new task.

HTTP Status Code: 400


No Amazon FSx file systems were found based upon supplied parameters.

HTTP Status Code: 400


The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.

HTTP Status Code: 400


A generic error indicating a server-side failure.

HTTP Status Code: 500


An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.

HTTP Status Code: 400


The requested operation is not supported for this resource or API.

HTTP Status Code: 400


Create a Data Repository Task

The following request creates an EXPORT_TO_REPOSITORY data repository task for the specified file system.

Sample Request

POST /2015-02-01/create-data-repository-task HTTP/1.1 Host: x-amz-date: 20140620T221118Z Authorization: <...> Content-Type: application/json Content-Length: 160 { "FileSystemId": "fs-0123456789abcdef0", "Type": "EXPORT_TO_REPOSITORY", "Paths": ["path1", "path2/file1"], "Report": { "Enabled":true, "Path":"s3://myBucket/FSxLustre20191118T225838Z/myreports", "Format":"REPORT_CSV_20191124", "Scope":"FAILED_FILES_ONLY" }, }

Sample Response

HTTP/1.1 200 success x-amzn-RequestId: c3616af3-33fa-40ad-ae0d-d3895a2c3a1f { "Task": { "TaskId": "task-0123456789abcdef1", "TaskType": "EXPORT_TO_REPOSITORY", "Lifecycle": "PENDING", "FileSystemId": "fs-0123456789abcdef0", "Paths": ["path1", "path2/file1"], "TaskReport": { "Path":"s3://myBucket/FSxLustre20191118T225838Z/myreports", "Format":"REPORT_CSV_20191124", "Enabled":true, "Scope":"FAILED_FILES_ONLY" }, "Tags": [], "CreationTime": "2018-12-17T18:18:18.000Z", "ClientRequestToken": "10192019-drt-12", "ResourceARN": "arn:aws:fsx:us-east-1:123456789012:task:task-123f8cd8e330c1321" } }

See Also

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