CreateDataRepositoryTask - Amazon FSx

CreateDataRepositoryTask

Creates an Amazon FSx for Lustre data repository task. A CreateDataRepositoryTask operation will fail if a data repository is not linked to the FSx file system.

You use import and export data repository tasks to perform bulk operations between your FSx for Lustre 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.

You use release data repository tasks to release data from your file system for files that are exported to S3. The metadata of released files remains on the file system so users or applications can still access released files by reading the files again, which will restore data from Amazon S3 to the FSx for Lustre 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" ], "ReleaseConfiguration": { "DurationSinceLastAccess": { "Unit": "string", "Value": number } }, "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.

CapacityToRelease

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

ClientRequestToken

(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 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. If you don't provide paths, the default behavior is to export all files to S3 (for export tasks), import all files from S3 (for import tasks), or release all exported files that meet the last accessed time criteria (for release tasks).

  • For export tasks, the list contains paths on the FSx for Lustre 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 FSx for Lustre file system. The path can be an S3 bucket or prefix in the format s3://bucket-name/prefix (where prefix is optional).

  • For release tasks, the list contains directory or file paths on the FSx for Lustre file system from which to release exported files. If a directory is specified, files within the directory are released. If a file path is specified, only that file is released. To release all exported files in the file system, specify a forward slash (/) as the path.

    Note

    A file must also meet the last accessed time criteria specified in ReleaseConfiguration for the file to be released.

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

ReleaseConfiguration

The configuration that specifies the last accessed time criteria for files that will be released from an Amazon FSx for Lustre file system.

Type: ReleaseConfiguration object

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.

  • EXPORT_TO_REPOSITORY tasks export from your Amazon FSx for Lustre file system to a linked data repository.

  • IMPORT_METADATA_FROM_REPOSITORY tasks import metadata changes from a linked S3 bucket to your Amazon FSx for Lustre file system.

  • RELEASE_DATA_FROM_FILESYSTEM tasks release files in your Amazon FSx for Lustre file system that have been exported to a linked S3 bucket and that meet your specified release criteria.

  • AUTO_RELEASE_DATA tasks automatically release files from an Amazon File Cache resource.

Type: String

Valid Values: EXPORT_TO_REPOSITORY | IMPORT_METADATA_FROM_REPOSITORY | RELEASE_DATA_FROM_FILESYSTEM | AUTO_RELEASE_DATA

Required: Yes

Response Syntax

{ "DataRepositoryTask": { "CapacityToRelease": number, "CreationTime": number, "EndTime": number, "FailureDetails": { "Message": "string" }, "FileCacheId": "string", "FileSystemId": "string", "Lifecycle": "string", "Paths": [ "string" ], "ReleaseConfiguration": { "DurationSinceLastAccess": { "Unit": "string", "Value": number } }, "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.

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://amzn-s3-demo-bucket/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://amzn-s3-demo-bucket/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: