Skip to content

/AWS1/IF_CWS=>LISTGROUPINGATTRIBUTEDEFNS()

About ListGroupingAttributeDefinitions

Returns the current grouping configuration for this account, including all custom grouping attribute definitions that have been configured. These definitions determine how services are logically grouped based on telemetry attributes, Amazon Web Services tags, or predefined mappings.

Method Signature

METHODS /AWS1/IF_CWS~LISTGROUPINGATTRIBUTEDEFNS
  IMPORTING
    !IV_NEXTTOKEN TYPE /AWS1/CWSNEXTTOKEN OPTIONAL
    !IV_AWSACCOUNTID TYPE /AWS1/CWSAWSACCOUNTID OPTIONAL
    !IV_INCLUDELINKEDACCOUNTS TYPE /AWS1/CWSBOOLEAN OPTIONAL
  PREFERRED PARAMETER iv_nexttoken
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwslstgringattrdefs01
  RAISING
    /AWS1/CX_CWSACCESSDENIEDEX
    /AWS1/CX_CWSTHROTTLINGEX
    /AWS1/CX_CWSVALIDATIONEX
    /AWS1/CX_CWSCLIENTEXC
    /AWS1/CX_CWSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_nexttoken TYPE /AWS1/CWSNEXTTOKEN /AWS1/CWSNEXTTOKEN

Include this value, if it was returned by the previous operation, to get the next set of grouping attribute definitions.

iv_awsaccountid TYPE /AWS1/CWSAWSACCOUNTID /AWS1/CWSAWSACCOUNTID

The Amazon Web Services account ID to retrieve grouping attribute definitions for. Use this when accessing grouping configurations from a different account in cross-account monitoring scenarios.

iv_includelinkedaccounts TYPE /AWS1/CWSBOOLEAN /AWS1/CWSBOOLEAN

If you are using this operation in a monitoring account, specify true to include grouping attributes from source accounts in the returned data.

RETURNING

oo_output TYPE REF TO /aws1/cl_cwslstgringattrdefs01 /AWS1/CL_CWSLSTGRINGATTRDEFS01

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->listgroupingattributedefns(
  iv_awsaccountid = |string|
  iv_includelinkedaccounts = ABAP_TRUE
  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_groupingattributedefns( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_groupingstring = lo_row_1->get_groupingname( ).
      LOOP AT lo_row_1->get_groupingsourcekeys( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_groupingstring = lo_row_3->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_groupingstring = lo_row_1->get_defaultgroupingvalue( ).
    ENDIF.
  ENDLOOP.
  lv_timestamp = lo_result->get_updatedat( ).
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.