Updated on 2025-09-30 GMT+08:00

Querying the CI/CD Image List

Function

This API is used to query the CI/CD image list.

Calling Method

For details, see Calling APIs.

URI

GET /v5/{project_id}/image/cicd/images

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 1 to 256 characters.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Definition

Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID.

To query assets in all enterprise projects, set this parameter to all_granted_eps.

Constraints

You need to set this parameter only after the enterprise project function is enabled.

Range

The value can contain 1 to 256 characters.

Default Value

0: default enterprise project.

namespace

No

String

Definition

Organization name.

Constraints

N/A

Range

Length: 1 to 128 characters

Default Value

N/A

image_name

No

String

Definition

Image name.

Range

Length: 1 to 128 characters

image_version

No

String

Definition

Image tag.

Range

Length: 1 to 64 characters

sort_key

No

String

Definition

Sorting field.

Constraints

N/A

Range

  • latest_scan_time: latest scan time

Default Value

N/A

sort_dir

No

String

Definition

Sorting order.

Constraints

N/A

Range

  • asc: ascending

  • desc: descending

Default Value

Sort in ascending order.

limit

No

Integer

Parameter description:

Number of records displayed on each page.

Constraints:

N/A

Options:

Value range: 10-200

Default value:

10

offset

No

Integer

Definition

Offset, which specifies the start position of the record to be returned.

Constraints

N/A

Range

The value range is 0 to 2,000,000.

Default Value

The default value is 0.

image_id

No

String

Definition

CI/CD image identifier.

Constraints

N/A

Range

Length: 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

latest_version

No

Boolean

Definition

Display latest image versions only

Constraints

N/A

Range

  • true

  • false

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

scan_status

No

String

Definition

Scan status

Constraints

N/A

Range

  • unscan: not scanned

  • success: The scan is complete.

  • scanning: The scan is in progress.

  • failed: The scan failed.

  • waiting_for_scan: waiting for scan

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: 9223372036854775807

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: 9223372036854775807

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: 9223372036854775807

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: 9223372036854775807

Default Value

N/A

has_malicious_file

No

Boolean

Definition

Whether there are malicious files

Constraints

N/A

Range

  • true

  • false

Default Value

N/A

has_unsafe_setting

No

Boolean

Definition

Whether there are baseline checks.

Constraints

N/A

Range

  • true

  • false

Default Value

N/A

has_vul

No

Boolean

Definition

Whether there are software vulnerabilities

Constraints

N/A

Range

  • true

  • false

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: secure

  • Low: low-risk

  • Medium: medium-risk

  • High: high-risk

Default Value

N/A

risky

No

Boolean

Definition

There are security risks.

Constraints

N/A

Range

  • true

  • false

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token.

Constraints

N/A

Range

The value can contain 1 to 32,768 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_num

Integer

Definition

Total number of CI/CD images

Range

Minimum value: 0; maximum value: 2147483547

data_list

Array of CICDImageResponseInfo objects

Definition

CI/CD image list

Range

Minimum value: 0; maximum value: 200

Table 5 CICDImageResponseInfo

Parameter

Type

Description

image_id

String

Definition

CI/CD image identifier.

Range

Length: 0 to 128 characters

cicd_name

String

Definition

CI/CD name.

Range

Length: 0 to 128 characters

namespace

String

Definition

Namespace

Range

Length: 0 to 64 characters

image_name

String

Definition

Image name.

Range

Length: 0 to 128 characters

image_digest

String

Definition

Image digest.

Range

Length: 0 to 128 characters

image_version

String

Definition

Image tag.

Range

Length: 0 to 64 characters

registry_name

String

Definition

Image repository name.

Range

Length: 1 to 128 characters

image_type

String

Definition

Image type.

Range

  • **cicd **: CI/CD image

registry_type

String

Definition

Image repository type.

Range

  • **cicd **: CI/CD image

latest_version

Boolean

Definition

Whether the version is the latest.

Range

  • true

  • false

scan_status

String

Definition

Scan status

