File system

CFS

  • Updates and Announcements
    • Function Release Records
    • Product Announcement
      • Announcement on CFS Metric Adjustments
  • Product Description
    • Product Introduction
    • Basic concepts
    • Product features
    • Product specifications
    • Usage Limits and Recommendations
    • Selection Guide
      • How to Choose Between CFS and PFS
      • How to Choose Between CFS, BOS and CDS
    • Application scenarios
  • Product pricing
    • Pay-as-you-go
    • Storage package billing
    • Insufficient balance reminders and debt handling
    • Billing Cases
  • Quick Start
    • Getting Started Overview
    • Quick start (Linux)
    • Quick start (Windows)
  • Operation guide
    • Activate Service
    • Manage File System
      • Create file system
      • Delete a file system
      • View file system details
      • Set File System Capacity Upper Limit
    • Mount and Access
      • Add mount target
      • Mount and Unmount CFS on BCC
        • Mount and Unmount on Linux System
          • Mount and Unmount SMB Protocol CFS on Single BCC
          • Batch mounting and unmounting NFS CFS on multiple BCC
          • Mounting and unmounting NFS CFS on a single BCC
        • Mount and Unmount SMB Protocol CFS on Windows System
        • Mount CFS File System When Purchasing New BCC
      • Using CFS in CCE
    • Permission Group Management
    • Identity and access management
    • Data encryption
    • Management Tags
    • Backup
    • Monitor and Alarm
      • View monitoring
      • Alarm management
      • Metric definition
    • Cloud Audit
  • Typical Practices
    • Set Different User Permissions for Different Directories
    • Using File Systems Across Regions Or Accounts
    • Use SFTP to Upload and Download CFS File System Data
    • Use Rsync to Sync From Old File System to CFS File System
    • Best Practices for Managing CFS with Terraform
    • Performance Testing Methods
      • Linux System Performance Testing Methods
      • Windows System Performance Testing Methods
  • API Reference
    • API Function Update Records
    • API Overview
    • Interface Overview
    • General Description
    • Service domain
    • Error code
    • File System Related Interfaces
      • Create file system
      • Update file system
      • Query file system
      • Query mount client
      • Drop file system
      • Update file system tags
    • mount target Related Interfaces
      • Create mount target
      • Query mount targets
      • Delete mount target
    • Permission Group-related APIs
      • Create Permission Group
      • Update permission group
      • Query Permission Groups
      • Delete permission group
      • Create permission group rules
      • Update permission group rules
      • Query permission group rules
      • Delete permission group rule
    • Data type
  • Go-SDK
    • Overview
    • Initialization
    • File system
    • Mount target
    • Error handling
  • FAQs
    • Common Questions Overview
    • General Problems
    • Billing Problems
    • NFS protocol questions
    • SMB Protocol Issues
  • Service Level Agreement (SLA)
    • CFS Service Level Agreement (SLA)
All documents
menu
No results found, please re-enter

