Skip to content

/AWS1/CL_SSM=>LISTDOCUMENTS()

About ListDocuments

Returns all Systems Manager (SSM) documents in the current Amazon Web Services account and Amazon Web Services Region. You can limit the results of this request by using a filter.

Method Signature

IMPORTING

Optional arguments:

it_documentfilterlist TYPE /AWS1/CL_SSMDOCUMENTFILTER=>TT_DOCUMENTFILTERLIST TT_DOCUMENTFILTERLIST

This data type is deprecated. Instead, use Filters.

it_filters TYPE /AWS1/CL_SSMDOCKEYVALUESFILTER=>TT_DOCUMENTKEYVALUESFILTERLIST TT_DOCUMENTKEYVALUESFILTERLIST

One or more DocumentKeyValuesFilter objects. Use a filter to return a more specific list of results. For keys, you can specify one or more key-value pair tags that have been applied to a document. Other valid keys include Owner, Name, PlatformTypes, DocumentType, and TargetType. For example, to return documents you own use Key=Owner,Values=Self. To specify a custom key-value pair, use the format Key=tag:tagName,Values=valueName.

This API operation only supports filtering documents by using a single tag key and one or more tag values. For example: Key=tag:tagName,Values=valueName1,valueName2

iv_maxresults TYPE /AWS1/SSMMAXRESULTS /AWS1/SSMMAXRESULTS

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

iv_nexttoken TYPE /AWS1/SSMNEXTTOKEN /AWS1/SSMNEXTTOKEN

The token for the next set of items to return. (You received this token from a previous call.)

RETURNING

oo_output TYPE REF TO /aws1/cl_ssmlistdocsresult /AWS1/CL_SSMLISTDOCSRESULT

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_ssm~listdocuments(
  it_documentfilterlist = VALUE /aws1/cl_ssmdocumentfilter=>tt_documentfilterlist(
    (
      new /aws1/cl_ssmdocumentfilter(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  it_filters = VALUE /aws1/cl_ssmdockeyvaluesfilter=>tt_documentkeyvaluesfilterlist(
    (
      new /aws1/cl_ssmdockeyvaluesfilter(
        it_values = VALUE /aws1/cl_ssmdockeyvalsfiltva00=>tt_dockeyvaluesfiltervalues(
          ( new /aws1/cl_ssmdockeyvalsfiltva00( |string| ) )
        )
        iv_key = |string|
      )
    )
  )
  iv_maxresults = 123
  iv_nexttoken = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_documentidentifiers( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_documentarn = lo_row_1->get_name( ).
      lv_datetime = lo_row_1->get_createddate( ).
      lv_documentdisplayname = lo_row_1->get_displayname( ).
      lv_documentowner = lo_row_1->get_owner( ).
      lv_documentversionname = lo_row_1->get_versionname( ).
      LOOP AT lo_row_1->get_platformtypes( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_platformtype = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_documentversion = lo_row_1->get_documentversion( ).
      lv_documenttype = lo_row_1->get_documenttype( ).
      lv_documentschemaversion = lo_row_1->get_schemaversion( ).
      lv_documentformat = lo_row_1->get_documentformat( ).
      lv_targettype = lo_row_1->get_targettype( ).
      LOOP AT lo_row_1->get_tags( ) into lo_row_4.
        lo_row_5 = lo_row_4.
        IF lo_row_5 IS NOT INITIAL.
          lv_tagkey = lo_row_5->get_key( ).
          lv_tagvalue = lo_row_5->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_row_1->get_requires( ) into lo_row_6.
        lo_row_7 = lo_row_6.
        IF lo_row_7 IS NOT INITIAL.
          lv_documentarn = lo_row_7->get_name( ).
          lv_documentversion = lo_row_7->get_version( ).
          lv_requiretype = lo_row_7->get_requiretype( ).
          lv_documentversionname = lo_row_7->get_versionname( ).
        ENDIF.
      ENDLOOP.
      lv_reviewstatus = lo_row_1->get_reviewstatus( ).
      lv_documentauthor = lo_row_1->get_author( ).
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.