Range

  • unscan: not scanned

  • success: The scan is complete.

  • scanning: The scan is in progress.

  • failed: The scan failed.

  • download_failed: The download failed.

  • image_oversized: The image is too large.

  • waiting_for_scan: waiting for scan

scan_failed_desc

String

Definition

Cause of the scan failure. The options are as follows:

  • Unknown error.

  • Authentication failed.

  • Image download failed. Contact technical support.

  • The image is too large and cannot be scanned. Reduce the image size.

  • Image details failed to be obtained. The image is not found in the repository. Synchronize the latest images.

  • The image has too many layers and cannot be scanned. Reduce the image size.

  • Vulnerability scan failed.

  • File scan failed.

  • Software scan failed.

  • Failed to check sensitive information.

  • Baseline check failed.

  • Software compliance check failed.

  • Failed to query basic image information.

  • Response timed out.

  • Database error.

  • Failed to send the scan request.

Range

Length: 0 to 128 characters

scan_failed_code

String

Definition

Cause code of the scan failure. The options are as follows:

  • unknown_error

  • authentication_failed

  • download_failed

  • image_over_sized

  • get_detail_info_not_found

  • image_layer_over_sized

  • failed_to_scan_vulnerability

  • failed_to_scan_file

  • failed_to_scan_software

  • failed_to_check_sensitive_information

  • failed_to_check_baseline

  • failed_to_check_software_compliance

  • failed_to_query_basic_image_information

  • response_timed_out

  • database_error

  • failed_to_send_the_scan_request

Range

Length: 0 to 64 characters

image_size

Long

Definition

Image size.

Range

Minimum value: 0; maximum value: 2147483547

latest_update_time

Long

Definition

Last update time of the image tag, in ms.

Range

Minimum value: 0; maximum value: 9223372036854775807

latest_scan_time

Long

Definition

Last scanned, in ms.

Range

Minimum value: 0; maximum value: 9223372036854775807

vul_num

Integer

Definition

Number of vulnerabilities

Range

Minimum value: 0; maximum value: 2147483647

unsafe_setting_num

Integer

Definition

Number of settings that failed the baseline check

Range

Minimum value: 0; maximum value: 2147483647

malicious_file_num

Integer

Definition

Number of malicious files

Range

Minimum value: 0; maximum value: 2147483647

severity_level

String

Definition

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

Range

  • Security: secure

  • Low: low-risk

  • Medium: medium-risk

  • High: high-risk

Example Requests

None

Example Responses

Status code: 200

Request succeeded.

{
  "total_num" : 1,
  "data_list" : {
    "image_digest" : "sha256:cebcdacde18091448a5040dc55bb1a9f6540b093db8XXXXXX",
    "image_id" : "cebcdacde18091448a5040dc55bb1a9f6540b093db8XXXXXX",
    "image_name" : "centos7",
    "image_size" : "1,000 (bytes)",
    "image_type" : "cicd",
    "image_version" : "common",
    "latest_scan_time" : 1691748641788,
    "latest_update_time" : 1687664346000,
    "latest_version" : false,
    "malicious_file_num" : 0,
    "namespace" : "aaa",
    "scan_status" : "success",
    "unsafe_setting_num" : 1,
    "vul_num" : 111
  }
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.hss.v5.region.HssRegion;
import com.huaweicloud.sdk.hss.v5.*;
import com.huaweicloud.sdk.hss.v5.model.*;


public class ListCicdImagesSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        HssClient client = HssClient.newBuilder()
                .withCredential(auth)
                .withRegion(HssRegion.valueOf("<YOUR REGION>"))
                .build();
        ListCicdImagesRequest request = new ListCicdImagesRequest();
        try {
            ListCicdImagesResponse response = client.listCicdImages(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkhss.v5.region.hss_region import HssRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkhss.v5 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = HssClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(HssRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListCicdImagesRequest()
        response = client.list_cicd_images(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    hss "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := hss.NewHssClient(
        hss.HssClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListCicdImagesRequest{}
	response, err := client.ListCicdImages(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.