Adds images to Security Center on the Assets page and creates an image scan task to scan the images.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | PublicSyncAndCreateImageScanTask |
The operation that you want to perform. Set the value to PublicSyncAndCreateImageScanTask. |
SourceIp | String | No | 1.2.X.X |
The source IP address of the request. |
Images | String | No | [{"registryType":"acr","repoId":"crr-red9kgqqi0fh75d5","instanceId":"cri-1x2qtjd75ofqvfa8","repoNamespace":"1125","regionId":"cn-hangzhou","repoName":"script1","digest":"b1064a5007786b6f82a50772858e8156bc1e5fbddb7dd20af6922761ad197fe4","tag":"v0113-ver2","createTime":1641267666666,"updateTime":1641267909090}] |
The information about the images. The value of this parameter is in the JSON format and contains the following fields:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | F9353221-40F4-5F98-B73C-2803DC804033 |
The ID of the request, which is used to locate and troubleshoot issues. |
Data | Object |
The data returned if the call is successful. |
|
TaskId | String | a410bb3e68c217a3368bc0238c66886d |
The ID of the image scan task. |
TotalCount | Integer | 5 |
The total number of images to scan. |
FinishCount | Integer | 5 |
The number of images that have been scanned. |
CollectTime | Long | 1644286364150 |
The timestamp when the information about the image was collected. Unit: milliseconds. |
ExecTime | Long | 1644286364150 |
The timestamp when the image scan task started to run. Unit: milliseconds. |
Status | String | SUCCESS |
The status of the image scan task. Valid values:
|
Progress | Integer | 100 |
The progress of the image scan task. |
Result | String | SUCCESS |
The result of the image scan task. Valid values:
|
CanCreate | Boolean | true |
Indicates whether you can continue to create an image scan task. Valid values:
Note By default, a maximum of 10 image scan tasks can be running at the same time. If more
than 10 image scan tasks are running, you cannot create an image scan task by calling
this operation. You must wait for at least one of the 10 existing image scan tasks
to complete before you can create an image scan task.
|
Examples
Sample requests
http(s)://[Endpoint]/?Action=PublicSyncAndCreateImageScanTask
&SourceIp=1.2.X.X
&Images=[{"registryType":"acr","repoId":"crr-red9kgqqi0fh75d5","instanceId":"cri-1x2qtjd75ofqvfa8","repoNamespace":"1125","regionId":"cn-hangzhou","repoName":"script1","digest":"b1064a5007786b6f82a50772858e8156bc1e5fbddb7dd20af6922761ad197fe4","tag":"v0113-ver2","createTime":1641267666666,"updateTime":1641267909090}]
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<PublicSyncAndCreateImageScanTaskResponse>
<RequestId>F9353221-40F4-5F98-B73C-2803DC804033</RequestId>
<Data>
<TaskId>a410bb3e68c217a3368bc0238c66886d</TaskId>
<TotalCount>5</TotalCount>
<FinishCount>5</FinishCount>
<CollectTime>1644286364150</CollectTime>
<ExecTime>1644286364150</ExecTime>
<Status>SUCCESS</Status>
<Progress>100</Progress>
<Result>SUCCESS</Result>
<CanCreate>true</CanCreate>
</Data>
</PublicSyncAndCreateImageScanTaskResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "F9353221-40F4-5F98-B73C-2803DC804033",
"Data" : {
"TaskId" : "a410bb3e68c217a3368bc0238c66886d",
"TotalCount" : 5,
"FinishCount" : 5,
"CollectTime" : 1644286364150,
"ExecTime" : 1644286364150,
"Status" : "SUCCESS",
"Progress" : 100,
"Result" : "SUCCESS",
"CanCreate" : true
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
500 | ServerError | ServerError | The error message returned because a server error occurred. |
For a list of error codes, visit the API Error Center.