Updated on 2025-11-14 GMT+08:00

Querying the Usage of a Directory

Function

This API is used to query the usages of a directory (including usages of subdirectories). The obtained data may not be the latest as there is a 5-minute delay between the frontend and background.

Constraints

This API is only supported for file systems created after August 1, 2023. This API is only supported for previous-generation SFS Turbo file systems, including Standard-Enhanced, Performance-Enhanced, Standard and Performance. For 1,000 MB/s/TiB, 500 MB/s/TiB, 250 MB/s/TiB, 125 MB/s/TiB, 40 MB/s/TiB, and 20 MB/s/TiB file systems, use the API for creating asynchronous tasks. You are advised not to submit five or more requests at a time, or the file system performance may be affected. It takes some time to query an oversized directory. Do not submit the request repeatedly.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

GET /v1/{project_id}/sfs-turbo/shares/{share_id}/fs/dir-usage

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

The project ID.

share_id

Yes

String

The file system ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

path

Yes

String

The valid full path of a directory in the file system.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

The account token.

Content-Type

Yes

String

The MIME type, which can be application or json.

Response Parameters

Status code: 200

Table 4 Response header parameters

Parameter

Type

Description

X-request-id

String

The request ID.

Table 5 Response body parameters

Parameter

Type

Description

dir_usage

FsDirUasge object

The message description.

Table 6 FsDirUasge

Parameter

Type

Description

used_capacity

Long

The used capacity, in bytes.

Status code: 400

Table 7 Response header parameters

Parameter

Type

Description

X-request-id

String

The request ID.

Table 8 Response body parameters

Parameter

Type

Description

errCode

String

The error code.

errMsg

String

The error message.

Status code: 500

Table 9 Response header parameters

Parameter

Type

Description

X-request-id

String

The request ID.

Table 10 Response body parameters

Parameter

Type

Description

errCode

String

The error code.

errMsg

String

The error message.

Example Requests

Querying the directory usage of a Standard file system whose ID is 77ba6f4b-6365-4895-8dda-bc7142af4dde

GET HTTPS://{endpoint}/v1/{project_id}/sfs-turbo/shares/77ba6f4b-6365-4895-8dda-bc7142af4dde/fs/dir-usage

Example Responses

Status code: 200

The directory resource usage.

{
  "dir_usage" : {
    "used_capacity" : 1024000
  }
}

Status code: 400

Error response

{
  "errCode" : "SFS.TURBO.0102",
  "errMsg" : "Path is not directory"
}

Status code: 500

Error response

{
  "errCode" : "SFS.TURBO.0005",
  "errMsg" : "Internal server error"
}

Status Codes

Status Code

Description

200

The directory resource usage.

400

Error response

500

Error response

Error Codes

See Error Codes.