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
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nas:CreateDataFlowTask |
create |
*DataFlow
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| FileSystemId |
string |
Yes |
The ID of the file system.
|
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:
|
false |
| TaskAction |
string |
No |
The type of the data stream node. Valid values:
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:
|
Import |
| DataType |
string |
No |
The type of data operated by the data flow task. Valid values:
Note
When TaskAction is set to Evict, the DataType parameter is required. Valid values:
|
Metadata |
| Directory |
string |
No |
The source directory of the data. Limits:
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:
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:
Note
|
/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
|
["/test/","/test1/"] |
| DstDirectory |
string |
No |
The destination directory mapped by the data flow task. Limits:
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:
Note
|
false |
| ConflictPolicy |
string |
No |
The conflict policy for files with the same name. Valid values:
Note
This parameter is required when the file system type is CPFS for Lingjun. Valid values:
|
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.