All Products
Search
Document Center

Cloud Parallel File Storage:CreateDataFlowTask

Last Updated:Oct 20, 2026

Creates a data flow task.

Operation description

  • CPFS usage notes

    • Only CPFS 2.2.0 and later support data flows. You can view the version information on the file system details page in the console.

    • Data flow tasks are executed asynchronously. You can call the DescribeDataFlowTasks operation to query the task execution status. The time required to complete a task depends on the amount of data to be imported or exported. For a large amount of data, split the data into multiple tasks.

    • You can create data flow tasks only for data flows in the Running state.

    • When you manually execute a data flow task, the automatic data update task of the data flow is interrupted and queued.

    • When you create an export task, ensure that the total length of the absolute paths of the files to be exported from CPFS does not exceed 1,023 characters.

  • CPFS for Lingjun usage notes

    • Only CPFS for Lingjun 2.4.0 and later support data flows. You can view the version information on the file system details page in the console.

    • Data flow tasks are executed asynchronously. You can call the DescribeDataFlowTasks operation to query the task execution status. The time required to complete a task depends on the amount of data to be imported or exported. For a large amount of data, split the data into multiple tasks.

    • You can create data flow tasks only for data flows in the Running state.

    • When you create an export task, ensure that the total length of the absolute paths of the files to be exported from CPFS for Lingjun does not exceed 1,023 characters.

    • CPFS for Lingjun supports batch tasks and streaming tasks. For more information, see Task types.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

nas:CreateDataFlowTask

create

*DataFlow

