Querying Image File Statistics
Function
This API is used to query the image file statistics. For a CI/CD image, only the image_id parameter needs to be specified. The organization name, image name, and image tag are not required. For other image types, the organization name, image name, and image tag are mandatory.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
GET /v5/{project_id}/image/{image_id}/files-statistics
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. |
| image_id | Yes | String | Image ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| enterprise_project_id | No | String | ID of the enterprise project that the server belongs to. An enterprise project can be configured only after the enterprise project function is enabled. The default value of an enterprise project ID is 0, indicating the default enterprise project. To query servers in all enterprise projects, set this parameter to all_granted_eps. If you only have the permissions for a specific enterprise project, to query a server in the project, specify the enterprise project ID. Otherwise, an error will be reported due to insufficient permission. |
| image_type | Yes | String | Image type. Its value can be: |
| namespace | No | String | Organization name. |
| image_name | No | String | Image name. |
| tag_name | No | String | Image tag name |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
| region | Yes | String | Region ID |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total_files_num | Integer | Total number of image files |
| total_files_size | Integer | Image File Size |
Example Requests
-
Query image file statistics in the image repository.
GET https://{endpoint}/v5/{project_id}/image/sha256:0b08c2b4162c7007fba407806554a0b4f56bfcfa6b93c2644ebd2d1decd7ee53/files-statistics?limit=10&offset=0&namespace=scc_hss_container&tag_name=24.5.0-x86_64&image_name=proxy-agent&image_id=sha256:0b08c2b4162c7007fba407806554a0b4f56bfcfa6b93c2644ebd2d1decd7ee53&repo_type=0&image_type=private_image&enterprise_project_id=all_granted_eps -
Query the file statistics of the CI/CD image whose image_id is 111.
GET https://{endpoint}/v5/{project_id}/image/111/files-statistics?limit=10&offset=0&type=linux_vul&image_type=cicd&enterprise_project_id=all_granted_eps
Example Responses
Status code: 200
Request succeeded.
{
"total_files_num" : 11,
"total_files_size" : 11
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
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