update_image_storage_class
¶
update_image_storage_class(
repository_name: RepositoryName,
image_id: ImageIdentifier,
target_storage_class: TargetStorageClass,
*,
config_overrides: Optional[ECRClientConfig] = None,
registry_id: Optional[RegistryId] = None,
) -> UpdateImageStorageClassResponse
Transitions an image between storage classes. You can transition images from Amazon ECR standard storage class to Amazon ECR archival storage class for long-term storage, or restore archived images back to Amazon ECR standard.
Parameters:
-
registry_id(Optional[RegistryId], default:None) –The Amazon Web Services account ID associated with the registry that contains the image to transition. If you do not specify a registry, the default registry is assumed.
-
repository_name(RepositoryName) –The name of the repository that contains the image to transition.
-
target_storage_class(TargetStorageClass) –The target storage class for the image.
Raises:
-
ImageNotFoundException–The image requested does not exist in the specified repository.
-
ImageStorageClassUpdateNotSupportedException–The requested image storage class update is not supported.
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
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.
-
ValidationException–There was an exception validating this request.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To transition an image to Amazon ECR Archive This example transitions an image with a specific digest in the hello-repository repository to Amazon ECR Archive storage for long-term archival.
>>> client.update_image_storage_class(registry_id='724772093679', repository_name='hello-repository', image_id={'imageDigest': 'sha256:0b1a4e0c81c434fa7928e5c4a2651a521ebabc4ff200c65f7e25b99373efca3b'}, target_storage_class='ARCHIVE')
To restore an archived image to Amazon ECR Standard
This example restores an archived image with a specific digest back to Amazon ECR Standard storage.
>>> client.update_image_storage_class(registry_id='724772093679', repository_name='hello-repository', image_id={'imageDigest': 'sha256:0b1a4e0c81c434fa7928e5c4a2651a521ebabc4ff200c65f7e25b99373efca3b'}, target_storage_class='STANDARD')
Source code in docs_src/capo_ecr/_services/ecr.py
3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 | |