Jump to Content

Class PutImageCommandProtected

Creates or updates the image manifest and tags associated with an image.

When an image is pushed and all new image layers have been uploaded, the PutImage API is called once to create or update the image manifest and the tags associated with the image.

    <note>
<p>This operation is used by the Amazon ECR proxy and is not generally used by
customers for pulling and pushing images. In most cases, you should use the <code>docker</code> CLI to pull, tag, and push images.</p>
</note>

Example

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

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

Param

PutImageCommandInput

Returns

PutImageCommandOutput

See

Throws

ImageAlreadyExistsException (client fault)

The specified image has already been pushed, and there were no changes to the manifest or image tag after the last push.

Throws

ImageDigestDoesNotMatchException (client fault)

The specified image digest does not match the digest that Amazon ECR calculated for the image.

Throws

ImageTagAlreadyExistsException (client fault)

The specified image is tagged with a tag that already exists. The repository is configured for tag immutability.

Throws

InvalidParameterException (client fault)

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

Throws

KmsException (client fault)

The operation failed due to a KMS exception.

Throws

LayersNotFoundException (client fault)

The specified layers could not be found, or the specified layer is not valid for this repository.

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

ReferencedImagesNotFoundException (client fault)

The manifest list is referencing an image that does not exist.

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.

Hierarchy

Constructors

Properties

middlewareStack: MiddlewareStack<PutImageCommandInput, PutImageCommandOutput>

Methods