Skip to content

/AWS1/CL_KYZ=>GETSTREAM()

About GetStream

Returns detailed information about a specific data capture stream for an Amazon Keyspaces table. The information includes the stream's Amazon Resource Name (ARN), creation time, current status, retention period, shard composition, and associated table details. This operation helps you monitor and manage the configuration of your Amazon Keyspaces data streams.

Method Signature

IMPORTING

Required arguments:

iv_streamarn TYPE /AWS1/KYZSTREAMARN /AWS1/KYZSTREAMARN

The Amazon Resource Name (ARN) of the stream for which detailed information is requested. This uniquely identifies the specific stream you want to get information about.

Optional arguments:

iv_maxresults TYPE /AWS1/KYZINTEGER /AWS1/KYZINTEGER

The maximum number of shard objects to return in a single GetStream request. Default value is 100. The minimum value is 1 and the maximum value is 100.

io_shardfilter TYPE REF TO /AWS1/CL_KYZSHARDFILTER /AWS1/CL_KYZSHARDFILTER

Optional filter criteria to apply when retrieving shards. You can filter shards based on their state or other attributes to narrow down the results returned by the GetStream operation.

iv_nexttoken TYPE /AWS1/KYZSHARDIDTOKEN /AWS1/KYZSHARDIDTOKEN

An optional pagination token provided by a previous GetStream operation. If this parameter is specified, the response includes only records beyond the token, up to the value specified by maxResults.

RETURNING

oo_output TYPE REF TO /aws1/cl_kyzgetstreamoutput /AWS1/CL_KYZGETSTREAMOUTPUT

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_kyz~getstream(
  io_shardfilter = new /aws1/cl_kyzshardfilter(
    iv_shardid = |string|
    iv_type = |string|
  )
  iv_maxresults = 123
  iv_nexttoken = |string|
  iv_streamarn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_streamarn = lo_result->get_streamarn( ).
  lv_string = lo_result->get_streamlabel( ).
  lv_streamstatus = lo_result->get_streamstatus( ).
  lv_streamviewtype = lo_result->get_streamviewtype( ).
  lv_date = lo_result->get_creationrequestdatetime( ).
  lv_keyspacename = lo_result->get_keyspacename( ).
  lv_tablename = lo_result->get_tablename( ).
  LOOP AT lo_result->get_shards( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_shardid = lo_row_1->get_shardid( ).
      lo_sequencenumberrange = lo_row_1->get_sequencenumberrange( ).
      IF lo_sequencenumberrange IS NOT INITIAL.
        lv_sequencenumber = lo_sequencenumberrange->get_startingsequencenumber( ).
        lv_sequencenumber = lo_sequencenumberrange->get_endingsequencenumber( ).
      ENDIF.
      LOOP AT lo_row_1->get_parentshardids( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_shardid = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  lv_shardidtoken = lo_result->get_nexttoken( ).
ENDIF.