Skip to content

/AWS1/IF_ECR=>DELETEREPOSITORY()

About DeleteRepository

Deletes a repository. If the repository isn't empty, you must either delete the contents of the repository or use the force option to delete the repository and have Amazon ECR delete all of its contents on your behalf.

Method Signature

IMPORTING

Required arguments:

iv_repositoryname TYPE /AWS1/ECRREPOSITORYNAME /AWS1/ECRREPOSITORYNAME

The name of the repository to delete.

Optional arguments:

iv_registryid TYPE /AWS1/ECRREGISTRYID /AWS1/ECRREGISTRYID

The Amazon Web Services account ID associated with the registry that contains the repository to delete. If you do not specify a registry, the default registry is assumed.

iv_force TYPE /AWS1/ECRFORCEFLAG /AWS1/ECRFORCEFLAG

If true, deleting the repository force deletes the contents of the repository. If false, the repository must be empty before attempting to delete it.

RETURNING

oo_output TYPE REF TO /aws1/cl_ecrdelrepositoryrsp /AWS1/CL_ECRDELREPOSITORYRSP

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->/aws1/if_ecr~deleterepository(
  iv_force = ABAP_TRUE
  iv_registryid = |string|
  iv_repositoryname = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_repository = lo_result->get_repository( ).
  IF lo_repository IS NOT INITIAL.
    lv_arn = lo_repository->get_repositoryarn( ).
    lv_registryid = lo_repository->get_registryid( ).
    lv_repositoryname = lo_repository->get_repositoryname( ).
    lv_url = lo_repository->get_repositoryuri( ).
    lv_creationtimestamp = lo_repository->get_createdat( ).
    lv_imagetagmutability = lo_repository->get_imagetagmutability( ).
    LOOP AT lo_repository->get_imagetagmutabilityexcl00( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_imagetagmutabilityexclu = lo_row_1->get_filtertype( ).
        lv_imagetagmutabilityexclu_1 = lo_row_1->get_filter( ).
      ENDIF.
    ENDLOOP.
    lo_imagescanningconfigurat = lo_repository->get_imagescanningconf( ).
    IF lo_imagescanningconfigurat IS NOT INITIAL.
      lv_scanonpushflag = lo_imagescanningconfigurat->get_scanonpush( ).
    ENDIF.
    lo_encryptionconfiguration = lo_repository->get_encryptionconfiguration( ).
    IF lo_encryptionconfiguration IS NOT INITIAL.
      lv_encryptiontype = lo_encryptionconfiguration->get_encryptiontype( ).
      lv_kmskey = lo_encryptionconfiguration->get_kmskey( ).
    ENDIF.
  ENDIF.
ENDIF.

To force delete a repository

This example force deletes a repository named ubuntu in the default registry for an account. The force parameter is required if the repository contains images.

DATA(lo_result) = lo_client->/aws1/if_ecr~deleterepository(
  iv_force = ABAP_TRUE
  iv_repositoryname = |ubuntu|
).