Skip to content

/AWS1/CL_EMR=>LISTCLUSTERS()

About ListClusters

Provides the status of all clusters visible to this Amazon Web Services account. Allows you to filter the list of clusters based on certain criteria; for example, filtering by cluster creation date and time or by status. This call returns a maximum of 50 clusters in unsorted order per call, but returns a marker to track the paging of the cluster list across multiple ListClusters calls.

Method Signature

IMPORTING

Optional arguments:

iv_createdafter TYPE /AWS1/EMRDATE /AWS1/EMRDATE

The creation date and time beginning value filter for listing clusters.

iv_createdbefore TYPE /AWS1/EMRDATE /AWS1/EMRDATE

The creation date and time end value filter for listing clusters.

it_clusterstates TYPE /AWS1/CL_EMRCLUSTERSTATELIST_W=>TT_CLUSTERSTATELIST TT_CLUSTERSTATELIST

The cluster state filters to apply when listing clusters. Clusters that change state while this action runs may be not be returned as expected in the list of clusters.

iv_marker TYPE /AWS1/EMRMARKER /AWS1/EMRMARKER

The pagination token that indicates the next set of results to retrieve.

RETURNING

oo_output TYPE REF TO /aws1/cl_emrlistclustersoutput /AWS1/CL_EMRLISTCLUSTERSOUTPUT

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_emr~listclusters(
  it_clusterstates = VALUE /aws1/cl_emrclusterstatelist_w=>tt_clusterstatelist(
    ( new /aws1/cl_emrclusterstatelist_w( |string| ) )
  )
  iv_createdafter = '20150101000000.0000000'
  iv_createdbefore = '20150101000000.0000000'
  iv_marker = |string|
).

This is an example of reading all possible response values

LOOP AT lo_result->get_clusters( ) into lo_row.
  lv_clusterid = lo_row_1->get_id( ).
  lv_string = lo_row_1->get_name( ).
  lv_clusterstate = lo_clusterstatus->get_state( ).
  lv_clusterstatechangereaso_1 = lo_clusterstatechangereaso->get_code( ).
  lv_string = lo_clusterstatechangereaso->get_message( ).
  lv_date = lo_clustertimeline->get_creationdatetime( ).
  lv_date = lo_clustertimeline->get_readydatetime( ).
  lv_date = lo_clustertimeline->get_enddatetime( ).
  LOOP AT lo_clusterstatus->get_errordetails( ) into lo_row_2.
    lv_string = lo_row_3->get_errorcode( ).
    LOOP AT lo_row_3->get_errordata( ) into lt_row_4.
      LOOP AT lt_row_4 into ls_row_5.
        lv_key = ls_row_5-key.
        lv_string = lo_value->get_value( ).
      ENDLOOP.
    ENDLOOP.
    lv_string = lo_row_3->get_errormessage( ).
  ENDLOOP.
  lv_integer = lo_row_1->get_normalizedinstancehours( ).
  lv_arntype = lo_row_1->get_clusterarn( ).
  lv_optionalarntype = lo_row_1->get_outpostarn( ).
ENDLOOP.
lv_marker = lo_result->get_marker( ).