Skip to content

/AWS1/IF_IMG=>LISTIMAGES()

About ListImages

Returns the list of images that you have access to.

Method Signature

METHODS /AWS1/IF_IMG~LISTIMAGES
  IMPORTING
    !IV_OWNER TYPE /AWS1/IMGOWNERSHIP OPTIONAL
    !IT_FILTERS TYPE /AWS1/CL_IMGFILTER=>TT_FILTERLIST OPTIONAL
    !IV_BYNAME TYPE /AWS1/IMGBOOLEAN OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/IMGRESTRICTEDINTEGER OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/IMGPAGINATIONTOKEN OPTIONAL
    !IV_INCLUDEDEPRECATED TYPE /AWS1/IMGNULLABLEBOOLEAN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_imglistimagesresponse
  RAISING
    /AWS1/CX_IMGCALLRLIMEXCEEDEDEX
    /AWS1/CX_IMGCLIENTEXCEPTION
    /AWS1/CX_IMGFORBIDDENEXCEPTION
    /AWS1/CX_IMGINVPAGINATIONTOKEX
    /AWS1/CX_IMGINVALIDREQUESTEX
    /AWS1/CX_IMGSERVICEEXCEPTION
    /AWS1/CX_IMGSERVICEUNAVAILEX
    /AWS1/CX_IMGCLIENTEXC
    /AWS1/CX_IMGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_owner TYPE /AWS1/IMGOWNERSHIP /AWS1/IMGOWNERSHIP

Filters the list to images owned by you, by Amazon, or shared with you by other accounts. By default, only your account's images are returned.

it_filters TYPE /AWS1/CL_IMGFILTER=>TT_FILTERLIST TT_FILTERLIST

Use the following filters to streamline results:

  • name

  • osVersion

  • platform

  • type

  • version

iv_byname TYPE /AWS1/IMGBOOLEAN /AWS1/IMGBOOLEAN

Specifies whether to return one entry per image name, with all versions of each image aggregated. Defaults to false, which returns one entry per image version. You can't combine this option with the version filter.

iv_maxresults TYPE /AWS1/IMGRESTRICTEDINTEGER /AWS1/IMGRESTRICTEDINTEGER

The maximum number of items to return in a single request.

iv_nexttoken TYPE /AWS1/IMGPAGINATIONTOKEN /AWS1/IMGPAGINATIONTOKEN

A token to specify where to start paginating. Use the nextToken value from a previously truncated response.

iv_includedeprecated TYPE /AWS1/IMGNULLABLEBOOLEAN /AWS1/IMGNULLABLEBOOLEAN

Specifies whether to include deprecated Amazon-managed images in the results. Deprecated images that you own are always returned. Defaults to false.

RETURNING

oo_output TYPE REF TO /aws1/cl_imglistimagesresponse /AWS1/CL_IMGLISTIMAGESRESPONSE

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->listimages(
  it_filters = VALUE /aws1/cl_imgfilter=>tt_filterlist(
    (
      new /aws1/cl_imgfilter(
        it_values = VALUE /aws1/cl_imgfiltervalues_w=>tt_filtervalues(
          ( new /aws1/cl_imgfiltervalues_w( |string| ) )
        )
        iv_name = |string|
      )
    )
  )
  iv_byname = ABAP_TRUE
  iv_includedeprecated = ABAP_TRUE
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_owner = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_nonemptystring = lo_result->get_requestid( ).
  LOOP AT lo_result->get_imageversionlist( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_imagebuilderarn = lo_row_1->get_arn( ).
      lv_resourcename = lo_row_1->get_name( ).
      lv_imagetype = lo_row_1->get_type( ).
      lv_versionnumber = lo_row_1->get_version( ).
      lv_platform = lo_row_1->get_platform( ).
      lv_osversion = lo_row_1->get_osversion( ).
      lv_nonemptystring = lo_row_1->get_owner( ).
      lv_datetime = lo_row_1->get_datecreated( ).
      lv_buildtype = lo_row_1->get_buildtype( ).
      lv_imagesource = lo_row_1->get_imagesource( ).
    ENDIF.
  ENDLOOP.
  lv_paginationtoken = lo_result->get_nexttoken( ).
ENDIF.

List images that you own

The following example lists the image versions that you own. Setting byName to false returns each image version as its own entry, instead of grouping build versions under their image name.

DATA(lo_result) = lo_client->listimages(
  iv_byname = ABAP_FALSE
  iv_owner = |Self|
).