Performing Local Image Scans
Function
This API is used to scan local images.
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/local/batch-scan
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID |
|
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
|
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 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
operate_all |
No |
Boolean |
Whether to scan all local images. true: yes; other values: no |
|
image_info_list |
No |
Array of LocalImageInfo objects |
List of local images to be scanned |
|
image_name |
No |
String |
Image Name |
|
image_version |
No |
String |
Image version |
|
local_image_type |
No |
String |
Image type. Its value can be: |
|
scan_status |
No |
String |
Scan status. Its value can be: |
|
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. |
Response Parameters
Status code: 200
Request succeeded.
None
Example Requests
Local image scan
POST https://{endpoint}/v5/{project_id}/image/local/batch-scan?enterprise_project_id=all_granted_eps
{
"image_info_list" : [ {
"image_name" : "swr.cn-north-7.myhuaweicloud.com/scc_hss_container/install-hss-agent",
"image_version" : "1.0.10.x86_64",
"image_digest" : "sha256:05b5081012e562d14c374de2a4c74511f9e8e0adc572d3b35fb3df06de0da63b",
"image_id" : "c499ab72-7ee9-4ee6-b6b7-5973230e7a7b"
}, {
"image_name" : "swr.cn-north-7.myhuaweicloud.com/glz/webshell-ljx",
"image_version" : "v1",
"image_digest" : "sha256:ce0b5d91b072730d0bc9518f11efd07eb7fdb9f43251e11a96cab5b1918b7044",
"image_id" : "b8722a02-162f-4e4e-8100-127605e3a07b"
} ],
"operate_all" : false
}
Example Responses
None
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