Method: Aws::FSx::Client#create_data_repository_task

Defined in:
lib/aws-sdk-fsx/client.rb

#create_data_repository_task(params = {}) ⇒ Types::CreateDataRepositoryTaskResponse

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

[1]: docs.aws.amazon.com/fsx/latest/LustreGuide/data-repository-tasks.html [2]: docs.aws.amazon.com/fsx/latest/LustreGuide/create-dra-linked-data-repo.html

Examples:

Request syntax with placeholder values


resp = client.create_data_repository_task({
  type: "EXPORT_TO_REPOSITORY", # required, accepts EXPORT_TO_REPOSITORY, IMPORT_METADATA_FROM_REPOSITORY, RELEASE_DATA_FROM_FILESYSTEM, AUTO_RELEASE_DATA
  paths: ["DataRepositoryTaskPath"],
  file_system_id: "FileSystemId", # required
  report: { # required
    enabled: false, # required
    path: "ArchivePath",
    format: "REPORT_CSV_20191124", # accepts REPORT_CSV_20191124
    scope: "FAILED_FILES_ONLY", # accepts FAILED_FILES_ONLY
  },
  client_request_token: "ClientRequestToken",
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  capacity_to_release: 1,
  release_configuration: {
    duration_since_last_access: {
      unit: "DAYS", # accepts DAYS
      value: 1,
    },
  },
})

Response structure


resp.data_repository_task.task_id #=> String
resp.data_repository_task.lifecycle #=> String, one of "PENDING", "EXECUTING", "FAILED", "SUCCEEDED", "CANCELED", "CANCELING"
resp.data_repository_task.type #=> String, one of "EXPORT_TO_REPOSITORY", "IMPORT_METADATA_FROM_REPOSITORY", "RELEASE_DATA_FROM_FILESYSTEM", "AUTO_RELEASE_DATA"
resp.data_repository_task.creation_time #=> Time
resp.data_repository_task.start_time #=> Time
resp.data_repository_task.end_time #=> Time
resp.data_repository_task.resource_arn #=> String
resp.data_repository_task.tags #=> Array
resp.data_repository_task.tags[0].key #=> String
resp.data_repository_task.tags[0].value #=> String
resp.data_repository_task.file_system_id #=> String
resp.data_repository_task.paths #=> Array
resp.data_repository_task.paths[0] #=> String
resp.data_repository_task.failure_details.message #=> String
resp.data_repository_task.status.total_count #=> Integer
resp.data_repository_task.status.succeeded_count #=> Integer
resp.data_repository_task.status.failed_count #=> Integer
resp.data_repository_task.status.last_updated_time #=> Time
resp.data_repository_task.status.released_capacity #=> Integer
resp.data_repository_task.report.enabled #=> Boolean
resp.data_repository_task.report.path #=> String
resp.data_repository_task.report.format #=> String, one of "REPORT_CSV_20191124"
resp.data_repository_task.report.scope #=> String, one of "FAILED_FILES_ONLY"
resp.data_repository_task.capacity_to_release #=> Integer
resp.data_repository_task.file_cache_id #=> String
resp.data_repository_task.release_configuration.duration_since_last_access.unit #=> String, one of "DAYS"
resp.data_repository_task.release_configuration.duration_since_last_access.value #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :type (required, String)

    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 (Array<String>)

    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://myBucket/myPrefix` (where `myPrefix` 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 markdown=“1”> A file must also meet the last accessed time criteria specified in for the file to be released.

      </note>
      
  • :file_system_id (required, String)

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

  • :report (required, Types::CompletionReport)

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

    [1]: docs.aws.amazon.com/fsx/latest/LustreGuide/task-completion-report.html

  • :client_request_token (String) — default: 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.

    **A suitable default value is auto-generated.** You should normally not need to pass this option.**

  • :tags (Array<Types::Tag>)

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

  • :capacity_to_release (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.

  • :release_configuration (Types::ReleaseConfiguration)

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

Returns:

See Also:



2257
2258
2259
2260
# File 'lib/aws-sdk-fsx/client.rb', line 2257

def create_data_repository_task(params = {}, options = {})
  req = build_request(:create_data_repository_task, params)
  req.send_request(options)
end