All Products
Search
Document Center

Security Center:PublicCreateImageScanTask

Last Updated:Nov 25, 2024

Creates an image scan task.

Operation description

Before you call the PublicCreateImageScanTask operation, we recommend that you call the PublicPreCheckImageScanTask operation to query the number of images to scan and the quota for container image scan to be consumed by the image scan task. Make sure that the remaining quota for container image scan is sufficient. This prevents the task from being stopped due to an insufficient quota.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-sas:PublicCreateImageScanTasknone
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SourceIpstringNo

The source IP address of the request.

192.168..XX.XX
RegistryTypesstringNo

The type of the image repository. Separate multiple types with commas (,). Valid values:

  • acr
  • harbor
  • quay
acr
RegionIdsstringNo

The region ID of the image. Separate multiple IDs with commas (,).

cn-hangzhou
InstanceIdsstringNo

The ID of the Container Registry instance in which the image repository is created. Separate multiple IDs with commas (,).

i-uf6j8vq9l4r5ntht****
RepoNamespacesstringNo

The namespace to which the image repository belongs. Separate multiple namespaces with commas (,).

hanghai-namespace
RepoIdsstringNo

The ID of the image repository. Separate multiple IDs with commas (,).

crr-vridcl4****
RepoNamesstringNo

The name of the image repository. Separate multiple names with commas (,).

centos
DigestsstringNo

The SHA-256 value of the image digest. Separate multiple SHA-256 values with commas (,).

6a5e103187b31a94592a47a5858617f7a6c
TagsstringNo

The tag that is added to the image. Separate multiple tags with commas (,).

0.2

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

F9353221-40F4-5F98-B73C-2803DC804033
Dataobject

The data returned if the call is successful.

TaskIdstring

The ID of the image scan task.

a410bb3e68c217a3368bc0238c66886d
TotalCountinteger

The total number of images to scan.

5
FinishCountinteger

The number of images that have been scanned.

5
CollectTimelong

The timestamp when the image information was collected. Unit: milliseconds.

1644286364150
ExecTimelong

The timestamp when the image scan task started to run. Unit: milliseconds.

1644286364150
Statusstring

The status of the image scan task. Valid values:

  • INIT: The task is being initialized.
  • PRE_ANALYZER: The task is being pre-processed.
  • SUCCESS: The task is successful.
  • FAIL: The task fails.
SUCCESS
Progressinteger

The progress of the image scan task in percentage.

100
Resultstring

The result of the image scan task. Valid values:

  • SUCCESS: The task is successful.
  • TASK_NOT_SUPPORT_REGION: The images are deployed in a region that is not supported by container image scan.
Note For more information about the regions supported by container image scan, see the "Regions supported by container image scan" section in this topic.
SUCCESS
CanCreateboolean

Indicates whether you can create more image scan tasks. Valid values:

  • true: yes
  • false: no
Note By default, a maximum of 10 image scan tasks can be running at the same time. If 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.
true

Regions supported by container image scan

RegionCityRegion ID
China (Hangzhou)Hangzhoucn-hangzhou
China (Shanghai)Shanghaicn-shanghai
China (Shenzhen)Shenzhencn-shenzhen
China (Qingdao)Qingdaocn-qingdao
China (Beijing)Beijingcn-beijing
China (Zhangjiakou)Zhangjiakoucn-zhangjiakou
China (Hohhot)Hohhotcn-huhehaote
China (Hong Kong)Hong Kongcn-hongkong
Japan (Tokyo)Tokyoap-northeast-1
Indonesia (Jakarta)Jakartaap-southeast-5
US (Silicon Valley)Silicon Valleyus-west-1
US (Virginia)Virginiaus-east-1
Germany (Frankfurt)Frankfurteu-central-1
UK (London)Londoneu-west-1

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400BeyondQuataPlease check the scan quotaCheck the quota of the assets that can be scanned.
403NoPermissioncaller has no permissionYou are not authorized to do this operation.
500ServerErrorServerError-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-10-08The Error code has changedView Change Details
2022-08-01The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-08-01The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-01-13Add OperationView Change Details