Querying the Usage of a Directory
Function
This API is used to query the usage 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 file system types (Standard, Standard-Enhanced, Performance, and Performance-Enhanced). 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.
URI
GET /v1/{project_id}/sfs-turbo/shares/{share_id}/fs/dir-usage
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
The project ID. |
share_id |
Yes |
String |
The file system ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
path |
Yes |
String |
The valid full path of a directory in the file system. |
Request 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
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
The request ID. |
Parameter |
Type |
Description |
---|---|---|
dir_usage |
FsDirUasge object |
The message description. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
The request ID. |
Parameter |
Type |
Description |
---|---|---|
errCode |
String |
The error code. |
errMsg |
String |
The error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
The request ID. |
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.