Skip to content

/AWS1/CL_RGR=>LISTGROUPS()

About ListGroups

Returns a list of existing Resource Groups in your account.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:ListGroups

Method Signature

IMPORTING

Optional arguments:

it_filters TYPE /AWS1/CL_RGRGROUPFILTER=>TT_GROUPFILTERLIST TT_GROUPFILTERLIST

Filters, formatted as GroupFilter objects, that you want to apply to a ListGroups operation.

  • resource-type - Filter the results to include only those resource groups that have the specified resource type in their ResourceTypeFilter. For example, AWS::EC2::Instance would return any resource group with a ResourceTypeFilter that includes AWS::EC2::Instance.

  • configuration-type - Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:

    • AWS::ResourceGroups::ApplicationGroup

    • AWS::AppRegistry::Application

    • AWS::AppRegistry::ApplicationResourceGroup

    • AWS::CloudFormation::Stack

    • AWS::EC2::CapacityReservationPool

    • AWS::EC2::HostManagement

    • AWS::NetworkFirewall::RuleGroup

iv_maxresults TYPE /AWS1/RGRMAXRESULTS /AWS1/RGRMAXRESULTS

The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

iv_nexttoken TYPE /AWS1/RGRNEXTTOKEN /AWS1/RGRNEXTTOKEN

The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value provided by a previous call's NextToken response to indicate where the output should continue from.

RETURNING

oo_output TYPE REF TO /aws1/cl_rgrlistgroupsoutput /AWS1/CL_RGRLISTGROUPSOUTPUT

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_rgr~listgroups(
  it_filters = VALUE /aws1/cl_rgrgroupfilter=>tt_groupfilterlist(
    (
      new /aws1/cl_rgrgroupfilter(
        it_values = VALUE /aws1/cl_rgrgroupfiltvalues_w=>tt_groupfiltervalues(
          ( new /aws1/cl_rgrgroupfiltvalues_w( |string| ) )
        )
        iv_name = |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_groupidentifiers( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_groupname = lo_row_1->get_groupname( ).
      lv_grouparn = lo_row_1->get_grouparn( ).
      lv_description = lo_row_1->get_description( ).
      lv_criticality = lo_row_1->get_criticality( ).
      lv_owner = lo_row_1->get_owner( ).
      lv_displayname = lo_row_1->get_displayname( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_groups( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      lv_grouparnv2 = lo_row_3->get_grouparn( ).
      lv_groupname = lo_row_3->get_name( ).
      lv_description = lo_row_3->get_description( ).
      lv_criticality = lo_row_3->get_criticality( ).
      lv_owner = lo_row_3->get_owner( ).
      lv_displayname = lo_row_3->get_displayname( ).
      LOOP AT lo_row_3->get_applicationtag( ) into ls_row_4.
        lv_key = ls_row_4-key.
        lo_value = ls_row_4-value.
        IF lo_value IS NOT INITIAL.
          lv_applicationarn = lo_value->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.