Querying the Usage of a File System Directory
Function
This API is used to query the usage of a file system directory (including usages of subdirectories). The obtained data may not be the latest as there is a 5-minute delay between the frontend and backend.
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 a long 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 |
Project ID |
share_id |
Yes |
String |
File system ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
path |
Yes |
String |
Valid full path of a directory in the file system |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Account token |
Content-Type |
Yes |
String |
MIME type, which can be application or json |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
Request ID |
Parameter |
Type |
Description |
---|---|---|
dir_usage |
FsDirUasge object |
Message description |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
Request ID |
Parameter |
Type |
Description |
---|---|---|
errCode |
String |
Error code |
errMsg |
String |
Error description |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
X-request-id |
String |
Request ID |
Parameter |
Type |
Description |
---|---|---|
errCode |
String |
Error code |
errMsg |
String |
Error description |
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
Directory resource usages
{ "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 |
Directory resource usages |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot