/AWS1/IF_ECR=>CREATEREPOSITORY()¶
About CreateRepository¶
Creates a repository. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide.
Method Signature¶
METHODS /AWS1/IF_ECR~CREATEREPOSITORY
IMPORTING
!IV_REGISTRYID TYPE /AWS1/ECRREGISTRYID OPTIONAL
!IV_REPOSITORYNAME TYPE /AWS1/ECRREPOSITORYNAME OPTIONAL
!IT_TAGS TYPE /AWS1/CL_ECRTAG=>TT_TAGLIST OPTIONAL
!IV_IMAGETAGMUTABILITY TYPE /AWS1/ECRIMAGETAGMUTABILITY OPTIONAL
!IT_IMAGETAGMUTABILITYEXCLU00 TYPE /AWS1/CL_ECRIMAGETAGMUTABILI00=>TT_IMAGETAGMUTABILITYEXCLUSI00 OPTIONAL
!IO_IMAGESCANNINGCONF TYPE REF TO /AWS1/CL_ECRIMAGESCANNINGCONF OPTIONAL
!IO_ENCRYPTIONCONFIGURATION TYPE REF TO /AWS1/CL_ECRENCRYPTIONCONF OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ecrcrerepositoryrsp
RAISING
/AWS1/CX_ECRINVALIDPARAMETEREX
/AWS1/CX_ECRINVALIDTAGPARAMEX
/AWS1/CX_ECRKMSEXCEPTION
/AWS1/CX_ECRLIMITEXCEEDEDEX
/AWS1/CX_ECRREPOSITORYALREXEX
/AWS1/CX_ECRSERVEREXCEPTION
/AWS1/CX_ECRTOOMANYTAGSEX
/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 to use for the repository. The repository name may be specified on its own (such as
nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such asproject-a/nginx-web-app).The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes.
Optional arguments:¶
iv_registryid TYPE /AWS1/ECRREGISTRYID /AWS1/ECRREGISTRYID¶
The Amazon Web Services account ID associated with the registry to create the repository. If you do not specify a registry, the default registry is assumed.
it_tags TYPE /AWS1/CL_ECRTAG=>TT_TAGLIST TT_TAGLIST¶
The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
iv_imagetagmutability TYPE /AWS1/ECRIMAGETAGMUTABILITY /AWS1/ECRIMAGETAGMUTABILITY¶
The tag mutability setting for the repository. If this parameter is omitted, the default setting of
MUTABLEwill be used which will allow image tags to be overwritten. IfIMMUTABLEis specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
it_imagetagmutabilityexclu00 TYPE /AWS1/CL_ECRIMAGETAGMUTABILI00=>TT_IMAGETAGMUTABILITYEXCLUSI00 TT_IMAGETAGMUTABILITYEXCLUSI00¶
A list of filters that specify which image tags should be excluded from the repository's image tag mutability setting.
io_imagescanningconf TYPE REF TO /AWS1/CL_ECRIMAGESCANNINGCONF /AWS1/CL_ECRIMAGESCANNINGCONF¶
The
imageScanningConfigurationparameter is being deprecated, in favor of specifying the image scanning configuration at the registry level. For more information, seePutRegistryScanningConfiguration.The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
io_encryptionconfiguration TYPE REF TO /AWS1/CL_ECRENCRYPTIONCONF /AWS1/CL_ECRENCRYPTIONCONF¶
The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ecrcrerepositoryrsp /AWS1/CL_ECRCREREPOSITORYRSP¶
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->createrepository(
io_encryptionconfiguration = new /aws1/cl_ecrencryptionconf(
iv_encryptiontype = |string|
iv_kmskey = |string|
)
io_imagescanningconf = new /aws1/cl_ecrimagescanningconf( ABAP_TRUE )
it_imagetagmutabilityexclu00 = VALUE /aws1/cl_ecrimagetagmutabili00=>tt_imagetagmutabilityexclusi00(
(
new /aws1/cl_ecrimagetagmutabili00(
iv_filter = |string|
iv_filtertype = |string|
)
)
)
it_tags = VALUE /aws1/cl_ecrtag=>tt_taglist(
(
new /aws1/cl_ecrtag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_imagetagmutability = |string|
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 create a new repository¶
This example creates a repository called nginx-web-app inside the project-a namespace in the default registry for an account.
DATA(lo_result) = lo_client->createrepository( iv_repositoryname = |project-a/nginx-web-app| ) .