Help Center/ Host Security Service/ API Reference/ API Description/ Container Images/ Scanning Images in the Image Repository in Batches (Deprecated)
Updated on 2026-04-03 GMT+08:00

Scanning Images in the Image Repository in Batches (Deprecated)

Function

This API is used to scan images in the image repository in batches. (Deprecated)

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/batch-scan

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.

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 a token.

region

No

String

Region ID

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

repo_type

No

String

Repository type. (Deprecated)

image_info_list

No

Array of BatchScanSwrImageInfo objects

Specifies the list of images to be scanned. This parameter is mandatory when operate_all is false.

operate_all

No

Boolean

If this parameter is set to true, all filter criteria can be used for full query. If image_info_list is empty, this parameter is mandatory.

namespace

No

String

Organization name

image_name

No

String

Image name

image_version

No

String

Image tag

image_type

Yes

String

Image type. Its value can be:

  • private_image: SWR private image repository

  • shared_image: SWR shared image repository

  • instance_image: SWR enterprise repository

scan_status

No

String

Scan status. The options are as follows:

  • unscan

  • success

  • scanning

  • failed

  • download_failed

  • image_oversized

latest_version

No

Boolean

Display latest image versions only

image_size

No

Long

Image size

start_latest_update_time

No

Long

Creation start date, in ms.

end_latest_update_time

No

Long

Creation end date, in ms.

start_latest_scan_time

No

Long

Start date of latest scan completion time, in ms.

end_latest_scan_time

No

Long

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

Table 5 BatchScanSwrImageInfo

Parameter

Mandatory

Type

Description

namespace

No

String

Namespace

image_name

No

String

Image name

image_version

No

String

Image tag

instance_id

No

String

Enterprise instance ID

instance_url

No

String

Downloading the enterprise image URL

Response Parameters

Status code: 200

Request succeeded.

None

Example Requests

  • Scan private images in batches. The request body transfers the image list and operate_all does not contain any parameter, indicating that the image list needs to be scanned in batches.

    POST https://{endpoint}/v5/{project_id}/image/batch-scan
    
    {
      "image_type" : "private_image",
      "image_info_list" : [ {
        "image_name" : "openjdk",
        "image_version" : "v8.8",
        "namespace" : "test"
      }, {
        "image_name" : "openjdk1",
        "image_version" : "v1.0",
        "namespace" : "test1"
      } ]
    }
  • Perform a full scan for private images. The request body does not transfer the image list and operate_all is set to true, indicating that the image list needs to be fully scanned.

    POST https://{endpoint}/v5/{project_id}/image/batch-scan
    
    {
      "image_type" : "private_image",
      "operate_all" : true
    }

Example Responses

None

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.