acs:nas:{#regionId}:{#accountId}:filesystem/{#filesystemId}

None None

Request parameters

Parameter

Type

Required

Description

Example

FileSystemId

string

Yes

The ID of the file system.

  • General-purpose CPFS: The ID must start with cpfs-, such as cpfs-125487****.

  • CPFS for Lingjun: The ID must start with bmcpfs-, such as bmcpfs-0015****.

cpfs-099394bd928c****

DataFlowId

string

Yes

The ID of the data flow.

df-194433a5be31****

SrcTaskId

string

No

The ID of the source data flow task. If you specify SrcTaskId, you must enter a data flow task ID. The system copies the TaskAction, DataType, and EntryList parameters from the specified data flow task. You do not need to specify these parameters separately.

Note

Streaming data flow tasks are not supported.

task-29ee8e890f45****

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, and you must make sure that the value is unique among different requests.

The client token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId of each API request may be different.

123e4567-e89b-12d3-a456-42665544****

DryRun

boolean

No

Specifies whether to perform a dry run on the creation request.

A dry run helps you check parameter validity and verify inventory. It does not actually create the instance or incur fees.

Valid values:

  • true: Sends a check request and does not create the instance. The system checks whether required parameters are specified, the request format, business limits, and NAS inventory. If the check fails, the corresponding error is returned. If the check succeeds, the HTTP status code 200 is returned, but TaskId is empty.

  • false: Sends a normal request and directly creates the instance after the check succeeds. Default value: false.

false

TaskAction

string

No

The type of the data stream node.

Valid values:

  • Import: performs data import of specified data from the source storage to CPFS.

  • Export: exports specified data from CPFS to the source storage.

  • StreamImport: imports specified data in batches from the source storage to CPFS.

  • StreamExport: performs batch export of specified data from CPFS to the source storage.

  • Evict: releases the data blocks of files in CPFS. After the release, only the metadata of the files is retained in CPFS. You can still query the files, but the data blocks are purged and do not occupy storage capacity in CPFS. When you access the file data, the data is loaded on demand from the source storage.

  • Inventory: obtains the checklist of files managed by data streams in CPFS. This provides the cache status of the files in the data streams.

Note

CPFS for Lingjun supports only Import, Export, StreamImport, and StreamExport. StreamImport and StreamExport are supported only in CPFS for Lingjun 2.6.0 and later.

Valid values:

  • StreamExport :

    Performs batch export of specified data from CPFS to the source storage.

  • Import :

    Performs data import of specified data from the source storage to CPFS.

  • Preload :

    Preloads data.

  • StreamImport :

    Imports specified data in batches from the source storage to CPFS.

  • Export :

    Exports specified data from CPFS to the source storage.

  • Evict :

    Releases the data blocks of files in CPFS. After the release, only the metadata of the files is retained in CPFS.

  • Inventory :

    Obtains the inventory of files managed by data flows in CPFS and provides the cache status of the files in the data flows.

Import

DataType

string

No

The type of data operated by the data flow task.

Valid values:

  • Metadata: the metadata of files, including attributes such as timestamp, ownership, and permission. If you select Metadata, only the metadata of the files is imported. You can only view the files. When you access the file data, the data is loaded on demand from the source storage.

  • Data: the data blocks of files.

  • MetaAndData: the metadata and data blocks of files.

Note

When TaskAction is set to Evict, the DataType parameter is required.

Valid values:

  • :
  • Metadata :

    The metadata of files.

  • Data :

    The data blocks of files.

  • MetaAndData :

    The metadata and data blocks of files.

Metadata

Directory

string

No

The source directory of the data.

Limits:

  • The value must be 1 to 1,023 characters in length.

  • The value must be encoded in UTF-8.

  • The value must start and end with a forward slash (/).

  • You can specify only one directory at a time.

  • When TaskAction is set to Export, the directory must be a relative path within FileSystemPath.

  • When TaskAction is set to Import, the directory must be a relative path within SourceStoragePath.

  • When TaskAction is set to StreamExport, the directory must be a relative path within FileSystemPath.

  • When TaskAction is set to StreamImport, the directory must be a relative path within SourceStoragePath.

Note

StreamImport and StreamExport are supported only in CPFS for Lingjun 2.6.0 and later. The Directory, EntryList, and TransferFileListPath parameters are mutually exclusive. You can specify only one of them.

/path_in_cpfs/

EntryList

string

No

The list of files for the data flow task to execute.

Limits:

  • The value must be encoded in UTF-8.

  • The total length of the file list must be less than 64 KB.

  • The file list must be in JSON format.

  • The path of a single file must be 1 to 1,023 characters in length and must start with a forward slash (/).

  • When TaskAction is set to Import, each element in the list represents an OSS object name.

  • When TaskAction is set to Export, each element in the list represents a CPFS file path.

Note

The Directory, EntryList, and TransferFileListPath parameters are mutually exclusive. You can specify only one of them.

["/path_in_cpfs/file1", "/path_in_cpfs/file2"]

TransferFileListPath

string

No

The OSS directory. Data is synchronized based on the content of the CSV file in the OSS directory. Limits:

  • The value must start and end with a forward slash (/).

  • The value is case-sensitive.

  • The value must be 1 to 1,023 characters in length.

  • The value must be encoded in UTF-8.

Note
  • The TransferFileListPath, Directory, and EntryList parameters are mutually exclusive. You can specify only one of them.

  • This parameter must be an actual path in OSS. The *.csv files under the path are stored in OSS.

  • TransferFileListPath supports only the Import and Export operations.

  • In the Import scenario, the files or directories specified in the CSV file are imported from OSS to CPFS.

  • In the Export scenario, the files or directories specified in the CSV file are exported from CPFS to OSS.

  • The CSV file must contain the Name and Type columns. Name is a relative path. Type supports two values: dir and file. If Type is set to dir, the Name suffix must end with a forward slash (/).

  • Only CPFS for Lingjun supports this feature.

/test_oss_path/

Includes

string

No

Filters the directories under the specified directory and transfers the content of the folders within the filtered directories.

Note
  • This parameter takes effect only when the Directory parameter is specified.

  • The path of a single folder must be 1 to 1,023 characters in length, must start and end with a forward slash (/), and cannot exceed 3,000 characters in total length.

  • Only CPFS for Lingjun supports this feature.

["/test/","/test1/"]

DstDirectory

string

No

The destination directory mapped by the data flow task. Limits:

  • The value must start and end with a forward slash (/). The value cannot contain /../.

  • The value must be 1 to 1,023 characters in length.

  • The value must be encoded in UTF-8.

  • You can specify only one directory at a time.

  • When TaskAction is set to Export, the directory must be a relative path within SourceStoragePath.

  • When TaskAction is set to Import, the directory must be a relative path within FileSystemPath.

  • When TaskAction is set to StreamExport, the directory must be a relative path within SourceStoragePath.

  • When TaskAction is set to StreamImport, the directory must be a relative path within FileSystemPath.

Note

StreamImport and StreamExport are supported only in CPFS for Lingjun 2.6.0 and later.

/path_in_cpfs/

CreateDirIfNotExist

boolean

No

Specifies whether to enable automatic creation of the folder if the folder does not exist. Valid values:

  • true: Enables automatic creation of the folder.

  • false: Disables automatic creation of the folder. Default value: false.

Note
  • This parameter takes effect when TaskAction is set to Import.

  • This parameter is supported only in CPFS for Lingjun 2.6.0 and later.

false

ConflictPolicy

string

No

The conflict policy for files with the same name. Valid values:

  • SKIP_THE_FILE: skips files with the same name.

  • KEEP_LATEST: compares the update time and retains the latest version.

  • OVERWRITE_EXISTING: forcibly overwrites files with the same name.

Note

This parameter is required when the file system type is CPFS for Lingjun.

Valid values:

  • KEEP_LATEST :

    Compares the update time and retains the latest version.

  • OVERWRITE_EXISTING :

    Forcibly overwrites files with the same name.

  • SKIP_THE_FILE :

    Skips files with the same name.

SKIP_THE_FILE

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

2D69A58F-345C-4FDE-88E4-BF518948****

TaskId

string

The ID of the data flow task.

task-38aa8e890f45****

Examples

Success response

JSON format

{
  "RequestId": "2D69A58F-345C-4FDE-88E4-BF518948****",
  "TaskId": "task-38aa8e890f45****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalCharacters The parameter contains illegal characters. The parameter contains illegal characters.
400 MissingFileSystemId FileSystemId is mandatory for this action. The FileSystemId parameter is not specified.
400 MissingDataFlowId DataFlowId is mandatory for this action. The DataFlowId parameter is not specified.
400 InvalidFilesystemVersion.NotSupport This Api does not support this fileSystem version. This Api does not support this fileSystem version.
403 OperationDenied.InvalidState The operation is not permitted when the status is processing. The operation is not permitted when the status is processing.
403 OperationDenied.DependencyViolation The operation is denied due to dependancy violation. The conditions for performing this operation are not met.
403 OperationDenied.DataFlowNotSupported The operation is not supported. The file system does not support data flow.
404 InvalidParameter.InvalidFormat The EntryList format is invalid. The format of the specified EntryList parameter is invalid.
404 InvalidParameter.SizeTooLarge The specified EntryList size exceeds 64 KB. The size of the specified EntryList exceeds 64 KB.
404 InvalidDataFlow.NotFound The specified data flow does not exist. The specified data flow does not exist.
404 InvalidTaskAction.NotSupported The task action is not supported. The specified task type is not supported.
404 InvalidTaskAction.PermissionDenied The task action is not allowed. The specified task type is not allowed, such as system replication.
404 InvalidSrcTaskId.NotFound The SrcTaskId is not found. The specified SrcTaskId does not exist.
404 InvalidDataType.NotSupported The data type is not supported. The specified data type is not supported.
404 InvalidSrcTaskId.TaskIdInvalid Source task ID is invalid. The specified task ID for replication is invalid.
404 InvalidSrcTaskId.TaskIdNotFound Source task ID is not found. The specified task ID for replication does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.