Skip to content

/AWS1/IF_LSA=>REGISTERCONTAINERIMAGE()

About RegisterContainerImage

Registers a container image to your Amazon Lightsail container service.

This action is not required if you install and use the Lightsail Control (lightsailctl) plugin to push container images to your Lightsail container service. For more information, see Pushing and managing container images on your Amazon Lightsail container services in the Amazon Lightsail Developer Guide.

Method Signature

METHODS /AWS1/IF_LSA~REGISTERCONTAINERIMAGE
  IMPORTING
    !IV_SERVICENAME TYPE /AWS1/LSACONTAINERSERVICENAME OPTIONAL
    !IV_LABEL TYPE /AWS1/LSACONTAINERLABEL OPTIONAL
    !IV_DIGEST TYPE /AWS1/LSASTRING OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_lsaregcontainerimag01
  RAISING
    /AWS1/CX_LSAACCESSDENIEDEX
    /AWS1/CX_LSAINVALIDINPUTEX
    /AWS1/CX_LSANOTFOUNDEXCEPTION
    /AWS1/CX_LSARGNSETUPINPRGSSEX
    /AWS1/CX_LSASERVICEEXCEPTION
    /AWS1/CX_LSAUNAUTHNTCTDEX
    /AWS1/CX_LSACLIENTEXC
    /AWS1/CX_LSASERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_servicename TYPE /AWS1/LSACONTAINERSERVICENAME /AWS1/LSACONTAINERSERVICENAME

The name of the container service for which to register a container image.

iv_label TYPE /AWS1/LSACONTAINERLABEL /AWS1/LSACONTAINERLABEL

The label for the container image when it's registered to the container service.

Use a descriptive label that you can use to track the different versions of your registered container images.

Use the GetContainerImages action to return the container images registered to a Lightsail container service. The label is the portion of the following image name example:

  • :container-service-1..1

If the name of your container service is mycontainerservice, and the label that you specify is mystaticwebsite, then the name of the registered container image will be :mycontainerservice.mystaticwebsite.1.

The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be 2. If you push and register another container image, the version number will be 3, and so on.

iv_digest TYPE /AWS1/LSASTRING /AWS1/LSASTRING

The digest of the container image to be registered.

RETURNING

oo_output TYPE REF TO /aws1/cl_lsaregcontainerimag01 /AWS1/CL_LSAREGCONTAINERIMAG01

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->registercontainerimage(
  iv_digest = |string|
  iv_label = |string|
  iv_servicename = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_containerimage = lo_result->get_containerimage( ).
  IF lo_containerimage IS NOT INITIAL.
    lv_string = lo_containerimage->get_image( ).
    lv_string = lo_containerimage->get_digest( ).
    lv_isodate = lo_containerimage->get_createdat( ).
  ENDIF.
ENDIF.