FSx / Client / create_data_repository_task
create_data_repository_task#
- FSx.Client.create_data_repository_task(**kwargs)#
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.
See also: AWS API Documentation
Request Syntax
response = client.create_data_repository_task( Type='EXPORT_TO_REPOSITORY'|'IMPORT_METADATA_FROM_REPOSITORY'|'RELEASE_DATA_FROM_FILESYSTEM'|'AUTO_RELEASE_DATA', Paths=[ 'string', ], FileSystemId='string', Report={ 'Enabled': True|False, 'Path': 'string', 'Format': 'REPORT_CSV_20191124', 'Scope': 'FAILED_FILES_ONLY' }, ClientRequestToken='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ], CapacityToRelease=123, ReleaseConfiguration={ 'DurationSinceLastAccess': { 'Unit': 'DAYS', 'Value': 123 } } )
- Parameters:
Type (string) –
[REQUIRED]
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.
Paths (list) –
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 ispath1
.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
(whereprefix
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 for the file to be released.
(string) –
FileSystemId (string) –
[REQUIRED]
The globally unique ID of the file system, assigned by Amazon FSx.
Report (dict) –
[REQUIRED]
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.Enabled (boolean) – [REQUIRED]
Set
Enabled
toTrue
to generate aCompletionReport
when the task completes. If set totrue
, then you need to provide a reportScope
,Path
, andFormat
. SetEnabled
toFalse
if you do not want aCompletionReport
generated when the task completes.Path (string) –
Required if
Enabled
is set totrue
. Specifies the location of the report on the file system’s linked S3 data repository. An absolute path that defines where the completion report will be stored in the destination location. ThePath
you provide must be located within the file system’s ExportPath. An examplePath
value is “s3://amzn-s3-demo-bucket/myExportPath/optionalPrefix”. The report provides the following information for each file in the report: FilePath, FileStatus, and ErrorCode.Format (string) –
Required if
Enabled
is set totrue
. Specifies the format of theCompletionReport
.REPORT_CSV_20191124
is the only format currently supported. WhenFormat
is set toREPORT_CSV_20191124
, theCompletionReport
is provided in CSV format, and is delivered to{path}/task-{id}/failures.csv
.Scope (string) –
Required if
Enabled
is set totrue
. Specifies the scope of theCompletionReport
;FAILED_FILES_ONLY
is the only scope currently supported. WhenScope
is set toFAILED_FILES_ONLY
, theCompletionReport
only contains information about files that the data repository task failed to process.
ClientRequestToken (string) –
(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 Command Line Interface (CLI) or an Amazon Web Services SDK.
This field is autopopulated if not provided.
Tags (list) –
A list of
Tag
values, with a maximum of 50 elements.(dict) –
Specifies a key-value pair for a resource tag.
Key (string) – [REQUIRED]
A value that specifies the
TagKey
, the name of the tag. Tag keys must be unique for the resource to which they are attached.Value (string) – [REQUIRED]
A value that specifies the
TagValue
, the value assigned to the corresponding tag key. Tag values can be null and don’t have to be unique in a tag set. For example, you can have a key-value pair in a tag set offinances : April
and also ofpayroll : April
.
CapacityToRelease (integer) – 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.ReleaseConfiguration (dict) –
The configuration that specifies the last accessed time criteria for files that will be released from an Amazon FSx for Lustre file system.
DurationSinceLastAccess (dict) –
Defines the point-in-time since an exported file was last accessed, in order for that file to be eligible for release. Only files that were last accessed before this point-in-time are eligible to be released from the file system.
Unit (string) –
The unit of time used by the
Value
parameter to determine if a file can be released, based on when it was last accessed.DAYS
is the only supported value. This is a required parameter.Value (integer) –
An integer that represents the minimum amount of time (in days) since a file was last accessed in the file system. Only exported files with a
MAX(atime, ctime, mtime)
timestamp that is more than this amount of time in the past (relative to the task create time) will be released. The default ofValue
is0
. This is a required parameter.Note
If an exported file meets the last accessed time criteria, its file or directory path must also be specified in the
Paths
parameter of the operation in order for the file to be released.
- Return type:
dict
- Returns:
Response Syntax
{ 'DataRepositoryTask': { 'TaskId': 'string', 'Lifecycle': 'PENDING'|'EXECUTING'|'FAILED'|'SUCCEEDED'|'CANCELED'|'CANCELING', 'Type': 'EXPORT_TO_REPOSITORY'|'IMPORT_METADATA_FROM_REPOSITORY'|'RELEASE_DATA_FROM_FILESYSTEM'|'AUTO_RELEASE_DATA', 'CreationTime': datetime(2015, 1, 1), 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1), 'ResourceARN': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'FileSystemId': 'string', 'Paths': [ 'string', ], 'FailureDetails': { 'Message': 'string' }, 'Status': { 'TotalCount': 123, 'SucceededCount': 123, 'FailedCount': 123, 'LastUpdatedTime': datetime(2015, 1, 1), 'ReleasedCapacity': 123 }, 'Report': { 'Enabled': True|False, 'Path': 'string', 'Format': 'REPORT_CSV_20191124', 'Scope': 'FAILED_FILES_ONLY' }, 'CapacityToRelease': 123, 'FileCacheId': 'string', 'ReleaseConfiguration': { 'DurationSinceLastAccess': { 'Unit': 'DAYS', 'Value': 123 } } } }
Response Structure
(dict) –
DataRepositoryTask (dict) –
The description of the data repository task that you just created.
TaskId (string) –
The system-generated, unique 17-digit ID of the data repository task.
Lifecycle (string) –
The lifecycle status of the data repository task, as follows:
PENDING
- The task has not started.EXECUTING
- The task is in process.FAILED
- The task was not able to be completed. For example, there may be files the task failed to process. The DataRepositoryTaskFailureDetails property provides more information about task failures.SUCCEEDED
- The task has completed successfully.CANCELED
- The task was canceled and it did not complete.CANCELING
- The task is in process of being canceled.
Note
You cannot delete an FSx for Lustre file system if there are data repository tasks for the file system in the
PENDING
orEXECUTING
states. Please retry when the data repository task is finished (with a status ofCANCELED
,SUCCEEDED
, orFAILED
). You can use the DescribeDataRepositoryTask action to monitor the task status. Contact the FSx team if you need to delete your file system immediately.Type (string) –
The type of data repository task.
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.
CreationTime (datetime) –
The time that the resource was created, in seconds (since 1970-01-01T00:00:00Z), also known as Unix time.
StartTime (datetime) –
The time the system began processing the task.
EndTime (datetime) –
The time the system completed processing the task, populated after the task is complete.
ResourceARN (string) –
The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify Amazon Web Services resources. We require an ARN when you need to specify a resource unambiguously across all of Amazon Web Services. For more information, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.
Tags (list) –
A list of
Tag
values, with a maximum of 50 elements.(dict) –
Specifies a key-value pair for a resource tag.
Key (string) –
A value that specifies the
TagKey
, the name of the tag. Tag keys must be unique for the resource to which they are attached.Value (string) –
A value that specifies the
TagValue
, the value assigned to the corresponding tag key. Tag values can be null and don’t have to be unique in a tag set. For example, you can have a key-value pair in a tag set offinances : April
and also ofpayroll : April
.
FileSystemId (string) –
The globally unique ID of the file system.
Paths (list) –
An array of paths that specify the data for the data repository task to process. For example, in an EXPORT_TO_REPOSITORY task, the paths specify which data to export to the linked data repository.
(Default) If
Paths
is not specified, Amazon FSx uses the file system root directory.(string) –
FailureDetails (dict) –
Failure message describing why the task failed, it is populated only when
Lifecycle
is set toFAILED
.Message (string) –
A detailed error message.
Status (dict) –
Provides the status of the number of files that the task has processed successfully and failed to process.
TotalCount (integer) –
The total number of files that the task will process. While a task is executing, the sum of
SucceededCount
plusFailedCount
may not equalTotalCount
. When the task is complete,TotalCount
equals the sum ofSucceededCount
plusFailedCount
.SucceededCount (integer) –
A running total of the number of files that the task has successfully processed.
FailedCount (integer) –
A running total of the number of files that the task failed to process.
LastUpdatedTime (datetime) –
The time at which the task status was last updated.
ReleasedCapacity (integer) –
The total amount of data, in GiB, released by an Amazon File Cache AUTO_RELEASE_DATA task that automatically releases files from the cache.
Report (dict) –
Provides a report detailing the data repository task results of the files processed that match the criteria specified in the report
Scope
parameter. FSx delivers the report to the file system’s linked data repository in Amazon S3, using the path specified in the reportPath
parameter. You can specify whether or not a report gets generated for a task using theEnabled
parameter.Enabled (boolean) –
Set
Enabled
toTrue
to generate aCompletionReport
when the task completes. If set totrue
, then you need to provide a reportScope
,Path
, andFormat
. SetEnabled
toFalse
if you do not want aCompletionReport
generated when the task completes.Path (string) –
Required if
Enabled
is set totrue
. Specifies the location of the report on the file system’s linked S3 data repository. An absolute path that defines where the completion report will be stored in the destination location. ThePath
you provide must be located within the file system’s ExportPath. An examplePath
value is “s3://amzn-s3-demo-bucket/myExportPath/optionalPrefix”. The report provides the following information for each file in the report: FilePath, FileStatus, and ErrorCode.Format (string) –
Required if
Enabled
is set totrue
. Specifies the format of theCompletionReport
.REPORT_CSV_20191124
is the only format currently supported. WhenFormat
is set toREPORT_CSV_20191124
, theCompletionReport
is provided in CSV format, and is delivered to{path}/task-{id}/failures.csv
.Scope (string) –
Required if
Enabled
is set totrue
. Specifies the scope of theCompletionReport
;FAILED_FILES_ONLY
is the only scope currently supported. WhenScope
is set toFAILED_FILES_ONLY
, theCompletionReport
only contains information about files that the data repository task failed to process.
CapacityToRelease (integer) –
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.
FileCacheId (string) –
The system-generated, unique ID of the cache.
ReleaseConfiguration (dict) –
The configuration that specifies the last accessed time criteria for files that will be released from an Amazon FSx for Lustre file system.
DurationSinceLastAccess (dict) –
Defines the point-in-time since an exported file was last accessed, in order for that file to be eligible for release. Only files that were last accessed before this point-in-time are eligible to be released from the file system.
Unit (string) –
The unit of time used by the
Value
parameter to determine if a file can be released, based on when it was last accessed.DAYS
is the only supported value. This is a required parameter.Value (integer) –
An integer that represents the minimum amount of time (in days) since a file was last accessed in the file system. Only exported files with a
MAX(atime, ctime, mtime)
timestamp that is more than this amount of time in the past (relative to the task create time) will be released. The default ofValue
is0
. This is a required parameter.Note
If an exported file meets the last accessed time criteria, its file or directory path must also be specified in the
Paths
parameter of the operation in order for the file to be released.
Exceptions