Queries the number of images to scan in a image scan task and the quota for container image scan to be consumed by the task.

You can call the PublicPreCheckImageScanTask operation to estimate the quota for container image scan to be consumed by the task. This ensures that you know the quota to be consumed before you perform the task. If the remaining quota for container image scan is less than the quota to be consumed by the task, you must purchase a sufficient quota. This prevents the task from being stopped due to an insufficient quota.

When you call this operation, if you do not specify the optional parameters, the total number of protected images and the quota for container image scan to be consumed by scanning all the protected images are queried. If you specify the optional parameters, the number of images that meet the specified conditions and the quota for container image scan to be consumed by scanning the images are queried.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes PublicPreCheckImageScanTask

The operation that you want to perform. Set the value to PublicPreCheckImageScanTask.

SourceIp String No 1.2.X.X

The source IP address of the request.

RegistryTypes String No acr

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

  • acr
  • harbor
  • quay
RegionIds String No cn-hangzhou

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

InstanceIds String No i-uf6j8vq9l4r5ntht****

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

RepoNamespaces String No hanghai-namespace

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

RepoIds String No crr-vridcl4****

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

RepoNames String No centos

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

Digests String No 6a5e103187b31a94592a47a5858617f7****

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

Tags String No 0.2

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

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.

ScanImageCount Integer 3

The quota of container image scan to be consumed by the task.

NeedAuthCount Integer 6

The number of images to scan in the task.

Examples

Sample requests

http(s)://[Endpoint]/?Action=PublicPreCheckImageScanTask
&SourceIp=1.2.X.X
&RegistryTypes=acr
&RegionIds=cn-hangzhou
&InstanceIds=i-uf6j8vq9l4r5ntht****
&RepoNamespaces=hanghai-namespace
&RepoIds=crr-vridcl4****
&RepoNames=centos
&Digests=6a5e103187b31a94592a47a5858617f7****
&Tags=0.2
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<PublicPreCheckImageScanTaskResponse>
    <RequestId>F9353221-40F4-5F98-B73C-2803DC804033</RequestId>
    <Data>
        <ScanImageCount>3</ScanImageCount>
        <NeedAuthCount>6</NeedAuthCount>
    </Data>
</PublicPreCheckImageScanTaskResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "F9353221-40F4-5F98-B73C-2803DC804033",
  "Data" : {
    "ScanImageCount" : 3,
    "NeedAuthCount" : 6
  }
}

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.