All Products
Search
Document Center

Security Center:PublicSyncAndCreateImageScanTask

Last Updated:Nov 13, 2024

Adds images to Security Center and creates an image scan task to scan the images.

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:PublicSyncAndCreateImageScanTasknone
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SourceIpstringNo

The source IP address of the request.

1.2.X.X
ImagesstringYes

The information about the images. The value of this parameter is in the JSON format and contains the following fields:

  • RegistryType: the type of the image repository. Valid values:

    • acr
    • harbor
    • quay
  • RepoId: the ID of the image repository.

  • InstanceId: the ID of the Container Registry instance to which the image repository belongs.

  • RepoNamespace: the namespace to which the image repository belongs.

  • RegionId: the region ID of the image.

  • RepoName: the name of the image repository.

  • Digest: the digest of the image.

  • Tag: the tag that is added to the image.

  • CreateTime: the timestamp when the image was created. Unit: milliseconds.

  • UpdateTime: the timestamp when the image was updated. Unit: milliseconds.

[{"registryType":"acr","repoId":"crr-red9kgqqi0fh75d5","instanceId":"cri-1x2qtjd75ofqvfa8","repoNamespace":"1125","regionId":"cn-hangzhou","repoName":"script1","digest":"b1064a5007786b6f82a50772858e8156bc1e5fbddb7dd20af6922761ad197fe4","tag":"v0113-ver2","createTime":1641267666666,"updateTime":1641267909090}]

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 failed.
SUCCESS
Progressinteger

The progress of the image scan task.

100
Resultstring

The result of the image scan task. Valid values:

  • SUCCESS: The task is successful.
  • TASK_NOT_SUPPORT_REGION: The image is deployed in a region that is not supported by container image scan.
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

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
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
2022-08-01The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-01-13Add OperationView Change Details