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
File systems created after August 1, 2023 support this API operation. This API applies only to the previous-generation SFS Turbo file systems (standard, standard-enhanced, performance, and performance-enhanced). 20MB/s/TiB, 40MB/s/TiB, 125MB/s/TiB, 250 MB/s/TiB Use the API for creating an asynchronous task for a file system. If the number of concurrent requests of this API is too large, the file system performance may be affected. You are advised to submit a maximum of four query requests at the same time. It takes a long time to query oversized directories. Do not submit the query 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 |
Parameter | Type | Description |
---|---|---|
used_capacity | Long | Used capacity, in byte |
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.
- Function
- Constraints
- URI
- Request Parameters
- Response Parameters
- Example Requests
- Example Responses
- Status Codes
- Error Codes