tencent cloud

GooseFSx-CLI Command Line Tool
Last updated: 2025-07-17 19:23:00
GooseFSx-CLI Command Line Tool
Last updated: 2025-07-17 19:23:00

Overview

GooseFSx-CLI is the command line tool for Tencent Cloud's data accelerator GooseFSx, suitable for 64-bit Linux systems. You can use command line instructions to automate and script the management of data in GooseFSx.

Download Tool

Download the GooseFSx-CLI tool, copy the GooseFSx-CLI program package to the GooseFSx client, and you can run it directly.

Parameter Configuration

For first-time use, you need to configure the parameters SecretId, SecretKey, and token. For parameter descriptions, please refer to Common Parameters. The guidance for obtaining SecretId and SecretKey is as follows:
The configuration parameters can be set as follows:

Method One: Directly Execute the Configuration Command

1. Execute the following command:
./goosefsx-cli
2. Follow the instructions, enter the AK, SK, and token in sequence:
2023/02/16 19:55:44 Welcome to goosefsx-cli!
When you use goosefsx-cli for the first time, you need to input some necessary information to generate the default configuration file of goosefsx-cli.
The path of the configuration file: /root/.goosefsx.yaml
Input Your Secret ID:
xxx
Input Your Secret Key:
yyy
Input Your Session Token:
test-token123

Method Two: Directly Edit the Configuration File /root/.goosefsx.yaml

# cat /root/.goosefsx.yaml
goosefsx:
base:
secretid: xxx
secretkey: yyy
sessiontoken: test-token123
scheme: https
endpoint: goosefs.internal.tencentcloudapi.com

List Objects and Virtual Directories in the Specified Directory

List files (objects) and directories (virtual directories) in the specified directory.

Command Syntax

./goosefsx-cli cos ls [flags]
Include the following flags:
Flag Name
Flag Abbreviation
Description
No
No
List files and directories in the specified directory, without recursively listing files and subdirectories in subdirectories
No
-r
Carry the -r parameter to recursively list directories; recursively list files and subdirectories in subdirectories under the specified directory.
--limit
No
Carry the --limit parameter to specify the number of files and directories to list; for example, --limit 2, list the first 2 files or directories in lexicographical order.
--include
No
Carry the --include parameter to set the included regular filter criteria; for example, --include dir, list files and subdirectories starting with dir.
--exclude
No
Carry the --exclude parameter to set the excluded regular filter criteria; for example, --exclude dir, list files and subdirectories not starting with dir.
No
>
Import the file list to the specified file; otherwise, directly output the file list.
Overlay Superimpose Stack Accumulate Overlaid
Overlay Superimpose Stack Accumulate Overlaid
Carry multiple parameters simultaneously, achieve an overlay effect. For example, `-r --limit 10 --include dir > list` implements recursive listing of files and subdirectories in subdirectories, lists the first 10 files or directories, lists files and subdirectories starting with `dir`, and outputs to the file `list`.

Operation Example

<List Directories in Bucket goosefs-ofs-test1-xxx'S Directory dir/>

./goosefsx-cli cos ls --bucket-name goosefs-ofs-test1-xxx dir/ --bucket-region ap-beijing
Return Value
[root@VM-10-214-tencentos ~]# ./goosefsx-cli cos ls --bucket-name goosefs-ofs-test1-xxx dir/ --bucket-region ap-beijing
dir/_sss
dir/dir2/

list All Files and Directories in the Directory dir/ of Bucket goosefs-ofs-test1-xxx and Output to File list

./goosefsx-cli cos ls --bucket-name goosefs-ofs-test1-xxx dir/ --bucket-region ap-beijing -r > list
Return Value
[root@VM-10-214-tencentos ~]# ./goosefsx-cli cos ls --bucket-name goosefs-ofs-test1-xxx dir/ --bucket-region ap-beijing -r > list
[root@VM-10-214-tencentos ~]# cat list
dir/_sss
dir/dir2/
dir/dir2/_sss (4)

Execute Data Flow Task Command

data_flow for data flow tasks.

Prerequisites

Before using the data flow task command, create a data flow/associated bucket first. For details, see Managing GooseFSx Data Flow Rules.

Create a Data Flow Task and Async Return Result

Create a data flow task, return immediately whether the task is issued successfully; the execution time of the data flow task varies with the data volume. You can use the following query command to check the execution results of the data flow task.

Command Syntax

./goosefsx-cli data_flow create [flags]
The create command includes the following flags:
Flag Name
Flag Abbreviation
Description
--task-type
No
Data flow task type, FS_TO_COS (file system to COS Bucket) or COS_TO_FS (COS Bucket to file system)
--bucket
No
COS bucket name
--region
No
The region where the file system is located.
--filesystem-id
No
The file system ID.
--task-path
No
For FS_TO_COS tasks, --task-path is the relative path of the mapped directory in the Bucket. For COS_TO_FS tasks, --task-path is the path on COS. If left empty, it means all data.
Example
If you associate the COS bucket beijing-1250000000 with the GooseFSx directory beijing-1250000000 and configure --task-path=test/ and --task-path=level2/level3/, it respectively represents the test/ and level2/level3/ paths under the COS bucket beijing-1250000000, or the test/ and level2/level3/ directories under the GooseFSx directory beijing-1250000000. Among them, level3/ is a subdirectory of level2/.
Note:
--task-path parameter value ends with /.
--task-name
No
Task Name

