Skip to content

/AWS1/IF_ECR=>UPDATEIMAGESTORAGECLASS()

About UpdateImageStorageClass

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.

Method Signature

METHODS /AWS1/IF_ECR~UPDATEIMAGESTORAGECLASS
  IMPORTING
    !IV_REGISTRYID TYPE /AWS1/ECRREGISTRYID OPTIONAL
    !IV_REPOSITORYNAME TYPE /AWS1/ECRREPOSITORYNAME OPTIONAL
    !IO_IMAGEID TYPE REF TO /AWS1/CL_ECRIMAGEIDENTIFIER OPTIONAL
    !IV_TARGETSTORAGECLASS TYPE /AWS1/ECRTARGETSTORAGECLASS OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ecrupdimagestrgclrsp
  RAISING
    /AWS1/CX_ECRIMAGENOTFOUNDEX
    /AWS1/CX_ECRIMAGESTRGCLUPNOT00
    /AWS1/CX_ECRINVALIDPARAMETEREX
    /AWS1/CX_ECRREPOSITORYNOTFNDEX
    /AWS1/CX_ECRSERVEREXCEPTION
    /AWS1/CX_ECRVALIDATIONEX
    /AWS1/CX_ECRCLIENTEXC
    /AWS1/CX_ECRSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_repositoryname TYPE /AWS1/ECRREPOSITORYNAME /AWS1/ECRREPOSITORYNAME

The name of the repository that contains the image to transition.

io_imageid TYPE REF TO /AWS1/CL_ECRIMAGEIDENTIFIER /AWS1/CL_ECRIMAGEIDENTIFIER

imageId

iv_targetstorageclass TYPE /AWS1/ECRTARGETSTORAGECLASS /AWS1/ECRTARGETSTORAGECLASS

The target storage class for the image.

Optional arguments:

iv_registryid TYPE /AWS1/ECRREGISTRYID /AWS1/ECRREGISTRYID

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.

RETURNING

oo_output TYPE REF TO /aws1/cl_ecrupdimagestrgclrsp /AWS1/CL_ECRUPDIMAGESTRGCLRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->updateimagestorageclass(
  io_imageid = new /aws1/cl_ecrimageidentifier(
    iv_imagedigest = |string|
    iv_imagetag = |string|
  )
  iv_registryid = |string|
  iv_repositoryname = |string|
  iv_targetstorageclass = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_registryid = lo_result->get_registryid( ).
  lv_repositoryname = lo_result->get_repositoryname( ).
  lo_imageidentifier = lo_result->get_imageid( ).
  IF lo_imageidentifier IS NOT INITIAL.
    lv_imagedigest = lo_imageidentifier->get_imagedigest( ).
    lv_imagetag = lo_imageidentifier->get_imagetag( ).
  ENDIF.
  lv_imagestatus = lo_result->get_imagestatus( ).
ENDIF.

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.

DATA(lo_result) = lo_client->updateimagestorageclass(
  io_imageid = new /aws1/cl_ecrimageidentifier( iv_imagedigest = |sha256:0b1a4e0c81c434fa7928e5c4a2651a521ebabc4ff200c65f7e25b99373efca3b| )
  iv_registryid = |724772093679|
  iv_repositoryname = |hello-repository|
  iv_targetstorageclass = |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.

DATA(lo_result) = lo_client->updateimagestorageclass(
  io_imageid = new /aws1/cl_ecrimageidentifier( iv_imagedigest = |sha256:0b1a4e0c81c434fa7928e5c4a2651a521ebabc4ff200c65f7e25b99373efca3b| )
  iv_registryid = |724772093679|
  iv_repositoryname = |hello-repository|
  iv_targetstorageclass = |STANDARD|
).