Skip to content

/AWS1/IF_OSR=>LISTDATASOURCEATTACHMENTS()

About ListDataSourceAttachments

Returns a paginated list of all data source attachments for an OpenSearch application, including attachments in all states (PENDING, ATTACHED, and FAILED).

Method Signature

METHODS /AWS1/IF_OSR~LISTDATASOURCEATTACHMENTS
  IMPORTING
    !IV_ID TYPE /AWS1/OSRID OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/OSRSTRING OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/OSRINTEGER OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_osrlstdatasrcatmtsrsp
  RAISING
    /AWS1/CX_OSRACCESSDENIEDEX
    /AWS1/CX_OSRDISABLEDOPEX
    /AWS1/CX_OSRINTERNALEXCEPTION
    /AWS1/CX_OSRRESOURCENOTFOUNDEX
    /AWS1/CX_OSRVALIDATIONEX
    /AWS1/CX_OSRCLIENTEXC
    /AWS1/CX_OSRSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_id TYPE /AWS1/OSRID /AWS1/OSRID

The unique identifier or name of the OpenSearch application to list attachments for.

Optional arguments:

iv_nexttoken TYPE /AWS1/OSRSTRING /AWS1/OSRSTRING

The pagination token from a previous call to retrieve the next set of results.

iv_maxresults TYPE /AWS1/OSRINTEGER /AWS1/OSRINTEGER

The maximum number of results to return per page. The default is 50.

RETURNING

oo_output TYPE REF TO /aws1/cl_osrlstdatasrcatmtsrsp /AWS1/CL_OSRLSTDATASRCATMTSRSP

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->listdatasourceattachments(
  iv_id = |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_attachments( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_string = lo_row_1->get_attachmentid( ).
      lv_arn = lo_row_1->get_datasourcearn( ).
      lv_datasourceattachmentsta = lo_row_1->get_status( ).
    ENDIF.
  ENDLOOP.
  lv_string = lo_result->get_nexttoken( ).
ENDIF.