Jump to Content

Class StartImageScanCommandProtected

Starts an image vulnerability scan. An image scan can only be started once per 24 hours on an individual image. This limit includes if an image was scanned on initial push. For more information, see Image scanning in the Amazon Elastic Container Registry User Guide.

Example

Use a bare-bones client and the command you need to make an API call.

import { ECRClient, StartImageScanCommand } from "@aws-sdk/client-ecr"; // ES Modules import
// const { ECRClient, StartImageScanCommand } = require("@aws-sdk/client-ecr"); // CommonJS import
const client = new ECRClient(config);
const input = { // StartImageScanRequest
registryId: "STRING_VALUE",
repositoryName: "STRING_VALUE", // required
imageId: { // ImageIdentifier
imageDigest: "STRING_VALUE",
imageTag: "STRING_VALUE",
},
};
const command = new StartImageScanCommand(input);
const response = await client.send(command);

Param

StartImageScanCommandInput

Returns

StartImageScanCommandOutput

See

Throws

ImageNotFoundException (client fault)

The image requested does not exist in the specified repository.

Throws

InvalidParameterException (client fault)

The specified parameter is invalid. Review the available parameters for the API request.

Throws

LimitExceededException (client fault)

The operation did not succeed because it would have exceeded a service limit for your account. For more information, see Amazon ECR service quotas in the Amazon Elastic Container Registry User Guide.

Throws

RepositoryNotFoundException (client fault)

The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.

Throws

ServerException (server fault)

These errors are usually caused by a server-side issue.

Throws

UnsupportedImageTypeException (client fault)

The image is of a type that cannot be scanned.

Throws

ValidationException (client fault)

There was an exception validating this request.

Hierarchy

Constructors

Properties

middlewareStack: MiddlewareStack<StartImageScanCommandInput, StartImageScanCommandOutput>

Methods