Output Parameter

Parameter Name
Type
Description
Task ID
string
Task ID
Task Request ID
string
unique request ID, which is returned for each request. RequestId is required for locating a problem.

Operation Example

Create data flow task
./goosefsx-cli data_flow create --task-type=COS_TO_FS --bucket=bucket_test-1252246555 --region=ap-shanghai --filesystem-id=xxx --task-path=test/ --task-name=test
Return Value
Create data repository task successfully!
=======================
Task ID: x_task_1676551831746
Task Request ID: f90a8741-f59b-465c-b44c-4758e7ed68a0

The result of the data flow task can be viewed using the query command.

Retrieve the Execution Result of a Data Flow Task

Query the execution result of the data flow task, in execution, completed, or failed.

Command Syntax

./goosefsx-cli data_flow taskstatus [flags]
taskstatus command includes the following flags:
Flag Name
Flag Abbreviation
Description
--region
No
The region where the file system is located.
--task-id
No
Task ID
--filesystem-id
No
The file system ID.

Output Parameter

Parameter Name
Type
Description
Query data flow task ID
string
Task ID
Query data flow task status
string
Retrieve the status of data flow tasks, including the numbers 0 (initialization), 2 (completed), and 3 (task failure).
Query data flow task Request ID
string
unique request ID, which is returned for each request. RequestId is required for locating a problem.

Operation Example

Retrieve real-time task status of data flow
./goosefsx-cli data_flow taskstatus --region=ap-shanghai --task-id=xxx --filesystem-id=xxx
Return Value
Query data flow task successfully!
=======================
Query data flow task ID: x_task_1676551831746
Query data flow task Request ID: fad14898-b975-423e-9588-7c5be84ad4e9
Query data flow task status: Data flow task status is 2, finished

Note:
task-id is the returned value for creating a data flow task.

Create a Data Flow Task and Return Result in Real Time

Create a data flow task and return the execution result, completed or failed.

Command Syntax

./goosefsx-cli data_flow createAndWaitFinish [flags]
The createAndWaitFinish command includes the following flags:
Flag Name
Flag Abbreviation
Description
--task-type
No
Data flow task type, FS_TO_COS (file system to COS Bucket) or COS_TO_FS (COS Bucket to file system)
--bucket
No
COS bucket name
--region
No
The region where the file system is located.
--filesystem-id
No
The file system ID.
--task-path
No
For FS_TO_COS, TaskPath is the relative path of the mapped directory in the Bucket. For COS_TO_FS, it is the path on COS. If left empty, it means all data.
--task-name
No
Task Name

Output Parameter

Parameter Name
Type
Description
Task ID
string
Create data flow task ID
Task Request ID
string
Create data flow task unique request ID, which is returned for each request. RequestId is required for locating a problem.
Query data flow task ID
string
Retrieve data flow task ID
Query data flow task Request ID
string
Retrieve data flow task unique request ID, which is returned for each request. RequestId is required for locating a problem.
Query data flow task status
string
Retrieve the status of data flow tasks, including the numbers 0 (initialization), 2 (completed), and 3 (task failure).

Operation Example

Creating a Data Flow Task
./goosefsx-cli data_flow createAndWaitFinish --task-type=COS_TO_FS --bucket=bucket_test-xxxx --region=ap-shanghai --filesystem-id=xxx --task-path=test/ --task-name=test
Return Value
Create data repository task successfully!
=======================
Task ID: x_task_1676553288519
Task Request ID: 2902f31e-4bfc-4709-828f-999072c92478
Query data flow task successfully!
=======================
Query data flow task ID: x_task_1676553288519
Query data flow task Request ID: ee9d0646-9c9b-4589-b661-f492631147af
Query data flow task status: Data flow task status is 2, completed


Loading Data Best Practices From Fusion Bucket

Execute two commands to load data from the fusion bucket. First, retrieve the file list of the fusion bucket, then load data from the fusion bucket according to the file list.

Prerequisites

Before use, create a data flow/associated bucket first. For details, see Managing GooseFSx Data Flow Rules.

Step 1: Retrieve Fusion Bucket File List

Get the file list, synchronously return the execution result, and save the file list to the specified file; the execution time varies with the data volume. For example, generating a file list for 4 million files takes over 6 minutes.

Command Syntax

./goosefsx-cli cos ls [flags]

Operation Example




Save file.list in the current directory.

Step 2: Load Data From Fusion Bucket According to File List

Load data from the COS fusion bucket based on the file list.

Command Syntax

./goosefsx-cli data_flow create [flags]

Operation Example





Check task status:



Log in to the console to check task status:

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback