CreateDataRepositoryTask - Amazon FSx

CreateDataRepositoryTask

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

{ "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.

ClientRequestToken

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

Type: String

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

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

Required: No

FileSystemId

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

Paths

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

Report

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

Tags

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

Type

Specifies the type of data repository task to create.

Type: String

Valid Values: EXPORT_TO_REPOSITORY | IMPORT_METADATA_FROM_REPOSITORY

Required: Yes

Response Syntax

{ "DataRepositoryTask": { "CreationTime": number, "EndTime": number, "FailureDetails": { "Message": "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, "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.

DataRepositoryTask

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

Type: DataRepositoryTask object

Errors

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

BadRequest

A generic error indicating a failure with a client request.

HTTP Status Code: 400

DataRepositoryTaskExecuting

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

FileSystemNotFound

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

HTTP Status Code: 400

IncompatibleParameterError

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

InternalServerError

A generic error indicating a server-side failure.

HTTP Status Code: 500

ServiceLimitExceeded

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

HTTP Status Code: 400

UnsupportedOperation

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

HTTP Status Code: 400

Examples

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: fsx.us-east-1.amazonaws.com 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 AWS SDKs, see the following: