put_image
¶
put_image(
repository_name: RepositoryName,
image_manifest: ImageManifest,
*,
config_overrides: Optional[ECRClientConfig] = None,
registry_id: Optional[RegistryId] = None,
image_manifest_media_type: Optional[MediaType] = None,
image_tag: Optional[ImageTag] = None,
image_digest: Optional[ImageDigest] = None,
) -> PutImageResponse
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.
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 docker CLI to pull, tag, and push images.
Parameters:
-
registry_id(Optional[RegistryId], default:None) –The Amazon Web Services account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.
-
repository_name(RepositoryName) –The name of the repository in which to put the image.
-
image_manifest(ImageManifest) –The image manifest corresponding to the image to be uploaded.
-
image_manifest_media_type(Optional[MediaType], default:None) –The media type of the image manifest. If you push an image manifest that does not contain the
mediaTypefield, you must specify theimageManifestMediaTypein the request. -
image_tag(Optional[ImageTag], default:None) –The tag to associate with the image. This parameter is optional.
-
image_digest(Optional[ImageDigest], default:None) –The image digest of the image manifest corresponding to the image.
Raises:
-
ImageAlreadyExistsException–The specified image has already been pushed, and there were no changes to the manifest or image tag after the last push.
-
ImageDigestDoesNotMatchException–The specified image digest does not match the digest that Amazon ECR calculated for the image.
-
ImageTagAlreadyExistsException–The specified image is tagged with a tag that already exists. The repository is configured for tag immutability.
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
KmsException–The operation failed due to a KMS exception.
-
LayersNotFoundException–The specified layers could not be found, or the specified layer is not valid for this repository.
-
LimitExceededException–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.
-
ReferencedImagesNotFoundException–The manifest list is referencing an image that does not exist.
-
RepositoryNotFoundException–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.
-
ServerException–These errors are usually caused by a server-side issue.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ecr/_services/ecr.py
2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 | |