Query file system
Updated at:2025-11-11
Description
- Query all FileSystem information under the user account
- Support filtering by fsId and userId, with matching rules allowing partial matches
- The response result is the intersection of multiple query conditions.
- Results support marker-based pagination, with a default page size of 1000, which can be specified via the maxKeys parameter.
Request
Request structure
Bash
1GET /v{version}/cfs?fsId={fsId}&userId={userId}&marker={marker}&maxKeys={maxKeys}&filterTag={filterTag} HTTP/1.1
2Host: cfs.bj.baidubce.com
3Authorization: authorization string
Request headers: No special headers beyond common headers
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| userId | String | Yes | Query | Query the user ID to which the file system belongs |
| fsId | String | No | Query | FileSystem IDs support batch queries (maximum count: 100), formatted as fsId=fsIdA, fsIdB, fsIdC. |
| marker | String | No | Query | The starting position of the batch list query is a system-generated string |
| maxKeys | int | No | Query | Maximum number of items per page is 1,000, with a default value of 1000. |
| filterTag | String | No | Query | {key}:{value} format query all values under key as {key}:@@@ |
Response
Response status code: Respond with 200 after successful operation, and respond with error codes after failed operation, as shown in Error Codes
Response headers: No special headers beyond common headers
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| fileSystemList | List<[FileSystemModel](CFS/API Reference/Data type.md#FileSystemModel)> | List containing query results |
| marker | String | Marker indicating the starting position of the query. If the result list is empty, this field does not exist. |
| isTruncated | boolean | true indicates there is more data later, false indicates it is the last page |
| nextMarker | String | The marker value needed to fetch the next page. This field is absent when isTruncated is false. |
| maxKeys | int | Number of items included in the results per page |
Example
Request:
Bash
1GET /v1/cfs?fsId=cfs-jVDkWrBBoj&maxKeys=2 HTTP/1.1
2Host: cfs.bj.baidubce.com
3Authorization: bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
Response
Bash
1HTTP/1.1 200 OK
2x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
3Date: Wed, 10 Apr 2016 08:26:52 GMT
4Transfer-Encoding: chunked
5Content-Type: application/json;charset=UTF-8
6Server: BWS
7{
8 "isTruncated": false,
9 "maxKeys": 1,
10 "fileSystemList": [
11 {
12 "fsId": "cfs-jVDkWrBBoj",
13 "fsName": "test-cfs",
14 "vpcId": "",
15 "type": "ssd",
16 "protocol": "nfs",
17 "fsUsage": "0",
18 "zone": "zoneB",
19 "status": "available",
20 "KMSKeyId": "xxxxxxx",
21 "createTime": "2023-11-29T11:19:43Z",
22 "capacityQuota": 0,
23 "mountTargetList": [
24 {
25 "accessGroupName": "DEFAULT_ACCESS_GROUP_NAME",
26 "mountId": "664d336f357447706c794d48304f5a306a5369317a413d3d",
27 "ovip": "192.168.5.242",
28 "domain": "cfs-Y1uZ26QOoh.lb-f02bb5da.cfs.bce.sandbox.baidu.com",
29 "subnetId": "sbn-2ge2ucwhf8ut",
30 "vpcId": "vpc-vjf1mdpq9pkf"
31 }
32 ],
33 "tags": [
34 {
35 "tagKey": "Default project",
36 "tagValue": "123"
37 }
38 ]
39 }
40 ]
41}
