update_image_storage_class
async
¶
update_image_storage_class(
repository_name: RepositoryName,
image_id: ImageIdentifier,
target_storage_class: TargetStorageClass,
*,
config_overrides: Optional[AsyncECRClientConfig] = 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.
>>> await 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.
>>> await 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/async_ecr.py
3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 | |