Amazon FSx

2019/12/23 - Amazon FSx - 3 new api methods

Changes  This release adds a new family of APIs (create-data-repository-task, describe-data-repository-task, and cancel-data-repository-task) that allow users to perform operations between their file system and its linked data repository.

DescribeDataRepositoryTasks (new) Link ¶

Returns the description of specific Amazon FSx for Lustre data repository tasks, if one or more TaskIds values are provided in the request, or if filters are used in the request. You can use filters to narrow the response to include just tasks for specific file systems, or tasks in a specific lifecycle state. Otherwise, it returns all data repository tasks owned by your AWS account in the AWS Region of the endpoint that you're calling.

When retrieving all tasks, you can paginate the response by using the optional MaxResults parameter to limit the number of tasks returned in a response. If more tasks remain, Amazon FSx returns a NextToken value in the response. In this case, send a later request with the NextToken request parameter set to the value of NextToken from the last response.

See also: AWS API Documentation

Request Syntax

client.describe_data_repository_tasks(
    TaskIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'file-system-id'|'task-lifecycle',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type TaskIds

list

param TaskIds

(Optional) IDs of the tasks whose descriptions you want to retrieve (String).

  • (string) --

type Filters

list

param Filters

(Optional) You can use filters to narrow the DescribeDataRepositoryTasks response to include just tasks for specific file systems, or tasks in a specific lifecycle state.

  • (dict) --

    (Optional) An array of filter objects you can use to filter the response of data repository tasks you will see in the the response. You can filter the tasks returned in the response by one or more file system IDs, task lifecycles, and by task type. A filter object consists of a filter Name , and one or more Values for the filter.

    • Name (string) --

      Name of the task property to use in filtering the tasks returned in the response.

      • Use file-system-id to retrieve data repository tasks for specific file systems.

      • Use task-lifecycle to retrieve data repository tasks with one or more specific lifecycle states, as follows: CANCELED, EXECUTING, FAILED, PENDING, and SUCCEEDED.

    • Values (list) --

      Use Values to include the specific file system IDs and task lifecycle states for the filters you are using.

      • (string) --

type MaxResults

integer

param MaxResults

The maximum number of resources to return in the response. This value must be an integer greater than zero.

type NextToken

string

param NextToken

(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous NextToken value left off.

rtype

dict

returns

Response Syntax

{
    'DataRepositoryTasks': [
        {
            'TaskId': 'string',
            'Lifecycle': 'PENDING'|'EXECUTING'|'FAILED'|'SUCCEEDED'|'CANCELED'|'CANCELING',
            'Type': 'EXPORT_TO_REPOSITORY',
            '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)
            },
            'Report': {
                'Enabled': True|False,
                'Path': 'string',
                'Format': 'REPORT_CSV_20191124',
                'Scope': 'FAILED_FILES_ONLY'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • DataRepositoryTasks (list) --

      The collection of data repository task descriptions returned.

      • (dict) --

        A description of the data repository task. You use data repository tasks to perform bulk transfer operations between your Amazon FSx file system and its linked data repository.

        • 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 - Amazon FSx has not started the task.

          • EXECUTING - Amazon FSx is processing the task.

          • FAILED - Amazon FSx was not able to complete the task. For example, there may be files the task failed to process. The DataRepositoryTaskFailureDetails property provides more information about task failures.

          • SUCCEEDED - FSx completed the task successfully.

          • CANCELED - Amazon FSx canceled the task and it did not complete.

          • CANCELING - FSx is in process of canceling the task.

          Note

          You cannot delete an FSx for Lustre file system if there are data repository tasks for the file system in the PENDING or EXECUTING states. Please retry when the data repository task is finished (with a status of CANCELED , SUCCEEDED , or FAILED ). 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 is the only type currently supported.

        • 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 that Amazon FSx began processing the task.

        • EndTime (datetime) --

          The time that Amazon FSx completed processing the task, populated after the task is complete.

        • ResourceARN (string) --

          The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify AWS resources. We require an ARN when you need to specify a resource unambiguously across all of AWS. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS 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 of finances : April and also of payroll : April .

        • FileSystemId (string) --

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

        • Paths (list) --

          An array of paths on the Amazon FSx for Lustre file system 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 to FAILED .

          • 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 plus FailedCount may not equal TotalCount . When the task is complete, TotalCount equals the sum of SucceededCount plus FailedCount .

          • 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.

        • 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 report Path parameter. You can specify whether or not a report gets generated for a task using the Enabled parameter.

          • Enabled (boolean) --

            Set Enabled to True to generate a CompletionReport when the task completes. If set to true , then you need to provide a report Scope , Path , and Format . Set Enabled to False if you do not want a CompletionReport generated when the task completes.

          • Path (string) --

            Required if Enabled is set to true . 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. The Path you provide must be located within the file system’s ExportPath. An example Path value is "s3://myBucket/myExportPath/optionalPrefix". The report provides the following information for each file in the report: FilePath, FileStatus, and ErrorCode. To learn more about a file system's ExportPath , see .

          • Format (string) --

            Required if Enabled is set to true . Specifies the format of the CompletionReport . REPORT_CSV_20191124 is the only format currently supported. When Format is set to REPORT_CSV_20191124 , the CompletionReport is provided in CSV format, and is delivered to {path}/task-{id}/failures.csv .

          • Scope (string) --

            Required if Enabled is set to true . Specifies the scope of the CompletionReport ; FAILED_FILES_ONLY is the only scope currently supported. When Scope is set to FAILED_FILES_ONLY , the CompletionReport only contains information about files that the data repository task failed to process.

    • NextToken (string) --

      (Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous NextToken value left off.

CreateDataRepositoryTask (new) Link ¶

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 repository. 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 its 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 Using Data Repository Tasks. To learn more about linking a data repository to your file system, see Step 1: Create Your Amazon FSx for Lustre File System.

See also: AWS API Documentation

Request Syntax

client.create_data_repository_task(
    Type='EXPORT_TO_REPOSITORY',
    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'
        },
    ]
)
type Type

string

param Type

[REQUIRED]

Specifies the type of data repository task to create.

type Paths

list

param Paths

(Optional) The path or paths on the Amazon FSx file system to use when the data repository task is processed. The default path is the file system root directory.

  • (string) --

type FileSystemId

string

param FileSystemId

[REQUIRED]

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

type Report

dict

param Report

[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.

  • Enabled (boolean) -- [REQUIRED]

    Set Enabled to True to generate a CompletionReport when the task completes. If set to true , then you need to provide a report Scope , Path , and Format . Set Enabled to False if you do not want a CompletionReport generated when the task completes.

  • Path (string) --

    Required if Enabled is set to true . 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. The Path you provide must be located within the file system’s ExportPath. An example Path value is "s3://myBucket/myExportPath/optionalPrefix". The report provides the following information for each file in the report: FilePath, FileStatus, and ErrorCode. To learn more about a file system's ExportPath , see .

  • Format (string) --

    Required if Enabled is set to true . Specifies the format of the CompletionReport . REPORT_CSV_20191124 is the only format currently supported. When Format is set to REPORT_CSV_20191124 , the CompletionReport is provided in CSV format, and is delivered to {path}/task-{id}/failures.csv .

  • Scope (string) --

    Required if Enabled is set to true . Specifies the scope of the CompletionReport ; FAILED_FILES_ONLY is the only scope currently supported. When Scope is set to FAILED_FILES_ONLY , the CompletionReport only contains information about files that the data repository task failed to process.

type ClientRequestToken

string

param 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.

This field is autopopulated if not provided.

type Tags

list

param Tags

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 of finances : April and also of payroll : April .

rtype

dict

returns

Response Syntax

{
    'DataRepositoryTask': {
        'TaskId': 'string',
        'Lifecycle': 'PENDING'|'EXECUTING'|'FAILED'|'SUCCEEDED'|'CANCELED'|'CANCELING',
        'Type': 'EXPORT_TO_REPOSITORY',
        '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)
        },
        'Report': {
            'Enabled': True|False,
            'Path': 'string',
            'Format': 'REPORT_CSV_20191124',
            'Scope': 'FAILED_FILES_ONLY'
        }
    }
}

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 - Amazon FSx has not started the task.

        • EXECUTING - Amazon FSx is processing the task.

        • FAILED - Amazon FSx was not able to complete the task. For example, there may be files the task failed to process. The DataRepositoryTaskFailureDetails property provides more information about task failures.

        • SUCCEEDED - FSx completed the task successfully.

        • CANCELED - Amazon FSx canceled the task and it did not complete.

        • CANCELING - FSx is in process of canceling the task.

        Note

        You cannot delete an FSx for Lustre file system if there are data repository tasks for the file system in the PENDING or EXECUTING states. Please retry when the data repository task is finished (with a status of CANCELED , SUCCEEDED , or FAILED ). 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 is the only type currently supported.

      • 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 that Amazon FSx began processing the task.

      • EndTime (datetime) --

        The time that Amazon FSx completed processing the task, populated after the task is complete.

      • ResourceARN (string) --

        The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify AWS resources. We require an ARN when you need to specify a resource unambiguously across all of AWS. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS 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 of finances : April and also of payroll : April .

      • FileSystemId (string) --

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

      • Paths (list) --

        An array of paths on the Amazon FSx for Lustre file system 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 to FAILED .

        • 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 plus FailedCount may not equal TotalCount . When the task is complete, TotalCount equals the sum of SucceededCount plus FailedCount .

        • 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.

      • 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 report Path parameter. You can specify whether or not a report gets generated for a task using the Enabled parameter.

        • Enabled (boolean) --

          Set Enabled to True to generate a CompletionReport when the task completes. If set to true , then you need to provide a report Scope , Path , and Format . Set Enabled to False if you do not want a CompletionReport generated when the task completes.

        • Path (string) --

          Required if Enabled is set to true . 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. The Path you provide must be located within the file system’s ExportPath. An example Path value is "s3://myBucket/myExportPath/optionalPrefix". The report provides the following information for each file in the report: FilePath, FileStatus, and ErrorCode. To learn more about a file system's ExportPath , see .

        • Format (string) --

          Required if Enabled is set to true . Specifies the format of the CompletionReport . REPORT_CSV_20191124 is the only format currently supported. When Format is set to REPORT_CSV_20191124 , the CompletionReport is provided in CSV format, and is delivered to {path}/task-{id}/failures.csv .

        • Scope (string) --

          Required if Enabled is set to true . Specifies the scope of the CompletionReport ; FAILED_FILES_ONLY is the only scope currently supported. When Scope is set to FAILED_FILES_ONLY , the CompletionReport only contains information about files that the data repository task failed to process.

CancelDataRepositoryTask (new) Link ¶

Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the PENDING or EXECUTING state. When you cancel a task, Amazon FSx does the following.

  • Any files that FSx has already exported are not reverted.

  • FSx continues to export any files that are "in-flight" when the cancel operation is received.

  • FSx does not export any files that have not yet been exported.

See also: AWS API Documentation

Request Syntax

client.cancel_data_repository_task(
    TaskId='string'
)
type TaskId

string

param TaskId

[REQUIRED]

Specifies the data repository task to cancel.

rtype

dict

returns

Response Syntax

{
    'Lifecycle': 'PENDING'|'EXECUTING'|'FAILED'|'SUCCEEDED'|'CANCELED'|'CANCELING',
    'TaskId': 'string'
}

Response Structure

  • (dict) --

    • Lifecycle (string) --

      The lifecycle status of the data repository task, as follows:

      • PENDING - Amazon FSx has not started the task.

      • EXECUTING - Amazon FSx is processing the task.

      • FAILED - Amazon FSx was not able to complete the task. For example, there may be files the task failed to process. The DataRepositoryTaskFailureDetails property provides more information about task failures.

      • SUCCEEDED - FSx completed the task successfully.

      • CANCELED - Amazon FSx canceled the task and it did not complete.

      • CANCELING - FSx is in process of canceling the task.

    • TaskId (string) --

      The ID of the task being canceled.