Mount target
Create mount target
The following code can create a mount target for a specified CFS file system and return the associated domain.
1args := &cfs.CreateMountTargetArgs{
2 // File system instance ID
3 FSID: cfsId,
4 // Subnet ID
5 SubnetId: subnetId,
6 // Short VPC ID
7 VpcID: vpcId,
8}
9err := client.CreateMountTarget(args)
10if err != nil {
11 fmt.Println("create Mount Target failed:", err)
12} else {
13 fmt.Println("create Mount Target success")
14}
Note: For detailed parameter configurations and constraints, refer to the CFS API document Create Mount Target .
Query mount targets
The following code enables querying all mount target information for a specified CFS file system, with support for targeted queries by mount target. Results support marker-based pagination, with a default page size of 1,000, or a custom size configured via the maxKeys parameter.
1args := &cfs.DescribeMountTargetArgs{
2 // Target file system instance ID
3 FSID: cfsid,
4}
5result, err := client.DescribeMountTarget(args)
6if err != nil {
7 fmt.Println("describe Mount Target failed:", err)
8} else {
9 fmt.Println("describe Mount Target success: ", result)
10}
Note: For detailed parameter configurations and constraints, refer to the CFS API document Query Mount Target .
Delete mount target
The following code can delete the mount target for a specified CFS file system.
1args:=&cfs.DropMountTargetArgs{
2 // File system instance ID to be deleted
3 FSID: cfsId,
4 MountId: mountId,
5}
6err := client.DropMountTarget(args)
7if err != nil {
8 fmt.Println("delete Mount Target failed:", err)
9} else {
10 fmt.Println("delete Mount Target success: ")
11}
Note: For detailed parameter configurations and constraints, refer to the CFS API document Delete Mount Target.
