Help Center/ Host Security Service/ API Reference/ API Description/ Container Images/ Exporting Image Security Report Statistics
Updated on 2026-04-03 GMT+08:00

Exporting Image Security Report Statistics

Function

This API is used to export image security report statistics.

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

POST /v5/{project_id}/image/security-report/statistic

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

ID of the enterprise project that a server belongs.

An enterprise project can be configured only after the enterprise project function is enabled.

Enterprise project ID. The value 0 indicates the default enterprise project. To query servers in all enterprise projects, set this parameter to all_granted_eps. If you have only the permission on an enterprise project, you need to transfer the enterprise project ID to query the server in the enterprise project. Otherwise, an error is reported due to insufficient permission.

security_report_type

Yes

String

Security report type. The options are as follows:

  • vulnerability: vulnerability information

  • risk-config: baseline configuration information

  • malwares: malicious file information

  • apps: software information

  • files: file information

  • sensitive-info: sensitive information

  • non-compliant-app: software compliance information

  • build-command-risks: image building command risk

Request Parameters

Table 3 Request header 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

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

image_id_list

No

Array of strings

Definition

List of images to be exported. If operate_all is set to false, the batch query criteria need to be set. image_id indicates the image ID, which uniquely identifies an image (Note: For private images and shared images, the ID returned in the image list is used).

Constraints

N/A

Range

The value range is 0 to 2,147,483,647.

Default Value

N/A

operate_all

No

Boolean

Definition

If the value is true, all filter criteria can be queried.

Constraints

N/A

Range

  • true: yes.

  • false: no.

Default Value

N/A

image_type

No

String

Definition

Image type.

Constraints

N/A

Range

  • private_image: private image

  • shared_image: shared image

    • local_image: local image

    • instance_image: enterprise image

  • **harbor **: Harbor image

  • **jfrog **: Jfrog image

  • **cicd **: CI/CD image

Default Value

N/A

vul_type

No

String

Definition

Type

Constraints

N/A

Range

-linux_vul: Linux vulnerability

  • app_vul: application vulnerability

Default Value

N/A

scan_status

No

String

Definition

Scan status

Constraints

N/A

Range

  • unscan: not scanned

  • success: The scan is complete.

  • scanning

  • failed: The scan failed.

  • download_failed: The download failed.

  • image_oversized: The image is too large.

Default Value

N/A

namespace

No

String

Definition

Organization name. This parameter is available only for private and shared images.

Constraints

N/A

Range

The value can contain 0 to 65,535 characters.

Default Value

N/A

image_name

No

String

Definition

Image

Constraints

N/A

Range

The value can contain 0 to 65,535 characters.

Default Value

N/A

image_version

No

String

Definition

Image tag name

Constraints

N/A

Range

The value can contain 0 to 65,535 characters.

Default Value

N/A

image_id

No

String

Definition

Image ID.

Constraints

N/A

Range

The value can contain 0 to 128 characters.

Default Value

N/A

latest_version

No

Boolean

Definition

Display latest image versions only

Constraints

N/A

Range

  • true: yes.

  • false: no.

Default Value

N/A

image_size

No

Long

Definition

Image size

Constraints

N/A

Range

Minimum value: 0; maximum value: 2147483547

Default Value

N/A

start_latest_update_time

No

Long

Definition

Creation start date, in ms.

Constraints

N/A

Range

Minimum value: 0; maximum value: 2,147,483,547

Default Value

N/A

end_latest_update_time

No

Long

Definition

Creation end date, in ms.

Constraints

N/A

Range

Minimum value: 0; maximum value: 2,147,483,547

Default Value

N/A

start_latest_scan_time

No

Long

Definition

The start time of latest scan completion, in ms.

Constraints

N/A

Range

Minimum value: 0; maximum value: 2,147,483,547

Default Value

N/A

end_latest_scan_time

No

Long

Definition

End date of the latest scan completion time, in ms.

Constraints

N/A

Range

Minimum value: 0; maximum value: 2,147,483,547

Default Value

N/A

has_malicious_file

No

Boolean

Definition

Whether there are malicious files

Constraints

N/A

Range

  • true: yes.

  • false: no.

Default Value

N/A

has_vul

No

Boolean

Definition

Whether there are software vulnerabilities

Constraints

N/A

Range

  • true: yes.

  • false: no.

Default Value

N/A

has_unsafe_setting

No

Boolean

Definition

Whether there are baseline checks.

Constraints

N/A

Range

  • true: yes.

  • false: no.

Default Value

N/A

risky

No

Boolean

Definition

Whether there are security risks

Constraints

N/A

Range

  • true: yes.

  • false: no.

Default Value

N/A

severity_level

No

String

Definition

Image risk level, which is displayed after the image scan is complete.

Constraints

N/A

Range

  • Security

  • Low

  • Medium

  • High

Default Value

N/A

instance_name

No

String

Definition

Enterprise image instance name

Constraints

N/A

Range

The value can contain 0 to 128 characters.

Default Value

N/A

instance_id

No

String

Definition

ID of an SWR Enterprise Edition instance.

Constraints

N/A

Range

The value can contain 0 to 128 characters.

Default Value

N/A

cicd_name

No

String

Definition

CI/CD name.

Constraints

N/A

Range

Length: 0 to 128 characters

Default Value

N/A

build_command_risk_level

No

String

Definition

Risk level of a building instruction.

Constraints

N/A

Range

  • critical

  • high

  • medium

  • low

Default Value

N/A

build_command_risk_name

No

String

Definition

Name of a building instruction risk.

Constraints

N/A

Range

The value can contain 1 to 128 characters.

Default Value

N/A

build_command_rule_id_list

No

Array of strings

Definition

List of the IDs of build instruction risk detection rules to be exported. The value of rule_id can be obtained from the return parameter of the /v5/{project_id}/image/build-command-risks API.

Constraints

N/A

Range

The value can contain 1 to 200 characters.

Default Value

N/A

has_container

No

Boolean

Definition

Whether there are containers.

Constraints

N/A

Range

  • true: yes.

  • false: no.

Default Value

N/A

vul_id_list

No

Array of strings

Definition

Vulnerability ID list for the image vulnerability export.

Constraints

N/A

Range

The value range is 0 to 2048.

Default Value

N/A

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

total_num

Long

Total number of exported records

Example Requests

{
  "operate_all" : true
}

Example Responses

Status code: 200

Request succeeded.

{
  "total_num" : 1
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.