Skip to content

/AWS1/IF_KNS=>LISTCHANNELS()

About ListChannels

Lists the channels in your account. You can filter the results by source stream. The results are paginated. Use the NextToken value returned in the response to retrieve additional results.

Use this operation to find channels before deleting a stream, or to audit the channels configured in an Amazon Web Services Region.

This operation has a call limit of 5 transactions per second (TPS) for each Amazon Web Services account. Exceeding 5 TPS results in a LimitExceededException.

Method Signature

METHODS /AWS1/IF_KNS~LISTCHANNELS
  IMPORTING
    !IT_STREAMFILTER TYPE /AWS1/CL_KNSSTREAMFILTER=>TT_STREAMFILTERLIST OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/KNSLISTCHNLSINPUTLIMIT OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/KNSNEXTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_knslistchannelsoutput
  RAISING
    /AWS1/CX_KNSACCESSDENIEDEX
    /AWS1/CX_KNSEXPIREDNEXTTOKENEX
    /AWS1/CX_KNSINVALIDARGUMENTEX
    /AWS1/CX_KNSLIMITEXCEEDEDEX
    /AWS1/CX_KNSVALIDATIONEX
    /AWS1/CX_KNSCLIENTEXC
    /AWS1/CX_KNSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

it_streamfilter TYPE /AWS1/CL_KNSSTREAMFILTER=>TT_STREAMFILTERLIST TT_STREAMFILTERLIST

Filters the results to channels associated with the specified streams.

iv_maxresults TYPE /AWS1/KNSLISTCHNLSINPUTLIMIT /AWS1/KNSLISTCHNLSINPUTLIMIT

The maximum number of channels to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.

iv_nexttoken TYPE /AWS1/KNSNEXTTOKEN /AWS1/KNSNEXTTOKEN

The pagination token returned by a previous call. Specify this token to retrieve the next page of results. This value is null when there are no more results to return.

RETURNING

oo_output TYPE REF TO /aws1/cl_knslistchannelsoutput /AWS1/CL_KNSLISTCHANNELSOUTPUT

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->listchannels(
  it_streamfilter = VALUE /aws1/cl_knsstreamfilter=>tt_streamfilterlist(
    (
      new /aws1/cl_knsstreamfilter(
        iv_streamarn = |string|
        iv_streamcreationtimestamp = '20150101000000.0000000'
      )
    )
  )
  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_channelsummaries( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_channelname = lo_row_1->get_channelname( ).
      lv_channelarn = lo_row_1->get_channelarn( ).
      lv_channelid = lo_row_1->get_channelid( ).
      lv_channelstatus = lo_row_1->get_channelstatus( ).
      lv_channelstatusreason = lo_row_1->get_channelstatusreason( ).
      lv_timestamp = lo_row_1->get_channelcreationtimestamp( ).
      lv_channeldestinationtype = lo_row_1->get_channeldestinationtype( ).
      LOOP AT lo_row_1->get_streams( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_streamarn = lo_row_3->get_streamarn( ).
          lv_timestamp = lo_row_3->get_streamcreationtimestamp( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.

To list channels

To list channels

DATA(lo_result) = lo_client->listchannels( ).

To list channels filtered by stream

To list channels filtered by stream

DATA(lo_result) = lo_client->listchannels(
  it_streamfilter = VALUE /aws1/cl_knsstreamfilter=>tt_streamfilterlist(
    ( new /aws1/cl_knsstreamfilter( iv_streamarn = |arn:aws:kinesis:us-east-1:123456789012:stream/my-stream-name| )  )
  )
  iv_maxresults = 10
).