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
3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 | |