CFS

  • Updates and Announcements
    • Function Release Records
    • Product Announcement
      • Announcement on CFS Metric Adjustments
  • Product Description
    • Product Introduction
    • Basic concepts
    • Product features
    • Product specifications
    • Usage Limits and Recommendations
    • Selection Guide
      • How to Choose Between CFS and PFS
      • How to Choose Between CFS, BOS and CDS
    • Application scenarios
  • Product pricing
    • Pay-as-you-go
    • Storage package billing
    • Insufficient balance reminders and debt handling
    • Billing Cases
  • Quick Start
    • Getting Started Overview
    • Quick start (Linux)
    • Quick start (Windows)
  • Operation guide
    • Activate Service
    • Manage File System
      • Create file system
      • Delete a file system
      • View file system details
      • Set File System Capacity Upper Limit
    • Mount and Access
      • Add mount target
      • Mount and Unmount CFS on BCC
        • Mount and Unmount on Linux System
          • Mount and Unmount SMB Protocol CFS on Single BCC
          • Batch mounting and unmounting NFS CFS on multiple BCC
          • Mounting and unmounting NFS CFS on a single BCC
        • Mount and Unmount SMB Protocol CFS on Windows System
        • Mount CFS File System When Purchasing New BCC
      • Using CFS in CCE
    • Permission Group Management
    • Identity and access management
    • Data encryption
    • Management Tags
    • Backup
    • Monitor and Alarm
      • View monitoring
      • Alarm management
      • Metric definition
    • Cloud Audit
  • Typical Practices
    • Set Different User Permissions for Different Directories
    • Using File Systems Across Regions Or Accounts
    • Use SFTP to Upload and Download CFS File System Data
    • Use Rsync to Sync From Old File System to CFS File System
    • Best Practices for Managing CFS with Terraform
    • Performance Testing Methods
      • Linux System Performance Testing Methods
      • Windows System Performance Testing Methods
  • API Reference
    • API Function Update Records
    • API Overview
    • Interface Overview
    • General Description
    • Service domain
    • Error code
    • File System Related Interfaces
      • Create file system
      • Update file system
      • Query file system
      • Query mount client
      • Drop file system
      • Update file system tags
    • mount target Related Interfaces
      • Create mount target
      • Query mount targets
      • Delete mount target
    • Permission Group-related APIs
      • Create Permission Group
      • Update permission group
      • Query Permission Groups
      • Delete permission group
      • Create permission group rules
      • Update permission group rules
      • Query permission group rules
      • Delete permission group rule
    • Data type
  • Go-SDK
    • Overview
    • Initialization
    • File system
    • Mount target
    • Error handling
  • FAQs
    • Common Questions Overview
    • General Problems
    • Billing Problems
    • NFS protocol questions
    • SMB Protocol Issues
  • Service Level Agreement (SLA)
    • CFS Service Level Agreement (SLA)
  • Document center
  • arrow
  • CFS
  • arrow
  • Go-SDK
  • arrow
  • File system
Table of contents on this page
  • Create file system
  • Update file system
  • Query existing file system
  • Drop file system

File system

Updated at:2025-11-11

Create file system

Use the following code to create a CFS file system and retrieve its corresponding file system ID.

Plain Text
1args := &cfs.CreateFSArgs{
2    ClientToken: "be31b98c-5e41-4838-9830-9be700de5a20",
3 Name:        "sdkCFS", // Set the instance name
4 VpcID:        vpcId, // Set the vpc to which the instance belongs
5 Protocol:     protocol, // Set the instance protocol type: 1.nfs 2.smb
6 Zone:         zone, // Set the availability zone of the instance
7}
8result, err := cfsClient.CreateFS(args)
9if err != nil {
10    fmt.Println("create cfs failed:", err)
11} else {
12    fmt.Println("create cfs success: ", result)
13}

Note: For detailed parameter configurations and constraints, refer to the CFS API document Create File System.

Update file system

Use the following code to update the configuration details of a CFS file system, such as its name.

Plain Text
1args := &cfs.UpdateFSArgs{
2 FSID:       "cfs-xxxxx",  // Instance ID
3    FSName:     "testSdk",  
4}
5err := cfsClient.UpdateFS(args)
6if err != nil {
7    fmt.Println("update cfs failed:", err)
8} else {
9    fmt.Println("update cfs success")
10}

Note: For detailed parameter configurations and constraints, refer to the CFS API document Update File System.

Query existing file system

The following code can be used to query all CFS file system information under the user account

Plain Text
1args := &cfs.DescribeFSArgs{}
2 // Support filtering by fsId and userId, with matching rules allowing partial matches (do not support regular expressions)
3args.FSID = cfsId
4args.UserId = userId
5result, err := cfsClient.DescribeFS(args)
6if err != nil {
7    fmt.Println("list all cfs failed:", err)
8} else {
9    fmt.Println("list all cfs success: ", result)
10}

Note: For detailed parameter configurations and constraints, refer to the CFS API document Query File System.

Drop file system

Use the following code to delete a specific CFS file system. Be aware that a released CFS file system cannot be recovered (you must delete mount targets first; otherwise, the instance cannot be deleted).

Plain Text
1args := &cfs.DropFSArgs{}
2args.FSID = cfsId
3err := client.DropFS(args)
4if err != nil {
5    fmt.Println("delete cfs failed:", err)
6} else {
7    fmt.Println("delete cfs success")
8}

Note: For detailed parameter configurations and constraints, refer to the CFS API document Drop File System.

Previous
Initialization
Next
Mount target