Querying the Local Image List
Function
This API is used to query the local image list.
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/local-repositories
|
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 |
|
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. |
|
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. |
|
limit |
No |
Integer |
Definition Number of records displayed on each page. Constraints N/A Range Value range: 10-200 Default Value 10 |
|
image_name |
No |
String |
Definition Local image name, which is used to filter the list of local images with a specified name. Constraints Partial matching is supported. For example, if web is entered, all images whose names contain web can be matched. The value is case sensitive. Range The value can contain 1 to 256 characters, including letters, numbers, hyphens (-), underscores (_), and periods (.). Special characters, including @#$%, are not allowed. Default Value None |
|
image_version |
No |
String |
Definition Local image version, which is used to filter the local image of a specified version. This parameter must be used together with image_name. Constraints This parameter is valid only when image_name is specified. Otherwise, the filter criteria do not take effect. Range The value can contain 1 to 128 characters, including letters, numbers, hyphens, underscores, periods, and colons. Default Value None |
|
scan_status |
No |
String |
Definition Security scan status of a local image. It is used to filter images with a specified scan status. Constraints The value must be within the specified range and is case sensitive. Otherwise, an empty result will be returned. Range Default Value None |
|
local_image_type |
No |
String |
Definition Storage source type of a local image. It is used to filter local images of different sources. Constraints The value must be within the specified range and is case sensitive. Otherwise, an empty result will be returned. Range Default Value None |
|
image_size |
No |
Long |
Definition Size of a local image, in bytes. It is used to filter images of a specified size (exact match). Constraints Only exact match is supported. If range filtering is required, adaptation at the service layer is required. Range The value range is 0 to 9,223,372,036,854,775,807 (about 9 EB). Default Value None |
|
start_latest_update_time |
No |
Long |
Definition Beginning of the last update time (Unix timestamp, in ms) of a local image version. It is used together with end_latest_update_time to specify the time range for filtering. Time Format Unix timestamp (for example, 1697509433000 indicates 2023-10-16 10:23:53). Constraints This parameter must be used together with end_latest_update_time and be earlier than end_latest_update_time. Otherwise, the filtering is invalid. Range The value range is 0 to 9,223,372,036,854,775,807. Default Value None |
|
end_latest_update_time |
No |
Long |
Definition Ending of the last update time (Unix timestamp, in ms) of a local image version. It is used together with start_latest_update_time to specify the time range for filtering. Time Format Unix timestamp (for example, 1709973506292 indicates 2024-03-08 15:18:26). Constraints This parameter must be used together with start_latest_update_time and be earlier than start_latest_update_time. Otherwise, the filtering is invalid. Range The value range is 0 to 9,223,372,036,854,775,807. Default Value None |
|
start_latest_scan_time |
No |
Long |
Definition Beginning of the last scan completion time (Unix timestamp, in ms) of a local image version. It is used together with end_latest_scan_time to specify the time range for filtering. Time Format Unix timestamp (accurate to milliseconds) Constraints This parameter is valid only for images whose scan_status is success. It must be used together with end_latest_scan_time. Range The value range is 0 to 9,223,372,036,854,775,807. Default Value None |
|
end_latest_scan_time |
No |
Long |
Definition Ending of the last scan completion time (Unix timestamp, in ms) of a local image version. It is used together with start_latest_scan_time to specify the time range for filtering. Time Format Unix timestamp (accurate to milliseconds) Constraints This parameter is valid only for images whose scan_status is success. The value must be greater than start_latest_scan_time. Range The value range is 0 to 9,223,372,036,854,775,807. Default Value None |
|
has_vul |
No |
Boolean |
Definition It specifies whether to filter local images that have software vulnerabilities. true indicates that images with vulnerabilities are filtered. false indicates that images without vulnerabilities are filtered. Constraints This parameter is valid only for images whose scan_status is success. Unscanned images are not filtered. Range true (vulnerabilities detected), false (no vulnerabilities detected) Default Value None (Items are not filtered by vulnerability status.) |
|
host_name |
No |
String |
Definition Name of the cloud server associated with a local image. It is used to filter the local image associated with a specified server. Constraints Fuzzy match is supported. The value is case-sensitive. This parameter is valid only for images associated with servers. Range The value can contain 1 to 64 characters, including letters, numbers, hyphens (-), and underscores (_). Special characters are not allowed. Default Value None |
|
host_id |
No |
String |
Definition Unique ID of the cloud server associated with a local image. It is used to accurately filter the local image associated with a specified server. Constraints Exact match. This parameter is valid only for images associated with a server. Range The value can contain 1 to 64 characters, including letters, numbers, and hyphens (-). Default Value None |
|
host_ip |
No |
String |
Definition Public or private IP address of the server associated with a local image. It is used to filter the local image associated with a specified server. Constraints IPv4 addresses are supported. Exact match is applied. Multiple IP addresses are queried in batches at the service layer. Range A string in IPv4 format. Default Value None |
|
container_id |
No |
String |
Definition Unique ID (Docker container ID) of the container associated with a local image. It is used to accurately filter the local image associated with a specified container. Constraints Exact match. This parameter is valid only for images associated with a container. Range The value can contain 1 to 64 characters, including letters, numbers, hyphens (-), and underscores (_). Default Value None |
|
container_name |
No |
String |
Definition Name of the container associated with a local image. It is used to filter the local image associated with a specified container. Constraints Fuzzy match is supported. The value is case-sensitive. This parameter is valid only for images associated with containers. Range The value can contain 1 to 64 characters, including letters, numbers, hyphens, underscores, and periods. Default Value None |
|
pod_id |
No |
String |
Definition Unique ID of the Kubernetes pod associated with a local image. It is used to accurately filter the local image associated with a specified pod. Constraints Exact match. This parameter is valid only for images associated with pods in the Kubernetes environment. Range The value can contain 1 to 64 characters, including letters, numbers, and hyphens (-). Default Value None |
|
pod_name |
No |
String |
Definition Name of the Kubernetes pod associated with a local image. It is used to filter the local image associated with a specified pod. Constraints Fuzzy match is supported. The value is case-sensitive. This parameter is valid only for images associated with pods in the Kubernetes environment. Range The value is a string of 1 to 63 characters, including letters, numbers, and hyphens (-), and cannot start or end with a hyphen (-). Default Value None |
|
app_name |
No |
String |
Definition Name of the application software (such as Nginx and MySQL) deployed in the local image. It is used to filter the local image that contains a specified application. Constraints Fuzzy match is supported. The value is case-sensitive. This parameter is valid only for images of identified applications. Range The value can contain 1 to 64 characters, including letters, numbers, hyphens (-), and underscores (_). Default Value None |
|
has_container |
No |
Boolean |
Definition Whether a local image is associated with a container. Range Default Value None (Items are not filtered by container association status.) |
Request 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
|
Parameter |
Type |
Description |
|---|---|---|
|
total_num |
Integer |
Definition Total number of local images that meet all filter criteria. It is used to calculate the total number of pages. Range The value range is 0 to 2,147,483,647. |
|
data_list |
Array of ImageLocalInfo objects |
Definition It contains details about the queried local images. Each element corresponds to the complete information about a local image. Range The array length ranges from 0 to the number of elements displayed on each page. The element structure complies with the ImageLocalInfo definition. If the array is empty, it indicates there are no matching results. |
Example Requests
Query the first 10 records in the local image list.
GET https://{endpoint}/v5/{project_id}/image/local-repositories?offset=0&limit=10
Example Responses
Status code: 200
Request succeeded.
{
"data_list" : [ {
"image_id" : "f757deea-781e-45ec-90ec-f199249890df",
"image_name" : "webshell-ljx",
"image_version" : "v1",
"image_digest" : "sha256:ce0b5d91b072730d0bc9518f11efd07eb7fdb9f43251e11a96cab5b1918b7044",
"local_image_type" : "swr_image",
"scan_status" : "success",
"image_size" : 215304488,
"latest_update_time" : 1697509433000,
"latest_scan_time" : 1709973506292,
"host_num" : 0,
"container_num" : 5,
"component_num" : 146,
"vul_num" : 77,
"host_name" : "myhost",
"host_id" : "9ad79426-992c-4be4-a2d1-dfd3a75b7c14",
"agent_id" : "1c1d073c5fc403eb0d9c3088bc49da4e015586fd4864513a2fd81afedce282d4",
"severity_level" : "High"
} ],
"total_num" : 1
}
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